Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
leslie2046 committed Dec 28, 2024
1 parent 4f972b7 commit a196a97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions api/core/agent/base_agent_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ def save_agent_thought(
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)
Expand All @@ -354,7 +354,7 @@ def save_agent_thought(

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)
Expand All @@ -363,7 +363,7 @@ def save_agent_thought(

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:
Expand Down
6 changes: 3 additions & 3 deletions api/core/agent/fc_agent_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ def increase_usage(final_llm_usage_dict: dict[str, LLMUsage], usage: LLMUsage):
# save agent thought
self.save_agent_thought(
agent_thought=agent_thought,
tool_name=None,
tool_input=None,
thought=None,
tool_name="",
tool_input="",
thought="",
tool_invoke_meta={
tool_response["tool_call_name"]: tool_response["meta"] for tool_response in tool_responses
},
Expand Down

0 comments on commit a196a97

Please sign in to comment.