crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
19.23k stars 2.66k forks source link

[BUG] Agent does not perform the tool call despite identifying the Action & Action Input correctly: Composio #1155

Open Sneh-Nagrecha-SS opened 1 month ago

Sneh-Nagrecha-SS commented 1 month ago

Description Agent does not perform the tool call despite identifying the Action & Action Input correctly. Also note that other tool calls seem to be working fine, it is with this one that the agent refuses to perform the actual call.

Screenshots/Code snippets

composio_toolset = ComposioToolSet()
tools=composio_toolset.get_actions(actions=[Action.GOOGLECALENDAR_CREATE_EVENT])
agent = Agent(
        role="Calender Manager",
        goal="You manage user's google calendar efficiently",
        backstory="You are an expert at managing Google Calendar using GOOGLECALENDAR APIs & tools",
        verbose=True,
        tools=tools,
        max_iter=3
        )
bookCalenderTask = Task(
    description=f"""
    Create calender event with the user on appropriate time and date. Make sure to include all the participants in the 
    the event. And also create a meeting room for the same.

    Today's Datetime details: {date}
    Current Timezone: {timezone}

    REQUEST DETAILS:
    {request}

    """,
    agent=agent,
    expected_output="Response as received from tool",
)

Logs

 [2024-08-08 16:50:51][DEBUG]: == Working Agent: Calender Manager
 [2024-08-08 16:50:51][INFO]: == Starting Task: 
    Create calender event with the user on appropriate time and date. Make sure to include all the participants in the 
    the event. And also create a meeting room for the same.

    Today's Datetime details: 2024-08-08
    Current Timezone: IST

    REQUEST DETAILS:
    Book a meeting at 8 pm IST with bilbo.baggins@hobbit.com for 1 hour to discuss about the hobbit party

> Entering new CrewAgentExecutor chain...
Thought: I need to create a calendar event for a meeting at 8 PM IST with Bilbo Baggins to discuss the Hobbit party. The meeting will last for 1 hour, and I also need to create a Google Meet link for the event.

Action: googlecalendar_create_event

Action Input: {
    "start_datetime": "2024-08-08T20:00:00+05:30",
    "event_duration": "1h",
    "description": "Discussion about the Hobbit party.",
    "create_meeting_room": true,
    "attendees": ["bilbo.baggins@hobbit.com"],
    "summary": "Meeting to Discuss Hobbit Party",
    "timezone": "Asia/Kolkata"
}
Thought: I need to create a calendar event for a meeting at 8 PM IST with Bilbo Baggins to discuss the Hobbit party. The meeting will last for 1 hour, and I also need to create a Google Meet link for the event.

Action: googlecalendar_create_event

Action Input: {
    "start_datetime": "2024-08-08T20:00:00+05:30",
    "event_duration": "1h",
    "description": "Discussion about the Hobbit party.",
    "create_meeting_room": true,
    "attendees": ["bilbo.baggins@hobbit.com"],
    "summary": "Meeting to Discuss Hobbit Party",
    "timezone": "Asia/Kolkata"
}
Thought: I need to correctly format the action input dictionary for creating the calendar event. The time zone should be specified correctly, and all required fields must be included.

Action: googlecalendar_create_event

Action Input: {
    "start_datetime": "2024-08-08T20:00:00+05:30",
    "event_duration": "1h",
    "description": "Discussion about the Hobbit party.",
    "create_meeting_room": true,
    "attendees": ["bilbo.baggins@hobbit.com"],
    "summary": "Meeting to Discuss Hobbit Party",
    "timezone": "Asia/Kolkata",
    "send_updates": true
}

> Finished chain.
 [2024-08-08 16:51:00][DEBUG]: == [Calender Manager] Task output: Agent stopped due to iteration limit or time limit.
meetwudi commented 1 month ago

Same issue here with googlecalendar_find_event


Thought: I need to ensure that I correctly ask the Calendar Assistant for the details of the next meeting named "Di / David". I will provide all necessary context and rephrase the question to avoid any errors.

Action: Ask question to coworker
Action Input: {"question": "Can you provide the date and time of the next meeting named 'Di / David'?", "context": "The user needs to know the schedule for their next meeting named 'Di / David'. Today's date is 2024-08-11.", "coworker": "Calendar Assistant"}

> Entering new CrewAgentExecutor chain...
To find the next meeting named 'Di / David', I need to search for events with that query in the user's Google Calendar and filter for the next occurrence.

Action: googlecalendar_find_event
Action Input: {"query": "Di / David", "order_by": "startTime", "single_events": True, "timeMin": "2024-08-11T00:00:00Z"}Thought: I need to search for events with the query "Di / David" in the user's Google Calendar, ensuring that the results are ordered by start time and are single events. The search should start from today's date, 2024-08-11.

Action: googlecalendar_find_event
Action Input: {"query": "Di / David", "order_by": "startTime", "single_events": True, "timeMin": "2024-08-11T00:00:00Z", "calendar_id": "primary"}Thought: It seems like there was an error with the action input format. I'll try again, ensuring the input is correctly formatted.

Action: googlecalendar_find_event
Action Input: {"query": "Di / David", "order_by": "startTime", "single_events": True, "timeMin": "2024-08-11T00:00:00Z"}
Sneh-Nagrecha-SS commented 1 month ago

Tried limiting the num of iterations to force the agent to break the loop but then at the end of the iterations, it just returns an error saying that it reached the max no of iterations.