hchevva commited on
Commit
2279af9
·
verified ·
1 Parent(s): 5bfa58c

Create http.py

Browse files
Files changed (1) hide show
  1. core/http.py +10 -0
core/http.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+ import httpx
3
+ from .config import settings
4
+
5
+ def client() -> httpx.AsyncClient:
6
+ return httpx.AsyncClient(
7
+ timeout=httpx.Timeout(settings.http_timeout_s),
8
+ headers={"user-agent": "ToxRAI/0.2 (HF Space demo)"},
9
+ follow_redirects=True,
10
+ )