Skip to content

Commit ea6ae23

Browse files
committed
fix: enhance reasoning content handling in base_chat_open_ai.py
1 parent 6fe9cd3 commit ea6ae23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/models_provider/impl/base_chat_open_ai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def _convert_delta_to_message_chunk(
3232
role = cast(str, _dict.get("role"))
3333
content = cast(str, _dict.get("content") or "")
3434
additional_kwargs: dict = {}
35-
if 'reasoning_content' in _dict or 'reasoning' in _dict:
36-
additional_kwargs['reasoning_content'] = _dict.get('reasoning_content') or _dict.get('reasoning')
35+
if reasoning := _dict.get('reasoning_content') or _dict.get('reasoning'):
36+
additional_kwargs['reasoning_content'] = reasoning
3737
if _dict.get("function_call"):
3838
function_call = dict(_dict["function_call"])
3939
if "name" in function_call and function_call["name"] is None:

0 commit comments

Comments
 (0)