mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* test(integration): openai-route basic translation cases on messages, chat completions and responses Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): ignore x-stainless headers in translation runner Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): skip openai chat completions basic cases on LIT-9235 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: kerry <kerry@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
784 lines
28 KiB
Python
784 lines
28 KiB
Python
from typing import Final
|
|
from unittest.mock import ANY
|
|
|
|
from integration.translation.case import TranslationTestCase
|
|
|
|
|
|
GPT_5_4_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/responses",
|
|
litellm_request={
|
|
"model": "openai/gpt-5.4",
|
|
"max_output_tokens": 64,
|
|
"instructions": "You are a terse assistant.",
|
|
"input": "Say hello.",
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/responses",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer synthetic-openai-key"},
|
|
expected_provider_request={
|
|
"model": "gpt-5.4",
|
|
"input": "Say hello.",
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
},
|
|
mock_provider_response={
|
|
"id": "resp_09266ad9f58a7706006ac3f0106a2c87d09155b2c4aed60612",
|
|
"object": "response",
|
|
"created_at": 1791225872,
|
|
"status": "completed",
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225873,
|
|
"error": None,
|
|
"frequency_penalty": 0.0,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
"max_tool_calls": None,
|
|
"model": "gpt-5.4-2026-03-05",
|
|
"moderation": None,
|
|
"output": [
|
|
{
|
|
"id": "msg_09266ad9f58a7706006ac3f0111c0487d0834c20939578eaca",
|
|
"type": "message",
|
|
"status": "completed",
|
|
"content": [{"type": "output_text", "annotations": [], "logprobs": [], "text": "Hello."}],
|
|
"phase": "final_answer",
|
|
"role": "assistant",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"presence_penalty": 0.0,
|
|
"previous_response_id": None,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"reasoning": {"context": "current_turn", "effort": "none", "mode": "standard", "summary": None},
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"store": True,
|
|
"temperature": 1.0,
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"tool_choice": "auto",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"tools": [],
|
|
"top_logprobs": 0,
|
|
"top_p": 0.98,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {"cache_write_tokens": 0, "cached_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"reasoning_tokens": 0},
|
|
"total_tokens": 25,
|
|
},
|
|
"user": None,
|
|
"metadata": {},
|
|
},
|
|
expected_litellm_response={
|
|
"id": ANY,
|
|
"created_at": 1791225872,
|
|
"error": None,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"metadata": {},
|
|
"model": "openai/gpt-5.4",
|
|
"object": "response",
|
|
"output": [
|
|
{
|
|
"id": "msg_09266ad9f58a7706006ac3f0111c0487d0834c20939578eaca",
|
|
"content": [{"annotations": [], "text": "Hello.", "type": "output_text", "logprobs": []}],
|
|
"role": "assistant",
|
|
"status": "completed",
|
|
"type": "message",
|
|
"phase": "final_answer",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"temperature": 1.0,
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 0.98,
|
|
"max_output_tokens": 64,
|
|
"previous_response_id": None,
|
|
"reasoning": {"context": "current_turn", "effort": "none", "mode": "standard", "summary": None},
|
|
"status": "completed",
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {
|
|
"audio_tokens": None,
|
|
"cached_tokens": 0,
|
|
"cached_tokens_details": None,
|
|
"image_tokens": None,
|
|
"text_tokens": None,
|
|
"video_tokens": None,
|
|
"cache_write_tokens": 0,
|
|
},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"audio_tokens": None, "reasoning_tokens": 0, "text_tokens": None},
|
|
"total_tokens": 25,
|
|
"cost": None,
|
|
},
|
|
"user": None,
|
|
"store": True,
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225873,
|
|
"frequency_penalty": 0.0,
|
|
"max_tool_calls": None,
|
|
"moderation": None,
|
|
"presence_penalty": 0.0,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"top_logprobs": 0,
|
|
},
|
|
)
|
|
|
|
|
|
GPT_5_6_SOL_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/responses",
|
|
litellm_request={
|
|
"model": "openai/gpt-5.6-sol",
|
|
"max_output_tokens": 64,
|
|
"instructions": "You are a terse assistant.",
|
|
"input": "Say hello.",
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/responses",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer synthetic-openai-key"},
|
|
expected_provider_request={
|
|
"model": "gpt-5.6-sol",
|
|
"input": "Say hello.",
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
},
|
|
mock_provider_response={
|
|
"id": "resp_0c9879957c1ae38c006ac3f013f1d487d0addcbd528bf79ce8",
|
|
"object": "response",
|
|
"created_at": 1791225875,
|
|
"status": "completed",
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225876,
|
|
"error": None,
|
|
"frequency_penalty": 0.0,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
"max_tool_calls": None,
|
|
"model": "gpt-5.6-sol",
|
|
"moderation": None,
|
|
"output": [
|
|
{
|
|
"id": "msg_0c9879957c1ae38c006ac3f0146a0087d0a02d07eeff59b3c6",
|
|
"type": "message",
|
|
"status": "completed",
|
|
"content": [{"type": "output_text", "annotations": [], "logprobs": [], "text": "Hello."}],
|
|
"phase": "final_answer",
|
|
"role": "assistant",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"presence_penalty": 0.0,
|
|
"previous_response_id": None,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"store": True,
|
|
"temperature": 1.0,
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"tool_choice": "auto",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"tools": [],
|
|
"top_logprobs": 0,
|
|
"top_p": 0.98,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {"cache_write_tokens": 0, "cached_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"reasoning_tokens": 0},
|
|
"total_tokens": 25,
|
|
},
|
|
"user": None,
|
|
"metadata": {},
|
|
},
|
|
expected_litellm_response={
|
|
"id": ANY,
|
|
"created_at": 1791225875,
|
|
"error": None,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"metadata": {},
|
|
"model": "openai/gpt-5.6-sol",
|
|
"object": "response",
|
|
"output": [
|
|
{
|
|
"id": "msg_0c9879957c1ae38c006ac3f0146a0087d0a02d07eeff59b3c6",
|
|
"content": [{"annotations": [], "text": "Hello.", "type": "output_text", "logprobs": []}],
|
|
"role": "assistant",
|
|
"status": "completed",
|
|
"type": "message",
|
|
"phase": "final_answer",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"temperature": 1.0,
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 0.98,
|
|
"max_output_tokens": 64,
|
|
"previous_response_id": None,
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"status": "completed",
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {
|
|
"audio_tokens": None,
|
|
"cached_tokens": 0,
|
|
"cached_tokens_details": None,
|
|
"image_tokens": None,
|
|
"text_tokens": None,
|
|
"video_tokens": None,
|
|
"cache_write_tokens": 0,
|
|
},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"audio_tokens": None, "reasoning_tokens": 0, "text_tokens": None},
|
|
"total_tokens": 25,
|
|
"cost": None,
|
|
},
|
|
"user": None,
|
|
"store": True,
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225876,
|
|
"frequency_penalty": 0.0,
|
|
"max_tool_calls": None,
|
|
"moderation": None,
|
|
"presence_penalty": 0.0,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"top_logprobs": 0,
|
|
},
|
|
)
|
|
|
|
|
|
GPT_5_6_LUNA_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/responses",
|
|
litellm_request={
|
|
"model": "openai/gpt-5.6-luna",
|
|
"max_output_tokens": 64,
|
|
"instructions": "You are a terse assistant.",
|
|
"input": "Say hello.",
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/responses",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer synthetic-openai-key"},
|
|
expected_provider_request={
|
|
"model": "gpt-5.6-luna",
|
|
"input": "Say hello.",
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
},
|
|
mock_provider_response={
|
|
"id": "resp_06fba2eaed98666c006ac3f0181d8c87d09e79c4255c5a24c4",
|
|
"object": "response",
|
|
"created_at": 1791225880,
|
|
"status": "completed",
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225880,
|
|
"error": None,
|
|
"frequency_penalty": 0.0,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
"max_tool_calls": None,
|
|
"model": "gpt-5.6-luna",
|
|
"moderation": None,
|
|
"output": [
|
|
{
|
|
"id": "msg_06fba2eaed98666c006ac3f018dd9487d08c7e921025100a6d",
|
|
"type": "message",
|
|
"status": "completed",
|
|
"content": [{"type": "output_text", "annotations": [], "logprobs": [], "text": "Hello!"}],
|
|
"phase": "final_answer",
|
|
"role": "assistant",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"presence_penalty": 0.0,
|
|
"previous_response_id": None,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"store": True,
|
|
"temperature": 1.0,
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"tool_choice": "auto",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"tools": [],
|
|
"top_logprobs": 0,
|
|
"top_p": 0.98,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {"cache_write_tokens": 0, "cached_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"reasoning_tokens": 0},
|
|
"total_tokens": 25,
|
|
},
|
|
"user": None,
|
|
"metadata": {},
|
|
},
|
|
expected_litellm_response={
|
|
"id": ANY,
|
|
"created_at": 1791225880,
|
|
"error": None,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"metadata": {},
|
|
"model": "openai/gpt-5.6-luna",
|
|
"object": "response",
|
|
"output": [
|
|
{
|
|
"id": "msg_06fba2eaed98666c006ac3f018dd9487d08c7e921025100a6d",
|
|
"content": [{"annotations": [], "text": "Hello!", "type": "output_text", "logprobs": []}],
|
|
"role": "assistant",
|
|
"status": "completed",
|
|
"type": "message",
|
|
"phase": "final_answer",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"temperature": 1.0,
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 0.98,
|
|
"max_output_tokens": 64,
|
|
"previous_response_id": None,
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"status": "completed",
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {
|
|
"audio_tokens": None,
|
|
"cached_tokens": 0,
|
|
"cached_tokens_details": None,
|
|
"image_tokens": None,
|
|
"text_tokens": None,
|
|
"video_tokens": None,
|
|
"cache_write_tokens": 0,
|
|
},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"audio_tokens": None, "reasoning_tokens": 0, "text_tokens": None},
|
|
"total_tokens": 25,
|
|
"cost": None,
|
|
},
|
|
"user": None,
|
|
"store": True,
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225880,
|
|
"frequency_penalty": 0.0,
|
|
"max_tool_calls": None,
|
|
"moderation": None,
|
|
"presence_penalty": 0.0,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"top_logprobs": 0,
|
|
},
|
|
)
|
|
|
|
|
|
GPT_6_LUNA_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/responses",
|
|
litellm_request={
|
|
"model": "openai/gpt-6-luna",
|
|
"max_output_tokens": 64,
|
|
"instructions": "You are a terse assistant.",
|
|
"input": "Say hello.",
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/responses",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer synthetic-openai-key"},
|
|
expected_provider_request={
|
|
"model": "gpt-6-luna",
|
|
"input": "Say hello.",
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
},
|
|
mock_provider_response={
|
|
"id": "resp_05a79fb530391552006ac3f01c4cec87d0881e61192e1046ba",
|
|
"object": "response",
|
|
"created_at": 1791225884,
|
|
"status": "completed",
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225884,
|
|
"error": None,
|
|
"frequency_penalty": 0.0,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
"max_tool_calls": None,
|
|
"model": "gpt-6-luna",
|
|
"moderation": None,
|
|
"output": [
|
|
{
|
|
"id": "msg_05a79fb530391552006ac3f01cb60c87d082152e269d863aa4",
|
|
"type": "message",
|
|
"status": "completed",
|
|
"content": [{"type": "output_text", "annotations": [], "logprobs": [], "text": "Hello!"}],
|
|
"phase": "final_answer",
|
|
"role": "assistant",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"presence_penalty": 0.0,
|
|
"previous_response_id": None,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"store": True,
|
|
"temperature": 1.0,
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"tool_choice": "auto",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"tools": [],
|
|
"top_logprobs": 0,
|
|
"top_p": 0.98,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {"cache_write_tokens": 0, "cached_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"reasoning_tokens": 0},
|
|
"total_tokens": 25,
|
|
},
|
|
"user": None,
|
|
"metadata": {},
|
|
},
|
|
expected_litellm_response={
|
|
"id": ANY,
|
|
"created_at": 1791225884,
|
|
"error": None,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"metadata": {},
|
|
"model": "openai/gpt-6-luna",
|
|
"object": "response",
|
|
"output": [
|
|
{
|
|
"id": "msg_05a79fb530391552006ac3f01cb60c87d082152e269d863aa4",
|
|
"content": [{"annotations": [], "text": "Hello!", "type": "output_text", "logprobs": []}],
|
|
"role": "assistant",
|
|
"status": "completed",
|
|
"type": "message",
|
|
"phase": "final_answer",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"temperature": 1.0,
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 0.98,
|
|
"max_output_tokens": 64,
|
|
"previous_response_id": None,
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"status": "completed",
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {
|
|
"audio_tokens": None,
|
|
"cached_tokens": 0,
|
|
"cached_tokens_details": None,
|
|
"image_tokens": None,
|
|
"text_tokens": None,
|
|
"video_tokens": None,
|
|
"cache_write_tokens": 0,
|
|
},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"audio_tokens": None, "reasoning_tokens": 0, "text_tokens": None},
|
|
"total_tokens": 25,
|
|
"cost": None,
|
|
},
|
|
"user": None,
|
|
"store": True,
|
|
"access_programs": {"cyber": "daybreak_blue"},
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225884,
|
|
"frequency_penalty": 0.0,
|
|
"max_tool_calls": None,
|
|
"moderation": None,
|
|
"presence_penalty": 0.0,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"top_logprobs": 0,
|
|
},
|
|
)
|
|
|
|
|
|
GPT_6_1_SOL_TEST_CASE: Final = TranslationTestCase(
|
|
scenario="basic",
|
|
litellm_endpoint="/v1/responses",
|
|
litellm_request={
|
|
"model": "openai/gpt-6.1-sol",
|
|
"max_output_tokens": 64,
|
|
"instructions": "You are a terse assistant.",
|
|
"input": "Say hello.",
|
|
"cache": {"no-cache": True},
|
|
},
|
|
expected_provider_endpoint="/responses",
|
|
expected_provider_headers={"content-type": "application/json", "authorization": "Bearer synthetic-openai-key"},
|
|
expected_provider_request={
|
|
"model": "gpt-6.1-sol",
|
|
"input": "Say hello.",
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
},
|
|
mock_provider_response={
|
|
"id": "resp_05eee41d540f8798006ac3f01fff8887d0bf3cdc6e114644ae",
|
|
"object": "response",
|
|
"created_at": 1791225888,
|
|
"status": "completed",
|
|
"access_programs": None,
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225889,
|
|
"error": None,
|
|
"frequency_penalty": 0.0,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"max_output_tokens": 64,
|
|
"max_tool_calls": None,
|
|
"model": "gpt-6.1-sol",
|
|
"moderation": None,
|
|
"output": [
|
|
{
|
|
"id": "msg_05eee41d540f8798006ac3f02102c887d08143f5010642dc50",
|
|
"type": "message",
|
|
"status": "completed",
|
|
"content": [{"type": "output_text", "annotations": [], "logprobs": [], "text": "Hello!"}],
|
|
"phase": "final_answer",
|
|
"role": "assistant",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"presence_penalty": 0.0,
|
|
"previous_response_id": None,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"store": True,
|
|
"temperature": 1.0,
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"tool_choice": "auto",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"tools": [],
|
|
"top_logprobs": 0,
|
|
"top_p": 0.98,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {"cache_write_tokens": 0, "cached_tokens": 0},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"reasoning_tokens": 0},
|
|
"total_tokens": 25,
|
|
},
|
|
"user": None,
|
|
"metadata": {},
|
|
},
|
|
expected_litellm_response={
|
|
"id": ANY,
|
|
"created_at": 1791225888,
|
|
"error": None,
|
|
"incomplete_details": None,
|
|
"instructions": "You are a terse assistant.",
|
|
"metadata": {},
|
|
"model": "openai/gpt-6.1-sol",
|
|
"object": "response",
|
|
"output": [
|
|
{
|
|
"id": "msg_05eee41d540f8798006ac3f02102c887d08143f5010642dc50",
|
|
"content": [{"annotations": [], "text": "Hello!", "type": "output_text", "logprobs": []}],
|
|
"role": "assistant",
|
|
"status": "completed",
|
|
"type": "message",
|
|
"phase": "final_answer",
|
|
}
|
|
],
|
|
"parallel_tool_calls": True,
|
|
"temperature": 1.0,
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 0.98,
|
|
"max_output_tokens": 64,
|
|
"previous_response_id": None,
|
|
"reasoning": {"context": "all_turns", "effort": "medium", "mode": "standard", "summary": None},
|
|
"status": "completed",
|
|
"text": {"format": {"type": "text"}, "verbosity": "medium"},
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 19,
|
|
"input_tokens_details": {
|
|
"audio_tokens": None,
|
|
"cached_tokens": 0,
|
|
"cached_tokens_details": None,
|
|
"image_tokens": None,
|
|
"text_tokens": None,
|
|
"video_tokens": None,
|
|
"cache_write_tokens": 0,
|
|
},
|
|
"output_tokens": 6,
|
|
"output_tokens_details": {"audio_tokens": None, "reasoning_tokens": 0, "text_tokens": None},
|
|
"total_tokens": 25,
|
|
"cost": None,
|
|
},
|
|
"user": None,
|
|
"store": True,
|
|
"access_programs": None,
|
|
"background": False,
|
|
"billing": {"payer": "developer"},
|
|
"completed_at": 1791225889,
|
|
"frequency_penalty": 0.0,
|
|
"max_tool_calls": None,
|
|
"moderation": None,
|
|
"presence_penalty": 0.0,
|
|
"prompt_cache_key": None,
|
|
"prompt_cache_retention": "24h",
|
|
"safety_identifier": None,
|
|
"service_tier": "default",
|
|
"tool_usage": {
|
|
"image_gen": {
|
|
"input_tokens": 0,
|
|
"input_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"image_tokens": 0, "text_tokens": 0},
|
|
"total_tokens": 0,
|
|
},
|
|
"web_search": {"num_requests": 0},
|
|
},
|
|
"top_logprobs": 0,
|
|
},
|
|
)
|