mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
add test
This commit is contained in:
parent
e27c4c98c0
commit
58cf72ef5e
1 changed files with 26 additions and 0 deletions
|
|
@ -2,11 +2,13 @@ from base_llm_unit_tests import BaseLLMChatTest
|
|||
import pytest
|
||||
import sys
|
||||
import os
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
sys.path.insert(
|
||||
0, os.path.abspath("../..")
|
||||
) # Adds the parent directory to the system path
|
||||
import litellm
|
||||
from litellm.llms.bedrock.chat.converse_transformation import AmazonConverseConfig
|
||||
|
||||
|
||||
class TestBedrockGPTOSS(BaseLLMChatTest):
|
||||
|
|
@ -25,3 +27,27 @@ class TestBedrockGPTOSS(BaseLLMChatTest):
|
|||
Remove override once we have access to Bedrock prompt caching
|
||||
"""
|
||||
pass
|
||||
|
||||
@pytest.mark.parametrize("model", [
|
||||
"bedrock/openai.gpt-oss-20b-1:0",
|
||||
"bedrock/openai.gpt-oss-120b-1:0",
|
||||
])
|
||||
def test_reasoning_effort_transformation_gpt_oss(self, model):
|
||||
"""Test that reasoning_effort is handled correctly for GPT-OSS models."""
|
||||
config = AmazonConverseConfig()
|
||||
|
||||
# Test GPT-OSS model - should keep reasoning_effort as-is
|
||||
non_default_params = {"reasoning_effort": "low"}
|
||||
optional_params = {}
|
||||
|
||||
result = config.map_openai_params(
|
||||
non_default_params=non_default_params,
|
||||
optional_params=optional_params,
|
||||
model=model,
|
||||
drop_params=False,
|
||||
)
|
||||
|
||||
# GPT-OSS should have reasoning_effort in result, not thinking
|
||||
assert "reasoning_effort" in result
|
||||
assert result["reasoning_effort"] == "low"
|
||||
assert "thinking" not in result
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue