mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-24 05:45:11 +00:00
fix(v1m): match OpenAIGPTConfig signatures for basedpyright compliance
This commit is contained in:
parent
b5c0ea623e
commit
0ebc0fe2f3
1 changed files with 7 additions and 25 deletions
|
|
@ -1,4 +1,3 @@
|
|||
from collections.abc import Mapping
|
||||
from typing import Final
|
||||
|
||||
from litellm.llms.base_llm.chat.transformation import BaseLLMException
|
||||
|
|
@ -10,13 +9,16 @@ class V1MError(BaseLLMException):
|
|||
self,
|
||||
status_code: int,
|
||||
message: str,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
headers: object = None,
|
||||
) -> None:
|
||||
super().__init__(status_code=status_code, message=message, headers=headers)
|
||||
|
||||
|
||||
class V1MConfig(OpenAIGPTConfig):
|
||||
"""Configuration for v1m (System One) calibrated decision engine."""
|
||||
"""Configuration for v1m (System One) calibrated decision engine.
|
||||
|
||||
Website: https://v1m.ir
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
@ -29,27 +31,7 @@ class V1MConfig(OpenAIGPTConfig):
|
|||
if key != "self" and value is not None:
|
||||
setattr(self.__class__, key, value)
|
||||
|
||||
@classmethod
|
||||
def get_config(cls) -> OpenAIGPTConfig:
|
||||
return super().get_config()
|
||||
|
||||
def get_supported_openai_params(
|
||||
self, model: str
|
||||
) -> list[str]: # mutable-ok: required list signature for OpenAIGPTConfig
|
||||
return [
|
||||
"temperature",
|
||||
"max_tokens",
|
||||
"stream",
|
||||
]
|
||||
|
||||
def get_error_class(
|
||||
self,
|
||||
error_message: str,
|
||||
status_code: int,
|
||||
headers: Mapping[str, str] | None,
|
||||
) -> BaseLLMException:
|
||||
return V1MError(
|
||||
status_code=status_code,
|
||||
message=error_message,
|
||||
headers=headers,
|
||||
)
|
||||
) -> list: # mutable-ok: inherited contract
|
||||
return super().get_supported_openai_params(model)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue