From b23551c3728f1a15c93c08da7ffa9e4531b95702 Mon Sep 17 00:00:00 2001 From: Yingbei Date: Tue, 4 Mar 2025 23:45:51 +0800 Subject: [PATCH] enhance: add support to get past meeting instances and prompts for PMI instances --- zoom/tool.gpt | 20 +++++++++++++++----- zoom/tools/meetings.py | 29 ++++++++++++++++++++++++++++- zoom/tools/recordings.py | 4 ++-- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/zoom/tool.gpt b/zoom/tool.gpt index 6dd73ee7..6338436b 100644 --- a/zoom/tool.gpt +++ b/zoom/tool.gpt @@ -2,11 +2,11 @@ Name: Zoom Description: Tools for interacting with Zoom Metadata: bundle: true -Share Tools: Get User, Create Meeting, Update Meeting, List Meeting Templates, Get Meeting, Delete Meeting, List Meetings, List Upcoming Meetings, Get Meeting Invitation, Get Meeting Recordings, List User Recordings, Get Meeting Summary, Get Past Meeting Details, List Available Timezones +Share Tools: Get User, Create Meeting, Update Meeting, List Meeting Templates, Get Meeting, Delete Meeting, List Meetings, List Upcoming Meetings, List Past Meeting Instances, Get Past Meeting Details, Get Meeting Invitation, Get Meeting Recordings, List User Recordings, Get Meeting Summary, List Available Timezones --- Name: Get User -Description: Get the information of the current zoom user. In the response, `type` will indicate user's plan type. 1 - Basic. 2 - Licensed. 4 - Unassigned without Meetings Basic. 99 - None, which can only be set with ssoCreate. +Description: Get the information of the current zoom user. In the response, `type` will indicate user's plan type. 1 - Basic. 2 - Licensed. 4 - Unassigned without Meetings Basic. 99 - None, which can only be set with ssoCreate. This also returns the user's Personal Meeting ID(PMI). Credential: ./credential Share Context: Zoom Context @@ -91,9 +91,10 @@ Param: meeting_id: The ID of the meeting to delete --- Name: List Meetings -Description: List all meetings hosted by the current Zoom user. +Description: List all scheduled meetings hosted by the current Zoom user. This does not return information about instant meetings. Credential: ./credential Share Context: Zoom Context +Param: type: Optional. The type of the meetings to list. Default to scheduled, which will return all valid previous (unexpired) meetings, live meetings, and upcoming scheduled meetings. Must be one of: scheduled, live, upcoming, upcoming_meetings, previous_meetings. #!/usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py ListMeetings @@ -108,7 +109,7 @@ Param: meeting_id: The ID of the meeting to get the invitation for --- Name: List Upcoming Meetings -Description: List all upcoming meetings hosted by the current Zoom user. +Description: List upcoming meetings(within the next 24 hours) that the current Zoom user scheduled or invited to join. Credential: ./credential Share Context: Zoom Context @@ -119,7 +120,7 @@ Name: Get Meeting Recordings Description: Get the cloud recordings of a Zoom meeting. Cloud rerordings are only available for licensed users. Credential: ./credential Share Context: Zoom Context -Param: meeting_id: The ID of the meeting to get the recordings for +Param: meeting_id_or_uuid: The ID or UUID of the meeting to get the recordings for. If providing the meeting ID instead of UUID, the response will be for the latest meeting instance. #!/usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py GetMeetingRecordings @@ -140,6 +141,15 @@ Param: meeting_id: The ID of the meeting to get the details for #!/usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py GetPastMeetingDetails +--- +Name: List Past Meeting Instances +Description: List all instances of a past Zoom meeting. +Credential: ./credential +Share Context: Zoom Context +Param: meeting_id: The ID of the meeting to get the instances for + +#!/usr/bin/env python3 ${GPTSCRIPT_TOOL_DIR}/main.py ListPastMeetingInstances + --- Name: Get Meeting Summary Description: Retrieve the Zoom AI-generated summary of a Zoom meeting. This feature is available exclusively to licensed users. To access it, the host must ensure that the `Meeting Summary with AI Companion` feature is enabled in their account settings. The meeting summary's accessibility depends on the host's sharing settings, by default only the host has the access. diff --git a/zoom/tools/meetings.py b/zoom/tools/meetings.py index 81653e4f..adb49d37 100644 --- a/zoom/tools/meetings.py +++ b/zoom/tools/meetings.py @@ -271,7 +271,21 @@ def list_meetings(): headers = { "Authorization": f"Bearer {ACCESS_TOKEN}", } - response = requests.get(url, headers=headers) + params = {} + type = os.getenv("TYPE", "") + type_enums = [ + "scheduled", + "live", + "upcoming", + "upcoming_meetings", + "previous_meetings", + ] + if type != "": + if type not in type_enums: + raise ValueError(f"Invalid type: {type}. Must be one of: {type_enums}") + params["type"] = type + + response = requests.get(url, headers=headers, params=params) if response.status_code != 200: return {"message": f"Error listing meetings: {response.text}"} @@ -471,3 +485,16 @@ def get_past_meeting_details(): if response.status_code != 200: return {"message": f"Error getting past meeting details: {response.text}"} return response.json() + + +@tool_registry.decorator("ListPastMeetingInstances") +def list_past_meeting_instances(): + meeting_id = os.environ["MEETING_ID"] + url = f"{ZOOM_API_URL}/past_meetings/{meeting_id}/instances" + headers = { + "Authorization": f"Bearer {ACCESS_TOKEN}", + } + response = requests.get(url, headers=headers) + if response.status_code != 200: + return {"message": f"Error listing past meeting instances: {response.text}"} + return response.json() diff --git a/zoom/tools/recordings.py b/zoom/tools/recordings.py index 9e45167d..8bca2bb6 100644 --- a/zoom/tools/recordings.py +++ b/zoom/tools/recordings.py @@ -5,8 +5,8 @@ @tool_registry.decorator("GetMeetingRecordings") def get_meeting_recordings(): - meeting_id = os.environ["MEETING_ID"] - url = f"{ZOOM_API_URL}/meetings/{meeting_id}/recordings" + meeting_id_or_uuid = os.environ["MEETING_ID_OR_UUID"] + url = f"{ZOOM_API_URL}/meetings/{meeting_id_or_uuid}/recordings" headers = { "Authorization": f"Bearer {ACCESS_TOKEN}", }