Reference
@chloejs/ core/ tools/ calendar
The events on a Google calendar, and adding one that invites nobody.
The tools over calendarService.ts: reading the events on the calendars an agent is bound to, and adding one. The binding is in the agent's config, and the model chooses only the dates, and what the event it adds says.
import * as calendar from "@chloejs/core/tools/calendar";
tools: { calendarListEvents: calendar.listEvents({ calendars: ["primary"] }) }addEventfunction
export function addEvent({ calendar = "primary", what = "the calendar", when = "" }: { calendar?: string; what?: string; when?: string } = {})Makes a tool that lets the model add one event to a Google calendar. The model writes the title, start, end, and optionally a place and details.
The event invites nobody and sends no email, so nobody else hears about it.
Options:
calendar: the id of the calendar to add to. Default:"primary"(the signed-in account's own). The model cannot change it.what: a few words for that calendar, used in the tool's description. Default:"the calendar".when: when the model should use the tool, in your own words. Added to the tool's description. Not set by default.
Needs the Google connection.
listEventsfunction
export function listEvents({ calendars = ["primary"], what = "the calendar", days = 7 }: Options = {})Makes a tool that lets the model list the events on some Google calendars, soonest first.
calendars sets which calendars the model can see, and the model cannot
change it. The model chooses only the start day, how many days ahead (up to
90), and how many events (up to 100, default 50).
Needs the Google connection.
tools: { calendarListEvents: calendar.listEvents({ calendars: ["primary"] }) }