-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Required prerequisites
- I have read the documentation https://docs.oasis.camel-ai.org/.
- I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
- Consider asking first in a Discussion.
What version of camel-oasis are you using?
0.2.3
System information
None
Problem description
It seems that the function perform_action_by_llm in agent.py returns in the loop which would result in the function return before all tool calls executed.
async def perform_action_by_llm(self):
# Get posts:
env_prompt = await self.env.to_text_prompt()
user_msg = BaseMessage.make_user_message(
role_name="User",
content=(
f"Please perform social media actions after observing the "
f"platform environments. Notice that don't limit your "
f"actions for example to just like the posts. "
f"Here is your social media environment: {env_prompt}"))
try:
agent_log.info(
f"Agent {self.social_agent_id} observing environment: "
f"{env_prompt}")
response = await self.astep(user_msg)
for tool_call in response.info['tool_calls']:
action_name = tool_call.tool_name
args = tool_call.args
agent_log.info(f"Agent {self.social_agent_id} performed "
f"action: {action_name} with args: {args}")
if action_name not in ALL_SOCIAL_ACTIONS:
agent_log.info(
f"Agent {self.social_agent_id} get the result: "
f"{tool_call.result}")
# Abort graph action for if 100w Agent
# self.perform_agent_graph_action(action_name, args)
return response
except Exception as e:
agent_log.error(f"Agent {self.social_agent_id} error: {e}")
return eIt might be repaired by putting the return statement outside of the loop.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working