continuing-cyan
continuing-cyan•3w ago

Google Calendar FIND_EVENT

I was able to easily integrate composio into my personal assistant platform. The first actions I integrated were for Google Calendar. I can easily create new events, but when I try to search for new events, the list is always empty. The account I have connected has only a single calendar and it has no other events on it other than the one I am searching for.
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_zOitd0waihf9t3MdR36Ub3a1', 'function': {'arguments': '{"calendar_id":"primary","query":"dentist","max_results":5}', 'name': 'GOOGLECALENDAR_FIND_EVENT'}, 'type': 'function'}], 'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 30, 'prompt_tokens': 3346, 'total_tokens': 3376, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_d54531d9eb', 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {}}], 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}}, id='run-646a37fa-9063-4bd8-9c3d-ef83d43d5f23-0', tool_calls=[{'name': 'GOOGLECALENDAR_FIND_EVENT', 'args': {'calendar_id': 'primary', 'query': 'dentist', 'max_results': 5}, 'id': 'call_zOitd0waihf9t3MdR36Ub3a1', 'type': 'tool_call'}], usage_metadata={'input_tokens': 3346, 'output_tokens': 30, 'total_tokens': 3376, 'input_token_details': {}, 'output_token_details': {}}),
ToolMessage(content='{"successfull": true, "data": {"event_data": {"event_data": [], "nextPageToken": null, "nextSyncToken": "CMij-amUxokDEMij-amUxokDGAUghY-_yQIohY-_yQI="}}, "error": null}', name='GOOGLECALENDAR_FIND_EVENT', id='5d641fdd-0c05-4354-99d3-6daf9b188f09', tool_call_id='call_zOitd0waihf9t3MdR36Ub3a1'),
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_zOitd0waihf9t3MdR36Ub3a1', 'function': {'arguments': '{"calendar_id":"primary","query":"dentist","max_results":5}', 'name': 'GOOGLECALENDAR_FIND_EVENT'}, 'type': 'function'}], 'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 30, 'prompt_tokens': 3346, 'total_tokens': 3376, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_d54531d9eb', 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {}}], 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}}, id='run-646a37fa-9063-4bd8-9c3d-ef83d43d5f23-0', tool_calls=[{'name': 'GOOGLECALENDAR_FIND_EVENT', 'args': {'calendar_id': 'primary', 'query': 'dentist', 'max_results': 5}, 'id': 'call_zOitd0waihf9t3MdR36Ub3a1', 'type': 'tool_call'}], usage_metadata={'input_tokens': 3346, 'output_tokens': 30, 'total_tokens': 3376, 'input_token_details': {}, 'output_token_details': {}}),
ToolMessage(content='{"successfull": true, "data": {"event_data": {"event_data": [], "nextPageToken": null, "nextSyncToken": "CMij-amUxokDEMij-amUxokDGAUghY-_yQIohY-_yQI="}}, "error": null}', name='GOOGLECALENDAR_FIND_EVENT', id='5d641fdd-0c05-4354-99d3-6daf9b188f09', tool_call_id='call_zOitd0waihf9t3MdR36Ub3a1'),
You can see in the LangChain agent logs above, I have the tool call message searching for the simple string "dentist", but the response is always an empty list of events. How can I troubleshoot this?
6 Replies
continuing-cyan
continuing-cyanOP•3w ago
For more information, here is the agent logs from when I created the event (I see the "primary" calendar ID being used, so I think it is searching the right calendar in my original post)
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_plSKni5SP58E7kBJRTDRIJ7M', 'function': {'arguments': '{"summary":"Dentist Appointment","description":"Appointment at Whisper Creek Dental","start_datetime":"2024-11-27T10:00:00-07:00","event_duration":"1h30m","location":"Whisper Creek Dental","calendar_id":"primary"}', 'name': 'GOOGLECALENDAR_CREATE_EVENT'}, 'type': 'function'}], 'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 69, 'prompt_tokens': 3060, 'total_tokens': 3129, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_d54531d9eb', 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {}}], 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}}, id='run-10c0cb13-5fd1-4dd3-b90e-fc15e2fc7af4-0', tool_calls=[{'name': 'GOOGLECALENDAR_CREATE_EVENT', 'args': {'summary': 'Dentist Appointment', 'description': 'Appointment at Whisper Creek Dental', 'start_datetime': '2024-11-27T10:00:00-07:00', 'event_duration': '1h30m', 'location': 'Whisper Creek Dental', 'calendar_id': 'primary'}, 'id': 'call_plSKni5SP58E7kBJRTDRIJ7M', 'type': 'tool_call'}], usage_metadata={'input_tokens': 3060, 'output_tokens': 69, 'total_tokens': 3129, 'input_token_details': {}, 'output_token_details': {}}),
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_plSKni5SP58E7kBJRTDRIJ7M', 'function': {'arguments': '{"summary":"Dentist Appointment","description":"Appointment at Whisper Creek Dental","start_datetime":"2024-11-27T10:00:00-07:00","event_duration":"1h30m","location":"Whisper Creek Dental","calendar_id":"primary"}', 'name': 'GOOGLECALENDAR_CREATE_EVENT'}, 'type': 'function'}], 'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 69, 'prompt_tokens': 3060, 'total_tokens': 3129, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_d54531d9eb', 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {}}], 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}}, id='run-10c0cb13-5fd1-4dd3-b90e-fc15e2fc7af4-0', tool_calls=[{'name': 'GOOGLECALENDAR_CREATE_EVENT', 'args': {'summary': 'Dentist Appointment', 'description': 'Appointment at Whisper Creek Dental', 'start_datetime': '2024-11-27T10:00:00-07:00', 'event_duration': '1h30m', 'location': 'Whisper Creek Dental', 'calendar_id': 'primary'}, 'id': 'call_plSKni5SP58E7kBJRTDRIJ7M', 'type': 'tool_call'}], usage_metadata={'input_tokens': 3060, 'output_tokens': 69, 'total_tokens': 3129, 'input_token_details': {}, 'output_token_details': {}}),
As another point of data, I ran another test where I told my assistant to "delete the dentist appointment on November 27th". This generated a new FIND_EVENT tool call which exactly matched the event summary and it worked. Does this mean that FIND_EVENT only works when it completely matches a field? Not just partial matches?
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_nP9HttaHJ0W4KyRLfadfSYmK', 'function': {'arguments': '{"calendar_id":"primary","query":"dentist appointment","timeMin":"2024,11,27,00,00,00","timeMax":"2024,11,27,23,59,59"}', 'name': 'GOOGLECALENDAR_FIND_EVENT'}, 'type': 'function'}], 'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 58, 'prompt_tokens': 3041, 'total_tokens': 3099, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_d54531d9eb', 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {}}], 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}}, id='run-d92a97a1-3fdb-49e2-a164-ab0ad1ce2041-0', tool_calls=[{'name': 'GOOGLECALENDAR_FIND_EVENT', 'args': {'calendar_id': 'primary', 'query': 'dentist appointment', 'timeMin': '2024,11,27,00,00,00', 'timeMax': '2024,11,27,23,59,59'}, 'id': 'call_nP9HttaHJ0W4KyRLfadfSYmK', 'type': 'tool_call'}], usage_metadata={'input_tokens': 3041, 'output_tokens': 58, 'total_tokens': 3099, 'input_token_details': {}, 'output_token_details': {}}),
AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_nP9HttaHJ0W4KyRLfadfSYmK', 'function': {'arguments': '{"calendar_id":"primary","query":"dentist appointment","timeMin":"2024,11,27,00,00,00","timeMax":"2024,11,27,23,59,59"}', 'name': 'GOOGLECALENDAR_FIND_EVENT'}, 'type': 'function'}], 'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 58, 'prompt_tokens': 3041, 'total_tokens': 3099, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-4o-mini', 'system_fingerprint': 'fp_d54531d9eb', 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {}}], 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}}, id='run-d92a97a1-3fdb-49e2-a164-ab0ad1ce2041-0', tool_calls=[{'name': 'GOOGLECALENDAR_FIND_EVENT', 'args': {'calendar_id': 'primary', 'query': 'dentist appointment', 'timeMin': '2024,11,27,00,00,00', 'timeMax': '2024,11,27,23,59,59'}, 'id': 'call_nP9HttaHJ0W4KyRLfadfSYmK', 'type': 'tool_call'}], usage_metadata={'input_tokens': 3041, 'output_tokens': 58, 'total_tokens': 3099, 'input_token_details': {}, 'output_token_details': {}}),
The response:
ToolMessage(content='{"successfull": true, "data": {"event_data": {"event_data": [{"kind": "calendar#event", "etag": "\\"3461685834458000\\"", "id": "d9ce0bjk8o7bt7gjctarti4dr0", "status": "confirmed", "htmlLink": "https://www.google.com/calendar/event?eid=ZDljZTBiams4bzdidDdnamN0YXJ0aTRkcjAgZ3JlZzgwMzAzQG0", "created": "2024-11-05T21:41:57.000Z", "updated": "2024-11-05T21:41:57.229Z", "summary": "Dentist Appointment", "description": "Appointment at Whisper Creek Dental", "location": "Whisper Creek Dental", "creator": {"email": "greg80303@gmail.com", "self": true}, "organizer": {"email": "greg80303@gmail.com", "self": true}, "start": {"dateTime": "2024-11-27T10:00:00-07:00", "timeZone": "America/Denver"}, "end": {"dateTime": "2024-11-27T11:30:00-07:00", "timeZone": "America/Denver"}, "iCalUID": "d9ce0bjk8o7bt7gjctarti4dr0@google.com", "sequence": 0, "reminders": {"useDefault": true}, "eventType": "default"}], "nextPageToken": null, "nextSyncToken": "CMij-amUxokDEMij-amUxokDGAUghY-_yQIohY-_yQI="}}, "error": null}', name='GOOGLECALENDAR_FIND_EVENT', id='00dcc02b-6193-4457-8f39-da6e9e899c3a', tool_call_id='call_nP9HttaHJ0W4KyRLfadfSYmK')]}
ToolMessage(content='{"successfull": true, "data": {"event_data": {"event_data": [{"kind": "calendar#event", "etag": "\\"3461685834458000\\"", "id": "d9ce0bjk8o7bt7gjctarti4dr0", "status": "confirmed", "htmlLink": "https://www.google.com/calendar/event?eid=ZDljZTBiams4bzdidDdnamN0YXJ0aTRkcjAgZ3JlZzgwMzAzQG0", "created": "2024-11-05T21:41:57.000Z", "updated": "2024-11-05T21:41:57.229Z", "summary": "Dentist Appointment", "description": "Appointment at Whisper Creek Dental", "location": "Whisper Creek Dental", "creator": {"email": "greg80303@gmail.com", "self": true}, "organizer": {"email": "greg80303@gmail.com", "self": true}, "start": {"dateTime": "2024-11-27T10:00:00-07:00", "timeZone": "America/Denver"}, "end": {"dateTime": "2024-11-27T11:30:00-07:00", "timeZone": "America/Denver"}, "iCalUID": "d9ce0bjk8o7bt7gjctarti4dr0@google.com", "sequence": 0, "reminders": {"useDefault": true}, "eventType": "default"}], "nextPageToken": null, "nextSyncToken": "CMij-amUxokDEMij-amUxokDGAUghY-_yQIohY-_yQI="}}, "error": null}', name='GOOGLECALENDAR_FIND_EVENT', id='00dcc02b-6193-4457-8f39-da6e9e899c3a', tool_call_id='call_nP9HttaHJ0W4KyRLfadfSYmK')]}
harsh-harlequin
harsh-harlequin•3w ago
Hey @G-Rage, if you don't mind, could you send me your code once for searching??
continuing-cyan
continuing-cyanOP•3w ago
@thatsmeadarsh It's a simple LangChain agent with tools and a prompt. For the tools I'm passing:
tools=ComposioToolSet(
entity_id=<MY_ENTITY_ID>,
api_key=app_config.get("COMPOSIO_API_KEY"),
connected_account_ids={ App.GOOGLECALENDAR: <MY_CONNECTION_ID> }
).get_tools(actions=[
Action.GOOGLECALENDAR_CREATE_EVENT,
Action.GOOGLECALENDAR_FIND_EVENT,
Action.GOOGLECALENDAR_DELETE_EVENT,
Action.GOOGLECALENDAR_UPDATE_EVENT,
Action.GOOGLECALENDAR_REMOVE_ATTENDEE,
]),
tools=ComposioToolSet(
entity_id=<MY_ENTITY_ID>,
api_key=app_config.get("COMPOSIO_API_KEY"),
connected_account_ids={ App.GOOGLECALENDAR: <MY_CONNECTION_ID> }
).get_tools(actions=[
Action.GOOGLECALENDAR_CREATE_EVENT,
Action.GOOGLECALENDAR_FIND_EVENT,
Action.GOOGLECALENDAR_DELETE_EVENT,
Action.GOOGLECALENDAR_UPDATE_EVENT,
Action.GOOGLECALENDAR_REMOVE_ATTENDEE,
]),
In the logs above, the agent is selecting the right tool to search for events on my calendar, it's just that the Google API (or the composio implementation of it) is returning an empty list of events. I don't think I'm allowed to send you all my code that runs this. If I can find some time, I can try to write a simple test app that shows the issue
genetic-orange
genetic-orange•3w ago
hi @G-Rage, I can hop on a call with you if that's okay to resolve this issue, let me know 🙂
continuing-cyan
continuing-cyanOP•3w ago
@apex Thanks for the offer -- I got some help from the Composio devs. I'll post here when I have a resolution
harsh-harlequin
harsh-harlequin•2d ago
Hey @apex, did your issue got resolved??