Jonathan Hill 2026-06-09 21:44:26 +08:00 committed by GitHub
commit 9ad13f7036
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,8 @@ while True:
extra_body={"chat_template_kwargs": {"open_thinking": True}, "reasoning_effort": "medium"} # 思考开关 extra_body={"chat_template_kwargs": {"open_thinking": True}, "reasoning_effort": "medium"} # 思考开关
) )
if not stream: if not stream:
if not response.choices or response.choices[0].message is None:
raise ValueError("LLM returned empty or filtered response")
assistant_res = response.choices[0].message.content assistant_res = response.choices[0].message.content
print('[A]: ', assistant_res) print('[A]: ', assistant_res)
else: else: