15 lines
480 B
Python
15 lines
480 B
Python
from __future__ import annotations
|
|
|
|
import httpx
|
|
from typing import Optional, Dict
|
|
from agentui.config import build_httpx_proxies
|
|
|
|
|
|
def build_client(timeout: float = 60.0) -> httpx.AsyncClient:
|
|
proxies: Optional[Dict[str, str]] = build_httpx_proxies()
|
|
# httpx сам понимает схемы socks://, socks5:// при установленном extras [socks]
|
|
client = httpx.AsyncClient(timeout=timeout, proxies=proxies, follow_redirects=True)
|
|
return client
|
|
|
|
|