Skip to content

Commit ccdfd66

Browse files
authored
Merge pull request #618 from github/copilot/fix-python-docstring-error
Fix Python async syntax errors in copilot-sdk-python instructions
2 parents 5a23c41 + c1f10f7 commit ccdfd66

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

instructions/copilot-sdk-python.instructions.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ uv add copilot-sdk
3131

3232
```python
3333
from copilot import CopilotClient
34+
import asyncio
3435

35-
async with CopilotClient() as client:
36-
# Use client...
37-
pass
36+
async def main():
37+
async with CopilotClient() as client:
38+
# Use client...
39+
pass
40+
41+
asyncio.run(main())
3842
```
3943

4044
### Client Configuration Options
@@ -56,10 +60,16 @@ When creating a CopilotClient, use a dict with these keys:
5660
For explicit control:
5761

5862
```python
59-
client = CopilotClient({"auto_start": False})
60-
await client.start()
61-
# Use client...
62-
await client.stop()
63+
from copilot import CopilotClient
64+
import asyncio
65+
66+
async def main():
67+
client = CopilotClient({"auto_start": False})
68+
await client.start()
69+
# Use client...
70+
await client.stop()
71+
72+
asyncio.run(main())
6373
```
6474

6575
Use `force_stop()` when `stop()` takes too long.

0 commit comments

Comments
 (0)