fix(o_series_transformation.py): fix optional param check for o-serie… (#8787)

* fix(o_series_transformation.py): fix optional param check for o-series models

o3-mini and o-1 do not support parallel tool calling

* fix(utils.py): support 'drop_params' for 'thinking' param across models

allows switching to older claude versions (or non-anthropic models) and param to be safely dropped

* fix: fix passing thinking param in optional params

allows dropping thinking_param where not applicable

* test: update old model

* fix(utils.py): fix linting errors

* fix(main.py): add param to acompletion
This commit is contained in:
Krish Dholakia 2025-02-26 12:26:55 -08:00 committed by GitHub
parent aabb5c0df4
commit 017c482d7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 87 additions and 31 deletions

View file

@ -338,3 +338,18 @@ def test_openai_max_retries_0(mock_get_openai_client):
mock_get_openai_client.assert_called_once()
assert mock_get_openai_client.call_args.kwargs["max_retries"] == 0
@pytest.mark.parametrize("model", ["o1", "o1-preview", "o1-mini", "o3-mini"])
def test_o1_parallel_tool_calls(model):
litellm.completion(
model=model,
messages=[
{
"role": "user",
"content": "foo",
}
],
parallel_tool_calls=True,
drop_params=True,
)