muryshev commited on
Commit
7f1b9db
·
1 Parent(s): 598fa65
Files changed (1) hide show
  1. llm/deepinfra_api.py +3 -5
llm/deepinfra_api.py CHANGED
@@ -146,8 +146,6 @@ class DeepInfraApi(LlmApi):
146
  """
147
  async with httpx.AsyncClient() as client:
148
  request = await self.create_request(prompt)
149
-
150
- async with httpx.AsyncClient() as client:
151
- response = client.post(f"{self.params.url}/v1/openai/chat/completions", headers=super().create_headers(), json=request)
152
- if response.status_code == 200:
153
- return response.json()["choices"][0]["message"]["content"]
 
146
  """
147
  async with httpx.AsyncClient() as client:
148
  request = await self.create_request(prompt)
149
+ response = await client.post(f"{self.params.url}/v1/openai/chat/completions", headers=super().create_headers(), json=request)
150
+ if response.status_code == 200:
151
+ return response.json()["choices"][0]["message"]["content"]