8000 uipath-langchain-python/.github/copilot-instructions.md at main · javaos74/uipath-langchain-python · GitHub < 7FFF meta name="color-scheme" content="light dark" />
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.33 KB

File metadata and controls

40 lines (32 loc) · 1.33 KB

Copilot Instructions for Review

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:

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):

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:

# WARNING: Use httpx.Client/AsyncClient with **get_httpx_client_kwargs() for proper SSL/proxy configuration.

Reference:

0