mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
fix(cerebras): add max_retries and extra_headers to get_supported_openai_params
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
13b590c8ec
commit
46bb15266d
3 changed files with 38 additions and 0 deletions
|
|
@ -68,6 +68,8 @@ class CerebrasConfig(OpenAIGPTConfig):
|
|||
"tool_choice",
|
||||
"tools",
|
||||
"user",
|
||||
"max_retries",
|
||||
"extra_headers",
|
||||
]
|
||||
|
||||
# Only add reasoning_effort for models that support it
|
||||
|
|
|
|||
0
tests/test_litellm/llms/cerebras/__init__.py
Normal file
0
tests/test_litellm/llms/cerebras/__init__.py
Normal file
36
tests/test_litellm/llms/cerebras/test_cerebras_chat.py
Normal file
36
tests/test_litellm/llms/cerebras/test_cerebras_chat.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import pytest
|
||||
|
||||
from litellm.llms.cerebras.chat import CerebrasConfig
|
||||
|
||||
|
||||
class TestCerebrasConfig:
|
||||
def test_get_supported_openai_params_includes_max_retries(self):
|
||||
config = CerebrasConfig()
|
||||
params = config.get_supported_openai_params(model="cerebras/llama-4-scout-17b-16e")
|
||||
assert "max_retries" in params
|
||||
|
||||
def test_get_supported_openai_params_includes_extra_headers(self):
|
||||
config = CerebrasConfig()
|
||||
params = config.get_supported_openai_params(model="cerebras/llama-4-scout-17b-16e")
|
||||
assert "extra_headers" in params
|
||||
|
||||
def test_map_openai_params_passes_through_max_retries(self):
|
||||
config = CerebrasConfig()
|
||||
result = config.map_openai_params(
|
||||
non_default_params={"max_retries": 0},
|
||||
optional_params={},
|
||||
model="cerebras/llama-4-scout-17b-16e",
|
||||
drop_params=False,
|
||||
)
|
||||
assert result["max_retries"] == 0
|
||||
|
||||
def test_map_openai_params_passes_through_extra_headers(self):
|
||||
config = CerebrasConfig()
|
||||
headers = {"X-Custom": "value"}
|
||||
result = config.map_openai_params(
|
||||
non_default_params={"extra_headers": headers},
|
||||
optional_params={},
|
||||
model="cerebras/llama-4-scout-17b-16e",
|
||||
drop_params=False,
|
||||
)
|
||||
assert result["extra_headers"] == headers
|
||||
Loading…
Add table
Reference in a new issue