From 2511c8c398b227710e370f19322925a95b5cf95b Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Wed, 24 Sep 2025 10:51:04 +0200 Subject: [PATCH] test: add gemini 2.5 flash --- providertests/openrouter_test.go | 19 +++++ ...ool_gemini-2.5-flash_google-ai-studio.yaml | 63 +++++++++++++++ ...i_tool_gemini-2.5-flash_google-vertex.yaml | 63 +++++++++++++++ .../global.yaml | 63 +++++++++++++++ ...ing_gemini-2.5-flash_google-ai-studio.yaml | 75 ++++++++++++++++++ ...eaming_gemini-2.5-flash_google-vertex.yaml | 77 +++++++++++++++++++ .../global.yaml | 77 +++++++++++++++++++ ...ple_gemini-2.5-flash_google-ai-studio.yaml | 33 ++++++++ ...simple_gemini-2.5-flash_google-vertex.yaml | 33 ++++++++ .../global.yaml | 33 ++++++++ ...ing_gemini-2.5-flash_google-ai-studio.yaml | 40 ++++++++++ ...eaming_gemini-2.5-flash_google-vertex.yaml | 42 ++++++++++ .../global.yaml | 40 ++++++++++ ...ool_gemini-2.5-flash_google-ai-studio.yaml | 63 +++++++++++++++ .../tool_gemini-2.5-flash_google-vertex.yaml | 63 +++++++++++++++ .../global.yaml | 63 +++++++++++++++ ...ing_gemini-2.5-flash_google-ai-studio.yaml | 75 ++++++++++++++++++ ...eaming_gemini-2.5-flash_google-vertex.yaml | 75 ++++++++++++++++++ .../global.yaml | 75 ++++++++++++++++++ 19 files changed, 1072 insertions(+) create mode 100644 providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-ai-studio.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex/global.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-ai-studio.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex/global.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-ai-studio.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex/global.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-ai-studio.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex/global.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-ai-studio.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex/global.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-ai-studio.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex.yaml create mode 100644 providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex/global.yaml diff --git a/providertests/openrouter_test.go b/providertests/openrouter_test.go index 9b99f90cff0df01de4992dc6451dfe5d9d7e82e1..77bccae84b3d0ea6ef3aa62438f782e0d42c754c 100644 --- a/providertests/openrouter_test.go +++ b/providertests/openrouter_test.go @@ -23,6 +23,7 @@ func TestOpenRouterCommon(t *testing.T) { grokCodeFast1(), claudeSonnet4(), grok4FastFree(), + gemini25Flash(), } for _, model := range models { @@ -104,6 +105,24 @@ func grok4FastFree() openrouterModel { } } +func gemini25Flash() openrouterModel { + return openrouterModel{ + name: "gemini-2.5-flash", + builderFunc: func(r *recorder.Recorder) (ai.LanguageModel, error) { + provider := openrouter.New( + openrouter.WithAPIKey(os.Getenv("OPENROUTER_API_KEY")), + openrouter.WithHTTPClient(&http.Client{Transport: r}), + ) + return provider.LanguageModel("google/gemini-2.5-flash") + }, + providers: []string{ + "google-vertex/global", + "google-ai-studio", + "google-vertex", + }, + } +} + func claudeSonnet4() openrouterModel { return openrouterModel{ name: "claude-sonnet-4", diff --git a/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-ai-studio.yaml b/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-ai-studio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ce9dc06757b39a5a2694c1c198c3ecce4884416d --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-ai-studio.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 877 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true},"provider":{"only":["google-ai-studio"]}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703830-0RLTMeyBcqMMKKPQjQBN\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703830,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"tool_0_add_dlpuikESZGTWUTyPauKY\",\"type\":\"function\",\"function\":{\"name\":\"add\",\"arguments\":\"{\\\"a\\\":2,\\\"b\\\":3}\"}},{\"index\":1,\"id\":\"tool_1_multiply_aH03S6PKLAAcaatuy4a7\",\"type\":\"function\",\"function\":{\"name\":\"multiply\",\"arguments\":\"{\\\"b\\\":3,\\\"a\\\":2}\"}}]}}],\"usage\":{\"prompt_tokens\":121,\"completion_tokens\":36,\"total_tokens\":157,\"cost\":0.0001263,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000363,\"upstream_inference_completions_cost\":0.00009},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 682.396ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1320 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_0_add_dlpuikESZGTWUTyPauKY","function":{"arguments":"{\"a\":2,\"b\":3}","name":"add"},"type":"function"},{"id":"tool_1_multiply_aH03S6PKLAAcaatuy4a7","function":{"arguments":"{\"b\":3,\"a\":2}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"tool_0_add_dlpuikESZGTWUTyPauKY","role":"tool"},{"content":"6","tool_call_id":"tool_1_multiply_aH03S6PKLAAcaatuy4a7","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-ai-studio"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703831-CLdqZOjspvlZ11SxO6fq\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703831,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The sum of 2 and 3 is 5, and the product of 2 and 3 is 6.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":218,\"completion_tokens\":23,\"total_tokens\":241,\"cost\":0.0001229,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000654,\"upstream_inference_completions_cost\":0.0000575},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 444.417625ms diff --git a/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex.yaml b/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex.yaml new file mode 100644 index 0000000000000000000000000000000000000000..536e2086624864d6c6c82b1983ea53bc1166ae26 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 874 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703838-jPCAdfj7uI7lsGva0U6o\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703838,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"tool_0_add_u4UhhORuAGJw75fzTq0Y\",\"type\":\"function\",\"function\":{\"name\":\"add\",\"arguments\":\"{\\\"a\\\":2,\\\"b\\\":3}\"}},{\"index\":1,\"id\":\"tool_1_multiply_SRxpexYe5wBL2HZDKm4O\",\"type\":\"function\",\"function\":{\"name\":\"multiply\",\"arguments\":\"{\\\"a\\\":2,\\\"b\\\":3}\"}}]}}],\"usage\":{\"prompt_tokens\":57,\"completion_tokens\":10,\"total_tokens\":67,\"cost\":0.0000421,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000171,\"upstream_inference_completions_cost\":0.000025},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 736.498625ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1317 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_0_add_u4UhhORuAGJw75fzTq0Y","function":{"arguments":"{\"a\":2,\"b\":3}","name":"add"},"type":"function"},{"id":"tool_1_multiply_SRxpexYe5wBL2HZDKm4O","function":{"arguments":"{\"a\":2,\"b\":3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"tool_0_add_u4UhhORuAGJw75fzTq0Y","role":"tool"},{"content":"6","tool_call_id":"tool_1_multiply_SRxpexYe5wBL2HZDKm4O","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703838-V7VWtgDg5cottmdrd5oM\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703838,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The sum of 2 and 3 is 5. The product of 2 and 3 is 6.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":110,\"completion_tokens\":24,\"total_tokens\":134,\"cost\":0.000093,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.000033,\"upstream_inference_completions_cost\":0.00006},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 729.437625ms diff --git a/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex/global.yaml b/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex/global.yaml new file mode 100644 index 0000000000000000000000000000000000000000..353cf12f11153c77f7408f218a65e58583583288 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/multi_tool_gemini-2.5-flash_google-vertex/global.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 881 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703823-viyGjtA6CoC3yZGePDDg\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703823,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"tool_0_add_NaecewiKb0yPItnzTYuj\",\"type\":\"function\",\"function\":{\"name\":\"add\",\"arguments\":\"{\\\"b\\\":3,\\\"a\\\":2}\"}},{\"index\":1,\"id\":\"tool_1_multiply_m7sJ1eZTXZAGrgiqjtKW\",\"type\":\"function\",\"function\":{\"name\":\"multiply\",\"arguments\":\"{\\\"b\\\":3,\\\"a\\\":2}\"}}]}}],\"usage\":{\"prompt_tokens\":57,\"completion_tokens\":10,\"total_tokens\":67,\"cost\":0.0000421,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000171,\"upstream_inference_completions_cost\":0.000025},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 816.24375ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1324 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_0_add_NaecewiKb0yPItnzTYuj","function":{"arguments":"{\"b\":3,\"a\":2}","name":"add"},"type":"function"},{"id":"tool_1_multiply_m7sJ1eZTXZAGrgiqjtKW","function":{"arguments":"{\"b\":3,\"a\":2}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"tool_0_add_NaecewiKb0yPItnzTYuj","role":"tool"},{"content":"6","tool_call_id":"tool_1_multiply_m7sJ1eZTXZAGrgiqjtKW","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703824-Ry4umAh5glto49FaWZxN\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703824,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"I have added 2 and 3 to get 5, and multiplied 2 and 3 to get 6.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":109,\"completion_tokens\":25,\"total_tokens\":134,\"cost\":0.0000952,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000327,\"upstream_inference_completions_cost\":0.0000625},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 711.883375ms diff --git a/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-ai-studio.yaml b/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-ai-studio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3d7e952db6f6b1627f20e5e6ac3f18855f3f8ccf --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-ai-studio.yaml @@ -0,0 +1,75 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 931 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"usage":{"include":true},"provider":{"only":["google-ai-studio"]},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703832-Kmoor1Ommbtko0KqlD0k","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703832,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"tool_0_add_5tjz0FLvReghvdKlI11s","type":"function","function":{"name":"add","arguments":"{\"b\":3,\"a\":2}"}},{"index":1,"id":"tool_1_multiply_uyRMwfRb8ftFmPfJUYtm","type":"function","function":{"name":"multiply","arguments":"{\"a\":2,\"b\":3}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703832-Kmoor1Ommbtko0KqlD0k","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703832,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":121,"completion_tokens":36,"total_tokens":157,"cost":0.0001263,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000363,"upstream_inference_completions_cost":0.00009},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 770.896334ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1374 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_0_add_5tjz0FLvReghvdKlI11s","function":{"arguments":"{\"b\":3,\"a\":2}","name":"add"},"type":"function"},{"id":"tool_1_multiply_uyRMwfRb8ftFmPfJUYtm","function":{"arguments":"{\"a\":2,\"b\":3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"tool_0_add_5tjz0FLvReghvdKlI11s","role":"tool"},{"content":"6","tool_call_id":"tool_1_multiply_uyRMwfRb8ftFmPfJUYtm","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-ai-studio"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703832-xtntzea51eYK9yBP7VHs","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703832,"choices":[{"index":0,"delta":{"role":"assistant","content":"The sum is ","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703832-xtntzea51eYK9yBP7VHs","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703832,"choices":[{"index":0,"delta":{"role":"assistant","content":"5 and the product is 6.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703832-xtntzea51eYK9yBP7VHs","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703832,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":217,"completion_tokens":11,"total_tokens":228,"cost":0.0000926,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000651,"upstream_inference_completions_cost":0.0000275},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 477.776292ms diff --git a/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex.yaml b/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fbc7b356eacda6a272ae91a5092fd676f394faee --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex.yaml @@ -0,0 +1,77 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 928 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703839-IIjeKtoyVSa9GsVrQ3uv","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703839,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"tool_0_add_KH8U9wsrnBUhs7Pa65Bq","type":"function","function":{"name":"add","arguments":"{\"b\":3,\"a\":2}"}},{"index":1,"id":"tool_1_multiply_TXFdxr9GMAbGT1HU4qV0","type":"function","function":{"name":"multiply","arguments":"{\"b\":3,\"a\":2}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703839-IIjeKtoyVSa9GsVrQ3uv","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703839,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":57,"completion_tokens":10,"total_tokens":67,"cost":0.0000421,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000171,"upstream_inference_completions_cost":0.000025},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 923.704583ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1371 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_0_add_KH8U9wsrnBUhs7Pa65Bq","function":{"arguments":"{\"b\":3,\"a\":2}","name":"add"},"type":"function"},{"id":"tool_1_multiply_TXFdxr9GMAbGT1HU4qV0","function":{"arguments":"{\"b\":3,\"a\":2}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"tool_0_add_KH8U9wsrnBUhs7Pa65Bq","role":"tool"},{"content":"6","tool_call_id":"tool_1_multiply_TXFdxr9GMAbGT1HU4qV0","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703840-KHzPd5w0mUsWCcuGBBhQ","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703840,"choices":[{"index":0,"delta":{"role":"assistant","content":"I","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703840-KHzPd5w0mUsWCcuGBBhQ","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703840,"choices":[{"index":0,"delta":{"role":"assistant","content":" have added 2 and 3 to get 5, and multiplied 2 and 3 to","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703840-KHzPd5w0mUsWCcuGBBhQ","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703840,"choices":[{"index":0,"delta":{"role":"assistant","content":" get 6.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703840-KHzPd5w0mUsWCcuGBBhQ","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703840,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":110,"completion_tokens":25,"total_tokens":135,"cost":0.0000955,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000033,"upstream_inference_completions_cost":0.0000625},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 818.415916ms diff --git a/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex/global.yaml b/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex/global.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e15d40e9c435b432e07eaa554f9ce28014ebd2a4 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/multi_tool_streaming_gemini-2.5-flash_google-vertex/global.yaml @@ -0,0 +1,77 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 935 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703824-EYBJHSc1zhaT9hokrllR","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703824,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"tool_0_add_4U7KVs3rImd9TqEeWMfD","type":"function","function":{"name":"add","arguments":"{\"a\":2,\"b\":3}"}},{"index":1,"id":"tool_1_multiply_BziO6vjr0p9rhYMnQXfR","type":"function","function":{"name":"multiply","arguments":"{\"a\":2,\"b\":3}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703824-EYBJHSc1zhaT9hokrllR","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703824,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":57,"completion_tokens":10,"total_tokens":67,"cost":0.0000421,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000171,"upstream_inference_completions_cost":0.000025},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 793.75175ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1378 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant. Always use both add and multiply at the same time.","role":"system"},{"content":"Add and multiply the number 2 and 3","role":"user"},{"tool_calls":[{"id":"tool_0_add_4U7KVs3rImd9TqEeWMfD","function":{"arguments":"{\"a\":2,\"b\":3}","name":"add"},"type":"function"},{"id":"tool_1_multiply_BziO6vjr0p9rhYMnQXfR","function":{"arguments":"{\"a\":2,\"b\":3}","name":"multiply"},"type":"function"}],"role":"assistant"},{"content":"5","tool_call_id":"tool_0_add_4U7KVs3rImd9TqEeWMfD","role":"tool"},{"content":"6","tool_call_id":"tool_1_multiply_BziO6vjr0p9rhYMnQXfR","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"add","strict":false,"description":"Add two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"},{"function":{"name":"multiply","strict":false,"description":"Multiply two numbers","parameters":{"properties":{"a":{"description":"first number","type":"integer"},"b":{"description":"second number","type":"integer"}},"required":["a","b"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703825-B9gyHlo164336ZrlgRqM","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703825,"choices":[{"index":0,"delta":{"role":"assistant","content":"I","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703825-B9gyHlo164336ZrlgRqM","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703825,"choices":[{"index":0,"delta":{"role":"assistant","content":" have added 2 and 3 to get 5, and multiplied 2 and 3 to","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703825-B9gyHlo164336ZrlgRqM","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703825,"choices":[{"index":0,"delta":{"role":"assistant","content":" get 6.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703825-B9gyHlo164336ZrlgRqM","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703825,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":112,"completion_tokens":25,"total_tokens":137,"cost":0.0000961,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000336,"upstream_inference_completions_cost":0.0000625},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 687.913917ms diff --git a/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-ai-studio.yaml b/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-ai-studio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6285ce50840081f55bd1b86f1620cadce4808ef7 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-ai-studio.yaml @@ -0,0 +1,33 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 239 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"provider":{"only":["google-ai-studio"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: '{"id":"gen-1758703826-lKOF7A82gK5ktaYuQVKj","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion","created":1758703826,"choices":[{"logprobs":null,"finish_reason":"stop","native_finish_reason":"STOP","index":0,"message":{"role":"assistant","content":"\"Olá!\"","refusal":null,"reasoning":null}}],"usage":{"prompt_tokens":11,"completion_tokens":3,"total_tokens":14,"cost":0.0000108,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000033,"upstream_inference_completions_cost":0.0000075},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}' + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 384.559167ms diff --git a/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex.yaml b/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex.yaml new file mode 100644 index 0000000000000000000000000000000000000000..32ece6669b4ca658ef59617ea473c0d22068490d --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex.yaml @@ -0,0 +1,33 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 236 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"usage":{"include":true},"provider":{"only":["google-vertex"]}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n{\"id\":\"gen-1758703833-UOtGSn0HPRf7N4GbwcNq\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703833,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":9,\"completion_tokens\":2,\"total_tokens\":11,\"cost\":0.0000077,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000027,\"upstream_inference_completions_cost\":0.000005},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.186650292s diff --git a/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex/global.yaml b/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex/global.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ea41e3fdbb320821c35379d52f4fa80791c6308d --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/simple_gemini-2.5-flash_google-vertex/global.yaml @@ -0,0 +1,33 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 243 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"provider":{"only":["google-vertex/global"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703819-1HtYtqHViG8mTLQmAyQt\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703819,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Olá!\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":9,\"completion_tokens\":2,\"total_tokens\":11,\"cost\":0.0000077,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000027,\"upstream_inference_completions_cost\":0.000005},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 840.353375ms diff --git a/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-ai-studio.yaml b/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-ai-studio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8d3d28a96b08d8ab27e90e54db5eb5de6ace989b --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-ai-studio.yaml @@ -0,0 +1,40 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 293 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["google-ai-studio"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703826-tRd6a7hwbYyJemlBwJ86","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703826,"choices":[{"index":0,"delta":{"role":"assistant","content":"Olá","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703826-tRd6a7hwbYyJemlBwJ86","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703826,"choices":[{"index":0,"delta":{"role":"assistant","content":"!","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703826-tRd6a7hwbYyJemlBwJ86","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703826,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":11,"completion_tokens":2,"total_tokens":13,"cost":0.0000083,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000033,"upstream_inference_completions_cost":0.000005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 466.110542ms diff --git a/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex.yaml b/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ae5242287905eb2958a39b66377d531316e4a8d7 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex.yaml @@ -0,0 +1,42 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 290 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["google-vertex"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703834-PqKqBUb0y22965iY9gBA","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703834,"choices":[{"index":0,"delta":{"role":"assistant","content":"\"","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703834-PqKqBUb0y22965iY9gBA","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703834,"choices":[{"index":0,"delta":{"role":"assistant","content":"Olá\" is the most","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703834-PqKqBUb0y22965iY9gBA","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703834,"choices":[{"index":0,"delta":{"role":"assistant","content":" common way to say \"hi\" or \"hello\" in Portuguese.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703834-PqKqBUb0y22965iY9gBA","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703834,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":9,"completion_tokens":20,"total_tokens":29,"cost":0.0000527,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000027,"upstream_inference_completions_cost":0.00005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 513.528709ms diff --git a/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex/global.yaml b/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex/global.yaml new file mode 100644 index 0000000000000000000000000000000000000000..19cbf29b927efaf8f75a70f4a8cdae16599a872d --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/simple_streaming_gemini-2.5-flash_google-vertex/global.yaml @@ -0,0 +1,40 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 297 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"Say hi in Portuguese","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"provider":{"only":["google-vertex/global"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703819-acg5QcYB43aUYzXcQLgs","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703819,"choices":[{"index":0,"delta":{"role":"assistant","content":"Olá","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703819-acg5QcYB43aUYzXcQLgs","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703819,"choices":[{"index":0,"delta":{"role":"assistant","content":"!","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703819-acg5QcYB43aUYzXcQLgs","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703819,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":9,"completion_tokens":2,"total_tokens":11,"cost":0.0000077,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000027,"upstream_inference_completions_cost":0.000005},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 559.291709ms diff --git a/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-ai-studio.yaml b/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-ai-studio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..242faca3bf78f83df714d74d80999d230a793ea5 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-ai-studio.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 531 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-ai-studio"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n\n \n{\"id\":\"gen-1758703827-8iPEL08rS75Xlps7arMo\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703827,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"tool_0_weather_mpzi5GviR5lYoYvO02M0\",\"type\":\"function\",\"function\":{\"name\":\"weather\",\"arguments\":\"{\\\"location\\\":\\\"Florence,Italy\\\"}\"}}]}}],\"usage\":{\"prompt_tokens\":54,\"completion_tokens\":15,\"total_tokens\":69,\"cost\":0.0000537,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000162,\"upstream_inference_completions_cost\":0.0000375},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.122369125s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 794 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_0_weather_mpzi5GviR5lYoYvO02M0","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"tool_0_weather_mpzi5GviR5lYoYvO02M0","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-ai-studio"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703828-yII3njTgMfNUaDucsAcR\",\"provider\":\"Google AI Studio\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703828,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The weather in Florence, Italy is 40 degrees Celsius.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":105,\"completion_tokens\":13,\"total_tokens\":118,\"cost\":0.000064,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000315,\"upstream_inference_completions_cost\":0.0000325},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 605.860292ms diff --git a/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex.yaml b/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9637e05b57b76356c56c62d4df751284a697ae8 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 528 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703835-QRbo6AN5Yrc7ExyLsGsB\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703835,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"tool_0_weather_pisIeGWIpMquWuIb45fl\",\"type\":\"function\",\"function\":{\"name\":\"weather\",\"arguments\":\"{\\\"location\\\":\\\"Florence,Italy\\\"}\"}}]}}],\"usage\":{\"prompt_tokens\":28,\"completion_tokens\":5,\"total_tokens\":33,\"cost\":0.0000209,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000084,\"upstream_inference_completions_cost\":0.0000125},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 693.128792ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 791 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_0_weather_pisIeGWIpMquWuIb45fl","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"tool_0_weather_pisIeGWIpMquWuIb45fl","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"usage":{"include":true},"provider":{"only":["google-vertex"]}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703835-pp0IbEfyj6DJvS6UPeyu\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703835,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"The weather in Florence, Italy is 40 degrees Celsius.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":54,\"completion_tokens\":13,\"total_tokens\":67,\"cost\":0.0000487,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000162,\"upstream_inference_completions_cost\":0.0000325},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 690.716458ms diff --git a/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex/global.yaml b/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex/global.yaml new file mode 100644 index 0000000000000000000000000000000000000000..77454e675cb550379b8207f9ce12f21eb84fe03d --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/tool_gemini-2.5-flash_google-vertex/global.yaml @@ -0,0 +1,63 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 535 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703820-xruWRSvLbjyR9nsK4749\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703820,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"tool_calls\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"\",\"refusal\":null,\"reasoning\":null,\"tool_calls\":[{\"index\":0,\"id\":\"tool_0_weather_16iLM524ZeDpIDTOj6O1\",\"type\":\"function\",\"function\":{\"name\":\"weather\",\"arguments\":\"{\\\"location\\\":\\\"Florence,Italy\\\"}\"}}]}}],\"usage\":{\"prompt_tokens\":28,\"completion_tokens\":5,\"total_tokens\":33,\"cost\":0.0000209,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000084,\"upstream_inference_completions_cost\":0.0000125},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 730.854417ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 798 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_0_weather_16iLM524ZeDpIDTOj6O1","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"tool_0_weather_16iLM524ZeDpIDTOj6O1","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: "\n \n{\"id\":\"gen-1758703820-BJOErOhcAdaOFFVVeVEe\",\"provider\":\"Google\",\"model\":\"google/gemini-2.5-flash\",\"object\":\"chat.completion\",\"created\":1758703821,\"choices\":[{\"logprobs\":null,\"finish_reason\":\"stop\",\"native_finish_reason\":\"STOP\",\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"It's 40 degrees Celsius in Florence, Italy.\",\"refusal\":null,\"reasoning\":null}}],\"usage\":{\"prompt_tokens\":58,\"completion_tokens\":13,\"total_tokens\":71,\"cost\":0.0000499,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0.0000174,\"upstream_inference_completions_cost\":0.0000325},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0}}}" + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 613.167916ms diff --git a/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-ai-studio.yaml b/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-ai-studio.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ec0be56e073e76f5d5fca7b31d1ad1169259c391 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-ai-studio.yaml @@ -0,0 +1,75 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 585 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-ai-studio"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703829-uzmqaZrYw58Bw3GpcfSs","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703829,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"tool_0_weather_GRiNHWvnqr6phmz2EHzE","type":"function","function":{"name":"weather","arguments":"{\"location\":\"Florence,Italy\"}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703829-uzmqaZrYw58Bw3GpcfSs","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703829,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":54,"completion_tokens":15,"total_tokens":69,"cost":0.0000537,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000162,"upstream_inference_completions_cost":0.0000375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 927.46375ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 848 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_0_weather_GRiNHWvnqr6phmz2EHzE","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"tool_0_weather_GRiNHWvnqr6phmz2EHzE","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-ai-studio"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703830-Kk0wyqI4L1J39hm0vjfz","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703830,"choices":[{"index":0,"delta":{"role":"assistant","content":"The weather in Florence","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703830-Kk0wyqI4L1J39hm0vjfz","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703830,"choices":[{"index":0,"delta":{"role":"assistant","content":", Italy is 40 C.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703830-Kk0wyqI4L1J39hm0vjfz","provider":"Google AI Studio","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703830,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":102,"completion_tokens":12,"total_tokens":114,"cost":0.0000606,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000306,"upstream_inference_completions_cost":0.00003},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 609.687583ms diff --git a/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex.yaml b/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex.yaml new file mode 100644 index 0000000000000000000000000000000000000000..951dcce80d21d0ec90e3fa6ce89c801c71649ccc --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex.yaml @@ -0,0 +1,75 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 582 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703836-M3HO51jlqZgtOcH54tqp","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703836,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"tool_0_weather_zRxyTyWOpxyBIIsrGNQb","type":"function","function":{"name":"weather","arguments":"{\"location\":\"Florence,Italy\"}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703836-M3HO51jlqZgtOcH54tqp","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703836,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":28,"completion_tokens":5,"total_tokens":33,"cost":0.0000209,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000084,"upstream_inference_completions_cost":0.0000125},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 731.052667ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 845 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_0_weather_zRxyTyWOpxyBIIsrGNQb","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"tool_0_weather_zRxyTyWOpxyBIIsrGNQb","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703837-IoFAnaoBhObldcW3tg0m","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703837,"choices":[{"index":0,"delta":{"role":"assistant","content":"The","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703837-IoFAnaoBhObldcW3tg0m","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703837,"choices":[{"index":0,"delta":{"role":"assistant","content":" weather in Florence, Italy is 40 degrees Celsius.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703837-IoFAnaoBhObldcW3tg0m","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703837,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":55,"completion_tokens":13,"total_tokens":68,"cost":0.000049,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000165,"upstream_inference_completions_cost":0.0000325},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 697.874042ms diff --git a/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex/global.yaml b/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex/global.yaml new file mode 100644 index 0000000000000000000000000000000000000000..15193fd585ed1e9ec194f9c42eebce870e4aca29 --- /dev/null +++ b/providertests/testdata/TestOpenRouterCommon/tool_streaming_gemini-2.5-flash_google-vertex/global.yaml @@ -0,0 +1,75 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 589 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703821-dZu7LbsgRUCmK0Ufdqtc","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703821,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"tool_0_weather_P63yrD3HjU0ANCb6Ms68","type":"function","function":{"name":"weather","arguments":"{\"location\":\"Florence,Italy\"}"}}]},"finish_reason":"tool_calls","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703821-dZu7LbsgRUCmK0Ufdqtc","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703821,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":28,"completion_tokens":5,"total_tokens":33,"cost":0.0000209,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000084,"upstream_inference_completions_cost":0.0000125},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 815.136459ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 852 + host: "" + body: '{"messages":[{"content":"You are a helpful assistant","role":"system"},{"content":"What''s the weather in Florence,Italy?","role":"user"},{"tool_calls":[{"id":"tool_0_weather_P63yrD3HjU0ANCb6Ms68","function":{"arguments":"{\"location\":\"Florence,Italy\"}","name":"weather"},"type":"function"}],"role":"assistant"},{"content":"40 C","tool_call_id":"tool_0_weather_P63yrD3HjU0ANCb6Ms68","role":"tool"}],"model":"google/gemini-2.5-flash","max_tokens":4000,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"function":{"name":"weather","strict":false,"description":"Get weather information for a location","parameters":{"properties":{"location":{"description":"the city","type":"string"}},"required":["location"],"type":"object"}},"type":"function"}],"provider":{"only":["google-vertex/global"]},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1758703822-Sg3pNqQpQCaNrz79Pjrb","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703822,"choices":[{"index":0,"delta":{"role":"assistant","content":"The weather in Florence, Italy","reasoning":null,"reasoning_details":[]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1758703822-Sg3pNqQpQCaNrz79Pjrb","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703822,"choices":[{"index":0,"delta":{"role":"assistant","content":" is 40 degrees Celsius.","reasoning":null,"reasoning_details":[]},"finish_reason":"stop","native_finish_reason":"STOP","logprobs":null}]} + + data: {"id":"gen-1758703822-Sg3pNqQpQCaNrz79Pjrb","provider":"Google","model":"google/gemini-2.5-flash","object":"chat.completion.chunk","created":1758703822,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":58,"completion_tokens":13,"total_tokens":71,"cost":0.0000499,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000174,"upstream_inference_completions_cost":0.0000325},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 715.936ms