mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Add ChatGPT Responses string input test
This commit is contained in:
parent
d34697d7d0
commit
ab28e9cfeb
1 changed files with 29 additions and 0 deletions
|
|
@ -101,9 +101,38 @@ class TestChatGPTResponsesAPITransformation:
|
|||
)
|
||||
|
||||
assert request["stream"] is True
|
||||
assert request["input"] == [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [{"type": "input_text", "text": "hi"}],
|
||||
}
|
||||
]
|
||||
assert "reasoning.encrypted_content" in request["include"]
|
||||
assert request["instructions"].startswith("You are Codex, based on GPT-5.")
|
||||
|
||||
def test_chatgpt_normalizes_string_input_with_tools(self):
|
||||
config = ChatGPTResponsesAPIConfig()
|
||||
tools = [{"type": "function", "name": "echo", "parameters": {}}]
|
||||
request = config.transform_responses_api_request(
|
||||
model="chatgpt/gpt-5.3-codex",
|
||||
input="Call echo with ping.",
|
||||
response_api_optional_request_params={
|
||||
"tools": tools,
|
||||
"tool_choice": "required",
|
||||
},
|
||||
litellm_params=GenericLiteLLMParams(),
|
||||
headers={},
|
||||
)
|
||||
|
||||
assert request["input"] == [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [{"type": "input_text", "text": "Call echo with ping."}],
|
||||
}
|
||||
]
|
||||
assert request["tools"] == tools
|
||||
assert request["tool_choice"] == "required"
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_name",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue