fix: fix linting errors

This commit is contained in:
Krrish Dholakia 2024-08-27 12:14:23 -07:00
parent 415abc86c6
commit 18731cf42b
4 changed files with 16 additions and 12 deletions

View file

@ -1,12 +1,12 @@
repos:
- repo: local
hooks:
# - id: mypy
# name: mypy
# entry: python3 -m mypy --ignore-missing-imports
# language: system
# types: [python]
# files: ^litellm/
- id: mypy
name: mypy
entry: python3 -m mypy --ignore-missing-imports
language: system
types: [python]
files: ^litellm/
- id: isort
name: isort
entry: isort

View file

@ -854,7 +854,6 @@ class AzureChatCompletion(BaseLLM):
additional_args={"complete_input_dict": data},
original_response=str(e),
)
exception_mapping_worked = True
raise e
except asyncio.CancelledError as e:
## LOGGING
@ -1029,9 +1028,10 @@ class AzureChatCompletion(BaseLLM):
openai_aclient = AsyncAzureOpenAI(**azure_client_params)
else:
openai_aclient = client
response = await openai_aclient.embeddings.with_raw_response.create(
raw_response = await openai_aclient.embeddings.with_raw_response.create(
**data, timeout=timeout
)
response = raw_response.parse()
stringified_response = response.model_dump()
## LOGGING
logging_obj.post_call(

View file

@ -2027,8 +2027,8 @@ class OpenAITextCompletion(BaseLLM):
else:
openai_client = client
response = openai_client.completions.with_raw_response.create(**data) # type: ignore
raw_response = openai_client.completions.with_raw_response.create(**data) # type: ignore
response = raw_response.parse()
response_json = response.model_dump()
## LOGGING
@ -2075,8 +2075,12 @@ class OpenAITextCompletion(BaseLLM):
else:
openai_aclient = client
response = await openai_aclient.completions.with_raw_response.create(**data)
raw_response = await openai_aclient.completions.with_raw_response.create(
**data
)
response = raw_response.parse()
response_json = response.model_dump()
## LOGGING
logging_obj.post_call(
input=prompt,

View file

@ -855,7 +855,7 @@ def _pre_call_utils(
):
if call_type == "embedding":
data["input"] = "Hello world!"
mapped_target = client.embeddings.with_raw_response
mapped_target: Any = client.embeddings.with_raw_response
if sync_mode:
original_function = litellm.embedding
else: