We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8441cf commit b1f6092Copy full SHA for b1f6092
1 file changed
apps/setting/models_provider/impl/base_chat_open_ai.py
@@ -24,10 +24,11 @@ def _convert_delta_to_message_chunk(
24
_dict: Mapping[str, Any], default_class: type[BaseMessageChunk]
25
) -> BaseMessageChunk:
26
id_ = _dict.get("id")
27
- reasoning_content = cast(str, _dict.get("reasoning_content") or "")
28
role = cast(str, _dict.get("role"))
29
content = cast(str, _dict.get("content") or "")
30
- additional_kwargs: dict = {'reasoning_content': reasoning_content}
+ additional_kwargs: dict = {}
+ if 'reasoning_content' in _dict:
31
+ additional_kwargs['reasoning_content'] = _dict.get('reasoning_content')
32
if _dict.get("function_call"):
33
function_call = dict(_dict["function_call"])
34
if "name" in function_call and function_call["name"] is None:
0 commit comments