mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Merge pull request #14146 from ProjectAlita/gpt_5_unsupported_params
GPT-5: Drop unsupported params
This commit is contained in:
commit
67450feb79
2 changed files with 23 additions and 1 deletions
|
|
@ -28,7 +28,18 @@ class OpenAIGPT5Config(OpenAIGPTConfig):
|
|||
base_gpt_series_params.extend(gpt_5_only_params)
|
||||
if not supports_tool_choice(model=model):
|
||||
base_gpt_series_params.remove("tool_choice")
|
||||
return base_gpt_series_params
|
||||
|
||||
non_supported_params = [
|
||||
"logprobs",
|
||||
"top_p",
|
||||
"presence_penalty",
|
||||
"frequency_penalty",
|
||||
"top_logprobs",
|
||||
]
|
||||
|
||||
return [
|
||||
param for param in base_gpt_series_params if param not in non_supported_params
|
||||
]
|
||||
|
||||
def map_openai_params(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -41,3 +41,14 @@ def test_gpt5_temperature_error(config: OpenAIConfig):
|
|||
model="gpt-5",
|
||||
drop_params=False,
|
||||
)
|
||||
|
||||
|
||||
def test_gpt5_unsupported_params_drop(config: OpenAIConfig):
|
||||
assert "top_p" not in config.get_supported_openai_params(model="gpt-5")
|
||||
params = config.map_openai_params(
|
||||
non_default_params={"top_p": 0.5},
|
||||
optional_params={},
|
||||
model="gpt-5",
|
||||
drop_params=True,
|
||||
)
|
||||
assert "top_p" not in params
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue