Skip to content

Commit

Permalink
Fix google calendar event creation (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidiuCode authored Jan 28, 2025
1 parent 92c5aef commit 48ffe9f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions actions/google-calendar/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## [1.0.5] - 2025-01-28

### Fixed

- Event creation with attendees now sets `responseStatus` to `needsAction` by default.

## [1.0.4] - 2025-01-09

### Changed
Expand Down
6 changes: 4 additions & 2 deletions actions/google-calendar/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from dotenv import load_dotenv
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import Resource, build
from sema4ai.actions import OAuth2Secret, Response, action

from models import CalendarList, CreateEvent, Event, EventList, UpdateEvent
from sema4ai.actions import OAuth2Secret, Response, action

load_dotenv(Path(__file__).absolute().parent / "devdata" / ".env")

Expand Down Expand Up @@ -43,6 +42,9 @@ def create_event(

event_dict["start"] = {"dateTime": event_dict["start"]}
event_dict["end"] = {"dateTime": event_dict["end"]}
if event_dict.get("attendees"):
for attendee in event_dict["attendees"]:
attendee["responseStatus"] = "needsAction"

event = service.events().insert(calendarId=calendar_id, body=event_dict).execute()

Expand Down
2 changes: 1 addition & 1 deletion actions/google-calendar/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Attendee(BaseModel):
description="The response status of the attendee. "
"Possible values: 'needsAction', 'declined', 'tentative', 'accepted'."
),
] = "needsAction"
] = None
organizer: Annotated[
bool | None,
Field(description="Whether the attendee is the organizer of the event"),
Expand Down
2 changes: 1 addition & 1 deletion actions/google-calendar/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Google Calendar
description: List calendars and search, create and update events in your Google Calendar.

# Package version number, recommend using semver.org
version: 1.0.4
version: 1.0.5

# The version of the `package.yaml` format.
spec-version: v2
Expand Down
2 changes: 1 addition & 1 deletion agents/agent-writer-agent/runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gather information about the relevant API from available documentation, online r
### 2. Collaborate with the User
Share the initial code or approach with the user for review.
Iterate based on feedback to ensure alignment with the user's expectations.
**Important**: Only after the approach is set in stone, proceed on the boostraping the action package.
**Important**: Only after the approach is set in stone, proceed with the bootstrap of the action package.

### 3. Bootstrap the Action Package
Once the user approves, create the action package by calling `bootstrap_action_package`.
Expand Down

0 comments on commit 48ffe9f

Please sign in to comment.