mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
refactor(openai.py): working openai chat + text completion for openai v1 sdk
This commit is contained in:
parent
6d815d98fe
commit
d0bd932b3c
6 changed files with 30 additions and 27 deletions
|
@ -245,11 +245,11 @@ class OpenAIChatCompletion(BaseLLM):
|
|||
api_base: str,
|
||||
data: dict, headers: dict,
|
||||
model_response: ModelResponse):
|
||||
async with httpx.AsyncClient() as client:
|
||||
async with httpx.AsyncClient(timeout=600) as client:
|
||||
response = await client.post(api_base, json=data, headers=headers)
|
||||
response_json = response.json()
|
||||
if response.status != 200:
|
||||
raise OpenAIError(status_code=response.status, message=response.text)
|
||||
if response.status_code != 200:
|
||||
raise OpenAIError(status_code=response.status_code, message=response.text)
|
||||
|
||||
|
||||
## RESPONSE OBJECT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue