mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-08 20:23:41 +00:00
fix(provider): support StepFun Plan API reasoning field fallback
StepFun Plan API returns response content in the 'reasoning' field when the model is in thinking mode and 'content' is empty. OpenAICompatProvider previously only checked 'content' and 'reasoning_content', missing this field. This patch adds a fallback: if content is empty and 'reasoning' is present, extract text from reasoning to populate content, ensuring StepFun models (step-3.5-flash, step-3.5-flash-2603) work correctly with tool calls. Co-authored-by: moranfong <moranfong@gmail.com>
This commit is contained in:
parent
c736cecc28
commit
53107c6683
@ -455,6 +455,9 @@ class OpenAICompatProvider(LLMProvider):
|
||||
finish_reason = str(choice0.get("finish_reason") or "stop")
|
||||
|
||||
raw_tool_calls: list[Any] = []
|
||||
# StepFun Plan: fallback to reasoning field when content is empty
|
||||
if not content and msg0.get("reasoning"):
|
||||
content = self._extract_text_content(msg0.get("reasoning"))
|
||||
reasoning_content = msg0.get("reasoning_content")
|
||||
for ch in choices:
|
||||
ch_map = self._maybe_mapping(ch) or {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user