mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
fix(openai-py): fix linting errors
This commit is contained in:
parent
68461f5863
commit
dfd91c5d46
2 changed files with 3 additions and 2 deletions
|
@ -210,8 +210,10 @@ class OpenAIChatCompletion(BaseLLM):
|
|||
headers["Authorization"] = f"Bearer {api_key}"
|
||||
return headers
|
||||
|
||||
def convert_to_model_response_object(self, response_object: dict, model_response_object: ModelResponse):
|
||||
def convert_to_model_response_object(self, response_object: Optional[dict]=None, model_response_object: Optional[ModelResponse]=None):
|
||||
try:
|
||||
if response_object is None or model_response_object is None:
|
||||
raise CustomOpenAIError(status_code=500, message="Error in response object format")
|
||||
choice_list=[]
|
||||
for idx, choice in enumerate(response_object["choices"]):
|
||||
message = Message(content=choice["message"]["content"], role=choice["message"]["role"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue