django-admin-dashboard / apps /rag /api_client.py
junaidte14's picture
deploying v1
0ad3564
Raw History Blame Contribute Delete
382 Bytes
# apps/rag/services/api_client.py
import httpx
from django.conf import settings
def fastapi_client(request):
token = request.COOKIES.get("access_token")
return httpx.Client(
base_url=settings.FASTAPI_BASE_URL,
headers={
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
},
timeout=300.0,
)