From bd2fec4813c96283819b433dbd212d29f49095ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=86=E8=90=8C=E9=97=B7=E6=B2=B9=E7=93=B6?= <253605712@qq.com> Date: Sun, 29 Dec 2024 11:52:12 +0800 Subject: [PATCH] fix: #12125 (#12184) --- api/core/agent/base_agent_runner.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/core/agent/base_agent_runner.py b/api/core/agent/base_agent_runner.py index 8d69bdcec2..ae086ba8ed 100644 --- a/api/core/agent/base_agent_runner.py +++ b/api/core/agent/base_agent_runner.py @@ -339,13 +339,13 @@ class BaseAgentRunner(AppRunner): raise ValueError(f"Agent thought {agent_thought.id} not found") agent_thought = queried_thought - if thought is not None: + if thought: agent_thought.thought = thought - if tool_name is not None: + if tool_name: agent_thought.tool = tool_name - if tool_input is not None: + if tool_input: if isinstance(tool_input, dict): try: tool_input = json.dumps(tool_input, ensure_ascii=False) @@ -354,7 +354,7 @@ class BaseAgentRunner(AppRunner): agent_thought.tool_input = tool_input - if observation is not None: + if observation: if isinstance(observation, dict): try: observation = json.dumps(observation, ensure_ascii=False) @@ -363,7 +363,7 @@ class BaseAgentRunner(AppRunner): agent_thought.observation = observation - if answer is not None: + if answer: agent_thought.answer = answer if messages_ids is not None and len(messages_ids) > 0: