mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
test(responses): expect the replay record in bridged chat translation cases
This commit is contained in:
parent
1136a6333e
commit
69477467e0
2 changed files with 19 additions and 3 deletions
|
|
@ -97,7 +97,17 @@ GPT_5_6_SOL_TEST_CASE: Final = TranslationTestCase(
|
|||
"created": ANY,
|
||||
"model": "openai/responses/gpt-5.6-sol",
|
||||
"object": "chat.completion",
|
||||
"choices": [{"finish_reason": "stop", "index": 0, "message": {"content": "Hello!", "role": "assistant"}}],
|
||||
"choices": [
|
||||
{
|
||||
"finish_reason": "stop",
|
||||
"index": 0,
|
||||
"message": {
|
||||
"content": "Hello!",
|
||||
"role": "assistant",
|
||||
"provider_specific_fields": {"phase": "final_answer", "openai_responses_replay": ANY},
|
||||
},
|
||||
}
|
||||
],
|
||||
"usage": {
|
||||
"completion_tokens": 6,
|
||||
"prompt_tokens": 19,
|
||||
|
|
@ -252,6 +262,7 @@ GPT_6_1_SOL_TEST_CASE: Final = TranslationTestCase(
|
|||
"summary": [],
|
||||
}
|
||||
],
|
||||
"provider_specific_fields": {"phase": "commentary", "openai_responses_replay": ANY},
|
||||
},
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ def two_messages_before_tools(case: TranslationTestCase) -> TranslationTestCase:
|
|||
def _messages_then_tools_response(case: TranslationTestCase) -> Mapping[str, JsonValue]:
|
||||
expected: Final = case.expected_litellm_response
|
||||
if case.litellm_endpoint == "/v1/chat/completions":
|
||||
choice: Final = items(expected["choices"])[0]
|
||||
message: Final = object_value(items(expected["choices"])[0]["message"])
|
||||
return {
|
||||
**expected,
|
||||
"choices": [
|
||||
|
|
@ -67,7 +67,12 @@ def _messages_then_tools_response(case: TranslationTestCase) -> Mapping[str, Jso
|
|||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "".join(COMMENTARY),
|
||||
"tool_calls": object_value(choice["message"])["tool_calls"],
|
||||
"tool_calls": message["tool_calls"],
|
||||
**(
|
||||
{"provider_specific_fields": message["provider_specific_fields"]}
|
||||
if "provider_specific_fields" in message
|
||||
else {}
|
||||
),
|
||||
},
|
||||
}
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue