fix: The tag based thinking process does not output (#2968)

This commit is contained in:
shaohuzhang1 2025-04-24 10:57:10 +08:00 committed by GitHub
parent c8441cfd73
commit b1f6092620
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,10 +24,11 @@ def _convert_delta_to_message_chunk(
_dict: Mapping[str, Any], default_class: type[BaseMessageChunk]
) -> BaseMessageChunk:
id_ = _dict.get("id")
reasoning_content = cast(str, _dict.get("reasoning_content") or "")
role = cast(str, _dict.get("role"))
content = cast(str, _dict.get("content") or "")
additional_kwargs: dict = {'reasoning_content': reasoning_content}
additional_kwargs: dict = {}
if 'reasoning_content' in _dict:
additional_kwargs['reasoning_content'] = _dict.get('reasoning_content')
if _dict.get("function_call"):
function_call = dict(_dict["function_call"])
if "name" in function_call and function_call["name"] is None: