瀏覽代碼

fix: #12125 (#12184)

tags/0.15.0
呆萌闷油瓶 10 月之前
父節點
當前提交
bd2fec4813
No account linked to committer's email address
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5
    5
      api/core/agent/base_agent_runner.py

+ 5
- 5
api/core/agent/base_agent_runner.py 查看文件

raise ValueError(f"Agent thought {agent_thought.id} not found") raise ValueError(f"Agent thought {agent_thought.id} not found")
agent_thought = queried_thought agent_thought = queried_thought


if thought is not None:
if thought:
agent_thought.thought = thought agent_thought.thought = thought


if tool_name is not None:
if tool_name:
agent_thought.tool = tool_name agent_thought.tool = tool_name


if tool_input is not None:
if tool_input:
if isinstance(tool_input, dict): if isinstance(tool_input, dict):
try: try:
tool_input = json.dumps(tool_input, ensure_ascii=False) tool_input = json.dumps(tool_input, ensure_ascii=False)


agent_thought.tool_input = tool_input agent_thought.tool_input = tool_input


if observation is not None:
if observation:
if isinstance(observation, dict): if isinstance(observation, dict):
try: try:
observation = json.dumps(observation, ensure_ascii=False) observation = json.dumps(observation, ensure_ascii=False)


agent_thought.observation = observation agent_thought.observation = observation


if answer is not None:
if answer:
agent_thought.answer = answer agent_thought.answer = answer


if messages_ids is not None and len(messages_ids) > 0: if messages_ids is not None and len(messages_ids) > 0:

Loading…
取消
儲存