Gradual's Test

code block

code block

test

June 16, 2026
code block

"""Google Calendar activities for searching and creating events."""

from __future__ import annotations

from typing import Any

import mistralai.workflows as workflows
from mistralai.workflows import Depends
from 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,
)



Dive in

Related

Blog
code block
Feb 12th, 2025 Views 8
Blog
Drone test 4.4
Jun 15th, 2026 Views 0
Blog
copy code
May 25th, 2026 Views 1
Resource
res-test
Jun 17th, 2026 Views 0
Blog
code block
Feb 12th, 2025 Views 8
Blog
copy code
May 25th, 2026 Views 1
Resource
res-test
Jun 17th, 2026 Views 0
Blog
Drone test 4.4
Jun 15th, 2026 Views 0
© 2026 Gradual's Test
Terms of Service
Your Privacy Choices