Spaces:
Sleeping
Sleeping
Added timeout
Browse files- llm/deepinfra_api.py +1 -1
llm/deepinfra_api.py
CHANGED
@@ -150,6 +150,6 @@ class DeepInfraApi(LlmApi):
|
|
150 |
"""
|
151 |
async with httpx.AsyncClient() as client:
|
152 |
request = await self.create_request(prompt, system_prompt)
|
153 |
-
response = await client.post(f"{self.params.url}/v1/openai/chat/completions", headers=super().create_headers(), json=request)
|
154 |
if response.status_code == 200:
|
155 |
return response.json()["choices"][0]["message"]["content"]
|
|
|
150 |
"""
|
151 |
async with httpx.AsyncClient() as client:
|
152 |
request = await self.create_request(prompt, system_prompt)
|
153 |
+
response = await client.post(f"{self.params.url}/v1/openai/chat/completions", headers=super().create_headers(), json=request, timeout=httpx.Timeout(connect=5.0, read=60.0))
|
154 |
if response.status_code == 200:
|
155 |
return response.json()["choices"][0]["message"]["content"]
|