mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
Merge pull request #618 from github/copilot/fix-python-docstring-error
Fix Python async syntax errors in copilot-sdk-python instructions
This commit is contained in:
@@ -31,10 +31,14 @@ uv add copilot-sdk
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
from copilot import CopilotClient
|
from copilot import CopilotClient
|
||||||
|
import asyncio
|
||||||
|
|
||||||
async with CopilotClient() as client:
|
async def main():
|
||||||
|
async with CopilotClient() as client:
|
||||||
# Use client...
|
# Use client...
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
### Client Configuration Options
|
### Client Configuration Options
|
||||||
@@ -56,10 +60,16 @@ When creating a CopilotClient, use a dict with these keys:
|
|||||||
For explicit control:
|
For explicit control:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
client = CopilotClient({"auto_start": False})
|
from copilot import CopilotClient
|
||||||
await client.start()
|
import asyncio
|
||||||
# Use client...
|
|
||||||
await client.stop()
|
async def main():
|
||||||
|
client = CopilotClient({"auto_start": False})
|
||||||
|
await client.start()
|
||||||
|
# Use client...
|
||||||
|
await client.stop()
|
||||||
|
|
||||||
|
asyncio.run(main())
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `force_stop()` when `stop()` takes too long.
|
Use `force_stop()` when `stop()` takes too long.
|
||||||
|
|||||||
Reference in New Issue
Block a user