Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copilot Instructions for UiPath Python SDK

Purpose:
- Always use `**get_httpx_client_kwargs()` when creating `httpx.Client` or `httpx.AsyncClient` to ensure correct SSL, proxy, timeouts, and redirects.

Guidance for Copilot:
- When suggesting `httpx.Client(` or `httpx.AsyncClient(`, include `**get_httpx_client_kwargs()`.
- If the user omits it, suggest the corrected version or insert a warning comment.

Preferred patterns:
```python
import httpx
from uipath._utils._ssl_context import get_httpx_client_kwargs

client = httpx.Client(**get_httpx_client_kwargs())
async_client = httpx.AsyncClient(**get_httpx_client_kwargs())

default_client_kwargs = get_httpx_client_kwargs()
client_kwargs = {
**default_client_kwargs,
"base_url": base_url,
"headers": my_headers,
}
client = httpx.Client(**client_kwargs)
async_client = httpx.AsyncClient(**client_kwargs)
```

Anti-patterns (avoid):
```python
client = httpx.Client() # ❌ Missing **get_httpx_client_kwargs()
async_client = httpx.AsyncClient() # ❌ Missing **get_httpx_client_kwargs()
```

Warning to insert if correction isn’t applied:
```python
# WARNING: Use httpx.Client/AsyncClient with **get_httpx_client_kwargs() for proper SSL/proxy configuration.
```

Reference:
- [get_httpx_client_kwargs](https://github.com/UiPath/uipath-python/blob/main/src/uipath/_utils/_ssl_context.py#L37)
Loading