Skip to content

Commit

Permalink
Update react_agent.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzhang1130 committed Sep 12, 2024
1 parent bfaf9ed commit 7931596
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/agentscope/agents/react_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,20 @@ def _acting(self, function_call: dict) -> None:
]

# The execution message, may be execution output or error information
msg_execution = self.service_toolkit.parse_and_call_func(
msg_execution_str = self.service_toolkit.parse_and_call_func(
formatted_function_call,
)

# Convert the string to a Msg object
msg_execution = Msg(
name="system",
content=msg_execution_str,
role="system",
echo=self.verbose
)

if self.verbose:
self.speak(msg_execution)
self.speak(msg_execution.content)
self.memory.add(msg_execution)

@staticmethod
Expand All @@ -243,4 +252,4 @@ def finish(response: str) -> ServiceResponse:
return ServiceResponse(
status=ServiceExecStatus.SUCCESS,
content=response,
)
)

0 comments on commit 7931596

Please sign in to comment.