Skip to content

Commit 0222c54

Browse files
committed
fix: When using deepseek-reasoner, an error is reported when viewing the agent log.
1 parent 9903f1e commit 0222c54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/core/agent/cot_agent_runner.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ def increase_usage(final_llm_usage_dict: dict[str, Optional[LLMUsage]], usage: L
172172

173173
self.save_agent_thought(
174174
agent_thought=agent_thought,
175-
tool_name=scratchpad.action.action_name if scratchpad.action else "",
175+
tool_name=(
176+
scratchpad.action.action_name
177+
if scratchpad.action and scratchpad.action.action_name != "Final Answer"
178+
else ""
179+
),
176180
tool_input={scratchpad.action.action_name: scratchpad.action.action_input} if scratchpad.action else {},
177181
tool_invoke_meta={},
178182
thought=scratchpad.thought or "",

0 commit comments

Comments
 (0)