Skip to content

Commit b1f6092

Browse files
authored
fix: The tag based thinking process does not output (#2968)
1 parent c8441cf commit b1f6092

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/setting/models_provider/impl/base_chat_open_ai.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def _convert_delta_to_message_chunk(
2424
_dict: Mapping[str, Any], default_class: type[BaseMessageChunk]
2525
) -> BaseMessageChunk:
2626
id_ = _dict.get("id")
27-
reasoning_content = cast(str, _dict.get("reasoning_content") or "")
2827
role = cast(str, _dict.get("role"))
2928
content = cast(str, _dict.get("content") or "")
30-
additional_kwargs: dict = {'reasoning_content': reasoning_content}
29+
additional_kwargs: dict = {}
30+
if 'reasoning_content' in _dict:
31+
additional_kwargs['reasoning_content'] = _dict.get('reasoning_content')
3132
if _dict.get("function_call"):
3233
function_call = dict(_dict["function_call"])
3334
if "name" in function_call and function_call["name"] is None:

0 commit comments

Comments
 (0)