mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
Complete o3 model support (#8183)
* fix(o_series_transformation.py): add 'reasoning_effort' as o series model param Closes https://github.com/BerriAI/litellm/issues/8182 * fix(main.py): ensure `reasoning_effort` is a mapped openai param * refactor(azure/): rename o1_[x] files to o_series_[x] * refactor(base_llm_unit_tests.py): refactor testing for o series reasoning effort * test(test_azure_o_series.py): have azure o series tests correctly inherit from base o series model tests * feat(base_utils.py): support translating 'developer' role to 'system' role for non-openai providers Makes it easy to switch from openai to anthropic * fix: fix linting errors * fix(base_llm_unit_tests.py): fix test * fix(main.py): add missing param
This commit is contained in:
parent
e4566d7b1c
commit
1105e35538
15 changed files with 230 additions and 11 deletions
|
@ -15,7 +15,7 @@ from respx import MockRouter
|
|||
|
||||
import litellm
|
||||
from litellm import Choices, Message, ModelResponse
|
||||
from base_llm_unit_tests import BaseLLMChatTest
|
||||
from base_llm_unit_tests import BaseLLMChatTest, BaseOSeriesModelsTest
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", ["o1-preview", "o1-mini", "o1"])
|
||||
|
@ -152,12 +152,17 @@ def test_litellm_responses():
|
|||
assert isinstance(response.usage.completion_tokens_details, CompletionTokensDetails)
|
||||
|
||||
|
||||
class TestOpenAIO1(BaseLLMChatTest):
|
||||
class TestOpenAIO1(BaseOSeriesModelsTest, BaseLLMChatTest):
|
||||
def get_base_completion_call_args(self):
|
||||
return {
|
||||
"model": "o1",
|
||||
}
|
||||
|
||||
def get_client(self):
|
||||
from openai import OpenAI
|
||||
|
||||
return OpenAI(api_key="fake-api-key")
|
||||
|
||||
def test_tool_call_no_arguments(self, tool_call_no_arguments):
|
||||
"""Test that tool calls with no arguments is translated correctly. Relevant issue: https://github.com/BerriAI/litellm/issues/6833"""
|
||||
pass
|
||||
|
@ -167,12 +172,17 @@ class TestOpenAIO1(BaseLLMChatTest):
|
|||
pass
|
||||
|
||||
|
||||
class TestOpenAIO3(BaseLLMChatTest):
|
||||
class TestOpenAIO3(BaseOSeriesModelsTest, BaseLLMChatTest):
|
||||
def get_base_completion_call_args(self):
|
||||
return {
|
||||
"model": "o3-mini",
|
||||
}
|
||||
|
||||
def get_client(self):
|
||||
from openai import OpenAI
|
||||
|
||||
return OpenAI(api_key="fake-api-key")
|
||||
|
||||
def test_tool_call_no_arguments(self, tool_call_no_arguments):
|
||||
"""Test that tool calls with no arguments is translated correctly. Relevant issue: https://github.com/BerriAI/litellm/issues/6833"""
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue