mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
mypy linting fixes 2
This commit is contained in:
parent
15b1da9dc8
commit
fbcb6d1c20
4 changed files with 14 additions and 14 deletions
|
@ -8,7 +8,7 @@ from openai.error import (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class AuthenticationError(AuthenticationError):
|
class AuthenticationError(AuthenticationError): # type: ignore
|
||||||
def __init__(self, message, llm_provider):
|
def __init__(self, message, llm_provider):
|
||||||
self.status_code = 401
|
self.status_code = 401
|
||||||
self.message = message
|
self.message = message
|
||||||
|
@ -18,7 +18,7 @@ class AuthenticationError(AuthenticationError):
|
||||||
) # Call the base class constructor with the parameters it needs
|
) # Call the base class constructor with the parameters it needs
|
||||||
|
|
||||||
|
|
||||||
class InvalidRequestError(InvalidRequestError):
|
class InvalidRequestError(InvalidRequestError): # type: ignore
|
||||||
def __init__(self, message, model, llm_provider):
|
def __init__(self, message, model, llm_provider):
|
||||||
self.status_code = 400
|
self.status_code = 400
|
||||||
self.message = message
|
self.message = message
|
||||||
|
@ -29,7 +29,7 @@ class InvalidRequestError(InvalidRequestError):
|
||||||
) # Call the base class constructor with the parameters it needs
|
) # Call the base class constructor with the parameters it needs
|
||||||
|
|
||||||
|
|
||||||
class RateLimitError(RateLimitError):
|
class RateLimitError(RateLimitError): # type: ignore
|
||||||
def __init__(self, message, llm_provider):
|
def __init__(self, message, llm_provider):
|
||||||
self.status_code = 429
|
self.status_code = 429
|
||||||
self.message = message
|
self.message = message
|
||||||
|
@ -39,7 +39,7 @@ class RateLimitError(RateLimitError):
|
||||||
) # Call the base class constructor with the parameters it needs
|
) # Call the base class constructor with the parameters it needs
|
||||||
|
|
||||||
|
|
||||||
class ServiceUnavailableError(ServiceUnavailableError):
|
class ServiceUnavailableError(ServiceUnavailableError): # type: ignore
|
||||||
def __init__(self, message, llm_provider):
|
def __init__(self, message, llm_provider):
|
||||||
self.status_code = 500
|
self.status_code = 500
|
||||||
self.message = message
|
self.message = message
|
||||||
|
@ -49,7 +49,7 @@ class ServiceUnavailableError(ServiceUnavailableError):
|
||||||
) # Call the base class constructor with the parameters it needs
|
) # Call the base class constructor with the parameters it needs
|
||||||
|
|
||||||
|
|
||||||
class OpenAIError(OpenAIError):
|
class OpenAIError(OpenAIError): # type: ignore
|
||||||
def __init__(self, original_exception):
|
def __init__(self, original_exception):
|
||||||
self.status_code = original_exception.http_status
|
self.status_code = original_exception.http_status
|
||||||
super().__init__(
|
super().__init__(
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
|
|
||||||
class BaseLLM:
|
class BaseLLM:
|
||||||
def validate_environment(): # set up the environment required to run the model
|
def validate_environment(self): # set up the environment required to run the model
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def completion(): # logic for parsing in - calling - parsing out model completion calls
|
def completion(self): # logic for parsing in - calling - parsing out model completion calls
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def embedding(): # logic for parsing in - calling - parsing out model embedding calls
|
def embedding(self): # logic for parsing in - calling - parsing out model embedding calls
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -11,7 +11,7 @@ from threading import Thread
|
||||||
from openai.error import Timeout
|
from openai.error import Timeout
|
||||||
|
|
||||||
|
|
||||||
def timeout(timeout_duration: float = None, exception_to_raise=Timeout):
|
def timeout(timeout_duration: float = 0.0, exception_to_raise=Timeout):
|
||||||
"""
|
"""
|
||||||
Wraps a function to raise the specified exception if execution time
|
Wraps a function to raise the specified exception if execution time
|
||||||
is greater than the specified timeout.
|
is greater than the specified timeout.
|
||||||
|
|
|
@ -504,11 +504,11 @@ def get_optional_params(
|
||||||
|
|
||||||
def load_test_model(
|
def load_test_model(
|
||||||
model: str,
|
model: str,
|
||||||
custom_llm_provider: str = None,
|
custom_llm_provider: str = "",
|
||||||
custom_api_base: str = None,
|
custom_api_base: str = "",
|
||||||
prompt: str = None,
|
prompt: str = "",
|
||||||
num_calls: int = None,
|
num_calls: int = 0,
|
||||||
force_timeout: int = None,
|
force_timeout: int = 0,
|
||||||
):
|
):
|
||||||
test_prompt = "Hey, how's it going"
|
test_prompt = "Hey, how's it going"
|
||||||
test_calls = 100
|
test_calls = 100
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue