-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello_copilot.py
More file actions
32 lines (24 loc) · 765 Bytes
/
hello_copilot.py
File metadata and controls
32 lines (24 loc) · 765 Bytes
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
#!/usr/bin/env python3
"""
Minimal "Hello World" Copilot SDK example.
Sends a single prompt and prints the response.
"""
import asyncio
from copilot import CopilotClient
async def main():
"""Send a simple prompt to Copilot and print the response."""
client = CopilotClient()
await client.start()
try:
session = await client.create_session({"model": "gpt-5-mini"})
print("🤖 Copilot Hello World\n")
response = await session.send_and_wait(
{"prompt": "Say hello and explain what you are in one sentence"}
)
print(response.data.content)
print("\n✅ Done!")
await session.destroy()
finally:
await client.stop()
if __name__ == "__main__":
asyncio.run(main())