Initial import
This commit is contained in:
2
agentui/providers/__init__.py
Normal file
2
agentui/providers/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
14
agentui/providers/http_client.py
Normal file
14
agentui/providers/http_client.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user