mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix: fix novita transformation and test (#10056)
This commit is contained in:
parent
ba03736077
commit
d23e1d5a9d
2 changed files with 6 additions and 6 deletions
|
@ -19,6 +19,7 @@ class NovitaConfig(OpenAIGPTConfig):
|
|||
model: str,
|
||||
messages: List[AllMessageValues],
|
||||
optional_params: dict,
|
||||
litellm_params: dict,
|
||||
api_key: Optional[str] = None,
|
||||
api_base: Optional[str] = None,
|
||||
) -> dict:
|
||||
|
@ -26,10 +27,7 @@ class NovitaConfig(OpenAIGPTConfig):
|
|||
raise ValueError(
|
||||
"Missing Novita AI API Key - A call is being made to novita but no key is set either in the environment variables or via params"
|
||||
)
|
||||
|
||||
headers = {
|
||||
"Authorization": f"Bearer {api_key}",
|
||||
"Content-Type": "application/json",
|
||||
"X-Novita-Source": "litellm",
|
||||
}
|
||||
headers["Authorization"] = f"Bearer {api_key}"
|
||||
headers["Content-Type"] = "application/json"
|
||||
headers["X-Novita-Source"] = "litellm"
|
||||
return headers
|
||||
|
|
|
@ -33,6 +33,7 @@ class TestNovitaConfig:
|
|||
model="novita/meta-llama/llama-3.3-70b-instruct",
|
||||
messages=[{"role": "user", "content": "Hello"}],
|
||||
optional_params={},
|
||||
litellm_params={},
|
||||
api_key=api_key,
|
||||
api_base="https://api.novita.ai/v3/openai"
|
||||
)
|
||||
|
@ -52,6 +53,7 @@ class TestNovitaConfig:
|
|||
model="novita/meta-llama/llama-3.3-70b-instruct",
|
||||
messages=[{"role": "user", "content": "Hello"}],
|
||||
optional_params={},
|
||||
litellm_params={},
|
||||
api_key=None,
|
||||
api_base="https://api.novita.ai/v3/openai"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue