-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (32 loc) · 1.32 KB
/
main.py
File metadata and controls
36 lines (32 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from executor import aio
async def main():
"""Create an instant Google Meet link."""
# Create a Google Meet space using the Google Meet API
response = await aio.run_http(
url="https://meet.googleapis.com/v2/spaces",
method="POST",
headers={"Content-Type": "application/json"},
body={},
integration="google-meet",
description="Creating an instant Google Meet meeting space"
)
if response.get("status") == 200:
body = response.get("body", {})
meeting_uri = body.get("meetingUri", "")
meeting_code = body.get("meetingCode", "")
executor.print(f"Meeting created successfully!")
executor.print(f"Meeting Link: {meeting_uri}")
executor.print(f"Meeting Code: {meeting_code}")
# Store the meeting details as a text artifact
meeting_info = f"**Google Meet Link:** {meeting_uri}\n\n**Meeting Code:** {meeting_code}"
await aio.store_artifact(
identifier="meet_link",
title="Google Meet Link",
artifact_type="text",
data=meeting_info,
metadata={"text": {"content_type": "text/markdown"}}
)
else:
error_msg = f"Error creating meeting: {response}"
executor.print(error_msg)
raise Exception(error_msg)