"""Google Calendar activities for searching and creating events."""ďťżfrom __future__ import annotationsďťżfrom typing import Anyďťżimport mistralai.workflows as workflowsfrom mistralai.workflows import Dependsfrom mistralai.workflows.plugins.mistralai.connectors import ( ToolCallClient, connector,)ďťżGOOGLE_CALENDAR_CONNECTOR = connector("google_calendar")ďťż@workflows.activity(name="gcal-search")async def gcal_search( calendar: str, start: str | None, end: str | None, query: str | None, google_calendar: ToolCallClient = Depends(GOOGLE_CALENDAR_CONNECTOR),) -> dict[str, Any]: """Search Google Calendar for events matching the given time window and query.ďťż Args: calendar: Calendar ID to search (e.g. 'primary'). start: RFC3339 lower bound for event start time (inclusive). end: RFC3339 upper bound for event end time (exclusive). query: Free-text search on event name/content/attendees. """ arguments: dict[str, Any] = {"calendar": calendar} if start: arguments["start"] = start if end: arguments["end"] = end if query: arguments["query"] = query return await google_calendar.call_tool( # type: ignore[no-any-return] tool_name="search_event", arguments=arguments, )ďťżďťż