diff --git a/.changeset/kind-parrots-burn.md b/.changeset/kind-parrots-burn.md new file mode 100644 index 000000000..3343131d3 --- /dev/null +++ b/.changeset/kind-parrots-burn.md @@ -0,0 +1,5 @@ +--- +"braintrust": patch +--- + +fix: Fix `reasoning_content` for openai compatible responses diff --git a/e2e/helpers/scenario-harness.ts b/e2e/helpers/scenario-harness.ts index b86753c4a..2a5d0fe67 100644 --- a/e2e/helpers/scenario-harness.ts +++ b/e2e/helpers/scenario-harness.ts @@ -306,6 +306,7 @@ function getCassetteServerRoutes(): CassetteServerRoute[] { { prefix: "/cohere", upstreamOrigin: "https://api.cohere.com" }, { prefix: "/cursor/v1", upstreamOrigin: "https://api.cursor.com/v1" }, { prefix: "/cursor", upstreamOrigin: "https://api2.cursor.sh" }, + { prefix: "/deepseek", upstreamOrigin: "https://api.deepseek.com" }, { prefix: "/google-generative-language", upstreamOrigin: "https://generativelanguage.googleapis.com", @@ -343,6 +344,7 @@ function getCassetteEnv(wiring: ActiveCassetteWiring): Record { COHERE_BASE_URL: `${serverUrl}/cohere`, COHERE_API_URL: `${serverUrl}/cohere`, CURSOR_BACKEND_URL: `${serverUrl}/cursor`, + DEEPSEEK_BASE_URL: `${serverUrl}/deepseek/v1`, GEMINI_BASE_URL: `${serverUrl}/google-generative-language`, GEMINI_NEXT_GEN_API_BASE_URL: `${serverUrl}/google-generative-language`, GOOGLE_GENERATIVE_AI_BASE_URL: `${serverUrl}/google-generative-language`, @@ -399,6 +401,7 @@ const CASSETTE_PROVIDER_KEYS: Array<{ }, { envVars: ["ELEVENLABS_API_KEY"], placeholder: "cassette-placeholder" }, { envVars: ["CURSOR_API_KEY"], placeholder: "key_cassette-placeholder" }, + { envVars: ["DEEPSEEK_API_KEY"], placeholder: "sk-cassette-placeholder" }, { envVars: ["GOOGLE_API_KEY", "GOOGLE_GENAI_API_KEY", "GEMINI_API_KEY"], placeholder: "cassette-placeholder", diff --git a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4-latest.cassette.json b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4-latest.cassette.json index 9089bdd22..10c51cd02 100644 --- a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4-latest.cassette.json +++ b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4-latest.cassette.json @@ -2358,6 +2358,109 @@ "status": 200, "statusText": "OK" } + }, + { + "callIndex": 0, + "id": "631c45d386f59296", + "matchKey": "POST api.deepseek.com/v1/chat/completions", + "recordedAt": "2026-09-25T06:11:58.950Z", + "request": { + "body": { + "kind": "json", + "value": { + "max_tokens": 2048, + "messages": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "model": "deepseek-flash", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.deepseek.com/v1/chat/completions" + }, + "response": { + "body": { + "chunks": [ + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"reasoning_content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"We\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" compare\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" vs\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" =\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"80\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\",\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" than\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Must\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"9\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"8\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"60b824d8-0782-43c5-a798-178172d649fa\",\"object\":\"chat.completion.chunk\",\"created\":1790316718,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":51,\"completion_tokens\":46,\"total_tokens\":97,\"prompt_tokens_details\":{\"cached_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":42},\"prompt_cache_hit_tokens\":0,\"prompt_cache_miss_tokens\":51}}", + "data: [DONE]" + ], + "kind": "sse" + }, + "headers": { + "access-control-allow-credentials": "true", + "cache-control": "no-cache", + "content-type": "text/event-stream; charset=utf-8", + "date": "Fri, 25 Sep 2026 06:11:58 GMT", + "server": "elb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "vary": "origin, access-control-request-method, access-control-request-headers", + "via": "1.1 230a4cabf962361d7a66119623a370ee.cloudfront.net (CloudFront)", + "x-amz-cf-id": "ejJ3aV7m8QnSCau9fmnnZ6vkFKIo6zKo4XhiR1_BkxmTddMMPJSfsw==", + "x-amz-cf-pop": "SFO53-P10", + "x-cache": "Miss from cloudfront", + "x-content-type-options": "nosniff", + "x-ds-trace-id": "1cded484df907a92fe77bf6356af3257" + }, + "status": 200 + } } ], "meta": { diff --git a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4.cassette.json b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4.cassette.json index afb570ddd..b4537d598 100644 --- a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4.cassette.json +++ b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v4.cassette.json @@ -2391,6 +2391,107 @@ "status": 200, "statusText": "OK" } + }, + { + "callIndex": 0, + "id": "631c45d386f59296", + "matchKey": "POST api.deepseek.com/v1/chat/completions", + "recordedAt": "2026-09-25T06:11:56.615Z", + "request": { + "body": { + "kind": "json", + "value": { + "max_tokens": 2048, + "messages": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "model": "deepseek-flash", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.deepseek.com/v1/chat/completions" + }, + "response": { + "body": { + "chunks": [ + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"reasoning_content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"We\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Compare\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" vs\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" =\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"80\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" >\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Must\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" with\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"9\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"8\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"28e7d75f-6b20-49e8-bf78-400fdedf7c5e\",\"object\":\"chat.completion.chunk\",\"created\":1790316715,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":51,\"completion_tokens\":44,\"total_tokens\":95,\"prompt_tokens_details\":{\"cached_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":40},\"prompt_cache_hit_tokens\":0,\"prompt_cache_miss_tokens\":51}}", + "data: [DONE]" + ], + "kind": "sse" + }, + "headers": { + "access-control-allow-credentials": "true", + "cache-control": "no-cache", + "content-type": "text/event-stream; charset=utf-8", + "date": "Fri, 25 Sep 2026 06:11:55 GMT", + "server": "elb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "vary": "origin, access-control-request-method, access-control-request-headers", + "via": "1.1 230a4cabf962361d7a66119623a370ee.cloudfront.net (CloudFront)", + "x-amz-cf-id": "_cxropRVmhG7Ba05C1BIFZZMpZ6s_a1hnV13pzRlD5T7A2v1aqzl1Q==", + "x-amz-cf-pop": "SFO53-P10", + "x-cache": "Miss from cloudfront", + "x-content-type-options": "nosniff", + "x-ds-trace-id": "564f13eece9f38e3d7624c67df41962c" + }, + "status": 200 + } } ], "meta": { diff --git a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5-latest.cassette.json b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5-latest.cassette.json index b1fbaac03..89f8b0072 100644 --- a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5-latest.cassette.json +++ b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5-latest.cassette.json @@ -2477,6 +2477,106 @@ "status": 200, "statusText": "OK" } + }, + { + "callIndex": 0, + "id": "631c45d386f59296", + "matchKey": "POST api.deepseek.com/v1/chat/completions", + "recordedAt": "2026-09-25T06:12:03.958Z", + "request": { + "body": { + "kind": "json", + "value": { + "max_tokens": 2048, + "messages": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "model": "deepseek-flash", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.deepseek.com/v1/chat/completions" + }, + "response": { + "body": { + "chunks": [ + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"reasoning_content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"We\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Compare\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" vs\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" =\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"80\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" >\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"9\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"8\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"ed180268-cfcc-4645-9a70-0fc49d8e2a8c\",\"object\":\"chat.completion.chunk\",\"created\":1790316723,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":51,\"completion_tokens\":43,\"total_tokens\":94,\"prompt_tokens_details\":{\"cached_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":39},\"prompt_cache_hit_tokens\":0,\"prompt_cache_miss_tokens\":51}}", + "data: [DONE]" + ], + "kind": "sse" + }, + "headers": { + "access-control-allow-credentials": "true", + "cache-control": "no-cache", + "content-type": "text/event-stream; charset=utf-8", + "date": "Fri, 25 Sep 2026 06:12:03 GMT", + "server": "elb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "vary": "origin, access-control-request-method, access-control-request-headers", + "via": "1.1 230a4cabf962361d7a66119623a370ee.cloudfront.net (CloudFront)", + "x-amz-cf-id": "GaCf5DKqaIy_0i-RVTaKX8LIcv8120u6GJtRpJx-6pjP8i7XoDO3nw==", + "x-amz-cf-pop": "SFO53-P10", + "x-cache": "Miss from cloudfront", + "x-content-type-options": "nosniff", + "x-ds-trace-id": "131154829fc0165548a944ee869baa87" + }, + "status": 200 + } } ], "meta": { diff --git a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5.cassette.json b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5.cassette.json index cf9b7ec96..ced700a8d 100644 --- a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5.cassette.json +++ b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v5.cassette.json @@ -2492,6 +2492,111 @@ "status": 200, "statusText": "OK" } + }, + { + "callIndex": 0, + "id": "631c45d386f59296", + "matchKey": "POST api.deepseek.com/v1/chat/completions", + "recordedAt": "2026-09-25T06:12:01.499Z", + "request": { + "body": { + "kind": "json", + "value": { + "max_tokens": 2048, + "messages": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "model": "deepseek-flash", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.deepseek.com/v1/chat/completions" + }, + "response": { + "body": { + "chunks": [ + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"reasoning_content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"We\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Compare\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" vs\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" =\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"80\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" >\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"9\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"8\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"a51841f3-ea00-42a9-ac89-d640dc10f623\",\"object\":\"chat.completion.chunk\",\"created\":1790316720,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":51,\"completion_tokens\":48,\"total_tokens\":99,\"prompt_tokens_details\":{\"cached_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":44},\"prompt_cache_hit_tokens\":0,\"prompt_cache_miss_tokens\":51}}", + "data: [DONE]" + ], + "kind": "sse" + }, + "headers": { + "access-control-allow-credentials": "true", + "cache-control": "no-cache", + "content-type": "text/event-stream; charset=utf-8", + "date": "Fri, 25 Sep 2026 06:12:00 GMT", + "server": "elb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "vary": "origin, access-control-request-method, access-control-request-headers", + "via": "1.1 230a4cabf962361d7a66119623a370ee.cloudfront.net (CloudFront)", + "x-amz-cf-id": "rblnNFRyPwAveR1ngFgkEj9yQidwqaRrYkesFQant1sn9dRA_aePfQ==", + "x-amz-cf-pop": "SFO53-P10", + "x-cache": "Miss from cloudfront", + "x-content-type-options": "nosniff", + "x-ds-trace-id": "0e72f6edc3467947f6a7cf9d01018f7c" + }, + "status": 200 + } } ], "meta": { diff --git a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6-latest.cassette.json b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6-latest.cassette.json index 16b0139f1..76c5e0ac3 100644 --- a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6-latest.cassette.json +++ b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6-latest.cassette.json @@ -2840,6 +2840,116 @@ "status": 200, "statusText": "OK" } + }, + { + "callIndex": 0, + "id": "631c45d386f59296", + "matchKey": "POST api.deepseek.com/v1/chat/completions", + "recordedAt": "2026-09-25T06:12:09.757Z", + "request": { + "body": { + "kind": "json", + "value": { + "max_tokens": 2048, + "messages": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "model": "deepseek-flash", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.deepseek.com/v1/chat/completions" + }, + "response": { + "body": { + "chunks": [ + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"reasoning_content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"We\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" compare\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" vs\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" As\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" decimals\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\":\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" =\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"80\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" >\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" So\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Must\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"9\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"8\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"994c977e-e442-4a5f-bde6-13ef09f6c375\",\"object\":\"chat.completion.chunk\",\"created\":1790316729,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":51,\"completion_tokens\":53,\"total_tokens\":104,\"prompt_tokens_details\":{\"cached_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":49},\"prompt_cache_hit_tokens\":0,\"prompt_cache_miss_tokens\":51}}", + "data: [DONE]" + ], + "kind": "sse" + }, + "headers": { + "access-control-allow-credentials": "true", + "cache-control": "no-cache", + "content-type": "text/event-stream; charset=utf-8", + "date": "Fri, 25 Sep 2026 06:12:09 GMT", + "server": "elb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "vary": "origin, access-control-request-method, access-control-request-headers", + "via": "1.1 230a4cabf962361d7a66119623a370ee.cloudfront.net (CloudFront)", + "x-amz-cf-id": "aOPAgAFm2B4IFyadrPUDK9N1SCEHgtjtpxZbRZKErj_cCq8wuI5fFw==", + "x-amz-cf-pop": "SFO53-P10", + "x-cache": "Miss from cloudfront", + "x-content-type-options": "nosniff", + "x-ds-trace-id": "7c534367f4ebddf435f1a91380e87b7b" + }, + "status": 200 + } } ], "meta": { diff --git a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6.cassette.json b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6.cassette.json index f858ba2ba..8431aceea 100644 --- a/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6.cassette.json +++ b/e2e/scenarios/openai-instrumentation/__cassettes__/openai-v6.cassette.json @@ -2807,6 +2807,106 @@ "status": 200, "statusText": "OK" } + }, + { + "callIndex": 0, + "id": "631c45d386f59296", + "matchKey": "POST api.deepseek.com/v1/chat/completions", + "recordedAt": "2026-09-25T06:12:07.000Z", + "request": { + "body": { + "kind": "json", + "value": { + "max_tokens": 2048, + "messages": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "model": "deepseek-flash", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.deepseek.com/v1/chat/completions" + }, + "response": { + "body": { + "chunks": [ + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"reasoning_content\":\"\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"We\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Compare\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" vs\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"8\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" =\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"80\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" >\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" \"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"9\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\"11\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" Need\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" answer\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" only\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" greater\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\" number\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":null,\"reasoning_content\":\".\"},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"9\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\".\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"8\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":null}],\"usage\":null}", + "data: {\"id\":\"1dd773d2-e371-4512-b864-65836766a74a\",\"object\":\"chat.completion.chunk\",\"created\":1790316725,\"model\":\"deepseek-flash\",\"system_fingerprint\":\"aeb56401ca74e127821c4f9126dcb669\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"\",\"reasoning_content\":null},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":51,\"completion_tokens\":43,\"total_tokens\":94,\"prompt_tokens_details\":{\"cached_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":39},\"prompt_cache_hit_tokens\":0,\"prompt_cache_miss_tokens\":51}}", + "data: [DONE]" + ], + "kind": "sse" + }, + "headers": { + "access-control-allow-credentials": "true", + "cache-control": "no-cache", + "content-type": "text/event-stream; charset=utf-8", + "date": "Fri, 25 Sep 2026 06:12:06 GMT", + "server": "elb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "vary": "origin, access-control-request-method, access-control-request-headers", + "via": "1.1 230a4cabf962361d7a66119623a370ee.cloudfront.net (CloudFront)", + "x-amz-cf-id": "piauLlLe7ZVysvk_9ldwbFRCBxgg54LgtR0lD-lgWi29D4b3kbVq7Q==", + "x-amz-cf-pop": "SFO53-P10", + "x-cache": "Miss from cloudfront", + "x-content-type-options": "nosniff", + "x-ds-trace-id": "3a583873b02ba7c9e16384c1371f41f1" + }, + "status": 200 + } } ], "meta": { diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json index c331ce776..16261ec8b 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 40, + "completion_tokens": 44, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 95 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", + "reasoningChunks": 40, + "usage": { + "completion_tokens": 44, + "completion_tokens_details": { + "reasoning_tokens": 40 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 95 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt index 4e8bcd55b..13aa50424 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-auto-hook.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", +│ │ "reasoningChunks": 40, +│ │ "usage": { +│ │ "completion_tokens": 44, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 40 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 95 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 40, +│ │ "completion_tokens": 44, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 95 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json index 136d67580..9d9a8160a 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 42, + "completion_tokens": 46, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 97 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", + "reasoningChunks": 42, + "usage": { + "completion_tokens": 46, + "completion_tokens_details": { + "reasoning_tokens": 42 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 97 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt index f4a82aadd..0f771e6c4 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-auto-hook.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", +│ │ "reasoningChunks": 42, +│ │ "usage": { +│ │ "completion_tokens": 46, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 42 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 97 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 42, +│ │ "completion_tokens": 46, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 97 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json index 65cc406d3..bff9fa7db 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 42, + "completion_tokens": 46, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 97 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", + "reasoningChunks": 42, + "usage": { + "completion_tokens": 46, + "completion_tokens_details": { + "reasoning_tokens": 42 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 97 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt index 3cb8c33e6..bc646c33f 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-latest-wrapped.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", +│ │ "reasoningChunks": 42, +│ │ "usage": { +│ │ "completion_tokens": 46, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 42 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 97 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. 9.8 = 9.80, greater than 9.11. Must answer greater number only.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 42, +│ │ "completion_tokens": 46, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 97 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json index a6f62cd0c..361af4d20 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 40, + "completion_tokens": 44, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 95 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", + "reasoningChunks": 40, + "usage": { + "completion_tokens": 44, + "completion_tokens_details": { + "reasoning_tokens": 40 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 95 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt index d8a544545..c2adc9695 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v4-wrapped.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", +│ │ "reasoningChunks": 40, +│ │ "usage": { +│ │ "completion_tokens": 44, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 40 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 95 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Must answer with greater number only.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 40, +│ │ "completion_tokens": 44, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 95 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json index 1982b0dfc..41e4171d7 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 44, + "completion_tokens": 48, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 99 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", + "reasoningChunks": 44, + "usage": { + "completion_tokens": 48, + "completion_tokens_details": { + "reasoning_tokens": 44 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 99 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt index 113f537a3..c3b8c4bec 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-auto-hook.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", +│ │ "reasoningChunks": 44, +│ │ "usage": { +│ │ "completion_tokens": 48, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 44 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 99 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 44, +│ │ "completion_tokens": 48, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 99 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json index 4469bead6..20fc827d2 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 39, + "completion_tokens": 43, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 94 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", + "reasoningChunks": 39, + "usage": { + "completion_tokens": 43, + "completion_tokens_details": { + "reasoning_tokens": 39 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 94 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt index 8d4e83126..3f2e33a34 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-auto-hook.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", +│ │ "reasoningChunks": 39, +│ │ "usage": { +│ │ "completion_tokens": 43, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 39 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 94 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 39, +│ │ "completion_tokens": 43, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 94 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json index 101e694f8..51b36311b 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 39, + "completion_tokens": 43, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 94 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", + "reasoningChunks": 39, + "usage": { + "completion_tokens": 43, + "completion_tokens_details": { + "reasoning_tokens": 39 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 94 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt index 711b3ee8e..1d5c8fb49 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-latest-wrapped.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", +│ │ "reasoningChunks": 39, +│ │ "usage": { +│ │ "completion_tokens": 43, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 39 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 94 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 39, +│ │ "completion_tokens": 43, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 94 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json index bae06f5b9..57a0a6eee 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.json @@ -267,6 +267,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 44, + "completion_tokens": 48, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 99 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", + "reasoningChunks": 44, + "usage": { + "completion_tokens": 48, + "completion_tokens_details": { + "reasoning_tokens": 44 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 99 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt index 5a7174357..a5a4b2163 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v5-wrapped.span-tree.txt @@ -241,6 +241,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", +│ │ "reasoningChunks": 44, +│ │ "usage": { +│ │ "completion_tokens": 48, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 44 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 99 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Answer 9.8. Need only greater number.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 44, +│ │ "completion_tokens": 48, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 99 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json index b3aacaeef..3b478a0bf 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.json @@ -412,6 +412,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 39, + "completion_tokens": 43, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 94 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", + "reasoningChunks": 39, + "usage": { + "completion_tokens": 43, + "completion_tokens_details": { + "reasoning_tokens": 39 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 94 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt index f20e969cf..08ad6ad52 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-auto-hook.span-tree.txt @@ -370,6 +370,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", +│ │ "reasoningChunks": 39, +│ │ "usage": { +│ │ "completion_tokens": 43, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 39 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 94 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 39, +│ │ "completion_tokens": 43, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 94 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json index 8db316174..8df337673 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.json @@ -412,6 +412,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 49, + "completion_tokens": 53, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 104 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", + "reasoningChunks": 49, + "usage": { + "completion_tokens": 53, + "completion_tokens_details": { + "reasoning_tokens": 49 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 104 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt index 6da16735d..69428eb2f 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-auto-hook.span-tree.txt @@ -370,6 +370,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", +│ │ "reasoningChunks": 49, +│ │ "usage": { +│ │ "completion_tokens": 53, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 49 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 104 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 49, +│ │ "completion_tokens": 53, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 104 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json index 956f4755b..f0cbfe07f 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.json @@ -412,6 +412,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 49, + "completion_tokens": 53, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 104 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", + "reasoningChunks": 49, + "usage": { + "completion_tokens": 53, + "completion_tokens_details": { + "reasoning_tokens": 49 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 104 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt index 6f8a0cedc..166b06d0c 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-latest-wrapped.span-tree.txt @@ -370,6 +370,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", +│ │ "reasoningChunks": 49, +│ │ "usage": { +│ │ "completion_tokens": 53, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 49 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 104 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Need compare 9.11 vs 9.8. As decimals: 9.8 = 9.80 > 9.11. So answer 9.8. Must only greater number.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 49, +│ │ "completion_tokens": 53, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 104 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json index 1abf0933b..0fa917bbf 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.json @@ -412,6 +412,84 @@ "caller_lineno": 0 } }, + { + "name": "openai-stream-reasoning-operation", + "children": [ + { + "name": "Chat Completion", + "type": "llm", + "children": [], + "input": [ + { + "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + "role": "user" + } + ], + "output": [ + { + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "content": "9.8", + "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", + "role": "assistant" + } + } + ], + "metadata": { + "max_tokens": 2048, + "model": "deepseek-flash", + "provider": "openai", + "reasoning_effort": "low", + "stream": true, + "stream_options": { + "include_usage": true + }, + "thinking": { + "type": "enabled" + } + }, + "metrics": { + "completion_reasoning_tokens": 39, + "completion_tokens": 43, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_cached_tokens": 0, + "prompt_tokens": 51, + "time_to_first_token": 0, + "tokens": 94 + } + } + ], + "output": { + "content": "9.8", + "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", + "reasoningChunks": 39, + "usage": { + "completion_tokens": 43, + "completion_tokens_details": { + "reasoning_tokens": 39 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 51, + "prompt_tokens": 51, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "total_tokens": 94 + } + }, + "metadata": { + "operation": "stream-reasoning", + "testRunId": "" + }, + "context": { + "caller_filename": "/e2e/helpers/provider-runtime.mjs", + "caller_functionname": "runOperation", + "caller_lineno": 0 + } + }, { "name": "openai-stream-audio-operation", "children": [ diff --git a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt index 42f1186ed..1fb7107b2 100644 --- a/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt +++ b/e2e/scenarios/openai-instrumentation/__snapshots__/openai-v6-wrapped.span-tree.txt @@ -370,6 +370,76 @@ span_tree: │ │ "time_to_first_token": 0, │ │ "tokens": 13 │ │ } +│ ├── openai-stream-reasoning-operation +│ │ output: { +│ │ "content": "9.8", +│ │ "reasoning": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", +│ │ "reasoningChunks": 39, +│ │ "usage": { +│ │ "completion_tokens": 43, +│ │ "completion_tokens_details": { +│ │ "reasoning_tokens": 39 +│ │ }, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_tokens": 51, +│ │ "prompt_tokens_details": { +│ │ "cached_tokens": 0 +│ │ }, +│ │ "total_tokens": 94 +│ │ } +│ │ } +│ │ metadata: { +│ │ "operation": "stream-reasoning", +│ │ "testRunId": "" +│ │ } +│ │ context: { +│ │ "caller_filename": "/e2e/helpers/provider-runtime.mjs", +│ │ "caller_functionname": "runOperation", +│ │ "caller_lineno": 0 +│ │ } +│ │ └── Chat Completion [llm] +│ │ input: [ +│ │ { +│ │ "content": "Which is greater, 9.11 or 9.8? Answer with the greater number only.", +│ │ "role": "user" +│ │ } +│ │ ] +│ │ output: [ +│ │ { +│ │ "finish_reason": "stop", +│ │ "index": 0, +│ │ "logprobs": null, +│ │ "message": { +│ │ "content": "9.8", +│ │ "reasoning_content": "We need answer only greater number. Compare 9.11 vs 9.8. 9.8 = 9.80 > 9.11. Need answer only greater number.", +│ │ "role": "assistant" +│ │ } +│ │ } +│ │ ] +│ │ metadata: { +│ │ "max_tokens": 2048, +│ │ "model": "deepseek-flash", +│ │ "provider": "openai", +│ │ "reasoning_effort": "low", +│ │ "stream": true, +│ │ "stream_options": { +│ │ "include_usage": true +│ │ }, +│ │ "thinking": { +│ │ "type": "enabled" +│ │ } +│ │ } +│ │ metrics: { +│ │ "completion_reasoning_tokens": 39, +│ │ "completion_tokens": 43, +│ │ "prompt_cache_hit_tokens": 0, +│ │ "prompt_cache_miss_tokens": 51, +│ │ "prompt_cached_tokens": 0, +│ │ "prompt_tokens": 51, +│ │ "time_to_first_token": 0, +│ │ "tokens": 94 +│ │ } │ ├── openai-stream-audio-operation │ │ metadata: { │ │ "operation": "stream-audio", diff --git a/e2e/scenarios/openai-instrumentation/assertions.ts b/e2e/scenarios/openai-instrumentation/assertions.ts index 1f062fbb9..e160792f3 100644 --- a/e2e/scenarios/openai-instrumentation/assertions.ts +++ b/e2e/scenarios/openai-instrumentation/assertions.ts @@ -58,7 +58,10 @@ type OperationSpec = { operation: string; requiresResponsesCompact?: boolean; testName: string; - validate?: (span: CapturedLogEvent | undefined) => void; + validate?: ( + span: CapturedLogEvent | undefined, + operation: CapturedLogEvent | undefined, + ) => void; validateNested?: (spans: CapturedLogEvent[]) => void; }; @@ -291,6 +294,46 @@ const OPERATION_SPECS: readonly OperationSpec[] = [ testName: "captures trace for client.chat.completions.create({ stream: true })", }, + { + childNames: ["Chat Completion"], + expectsOutput: true, + expectsTimeToFirstToken: true, + name: "openai-stream-reasoning-operation", + operation: "stream-reasoning", + testName: + "preserves DeepSeek streamed reasoning separately from the answer", + validate: (span, operation) => { + const received = operation?.output as { + reasoning: string; + content: string; + reasoningChunks: number; + usage: { + prompt_tokens: number; + completion_tokens: number; + total_tokens: number; + }; + }; + expect(received.reasoningChunks).toBeGreaterThan(1); + expect(received.content.trim()).toBe("9.8"); + expect(span?.output).toMatchObject([ + { + index: 0, + finish_reason: "stop", + message: { role: "assistant", content: received.content }, + }, + ]); + expect(span?.output).toMatchObject([ + { + message: { reasoning_content: received.reasoning }, + }, + ]); + expect(span?.metrics).toMatchObject({ + prompt_tokens: received.usage.prompt_tokens, + completion_tokens: received.usage.completion_tokens, + tokens: received.usage.total_tokens, + }); + }, + }, { childNames: ["Chat Completion"], expectsOutput: true, @@ -1166,7 +1209,7 @@ export function defineOpenAIInstrumentationAssertions(options: { spec.validateNested?.(nested); } - spec.validate?.(span); + spec.validate?.(span, operation); }); } diff --git a/e2e/scenarios/openai-instrumentation/scenario.impl.mjs b/e2e/scenarios/openai-instrumentation/scenario.impl.mjs index 3d4865f21..d90b7119c 100644 --- a/e2e/scenarios/openai-instrumentation/scenario.impl.mjs +++ b/e2e/scenarios/openai-instrumentation/scenario.impl.mjs @@ -9,6 +9,7 @@ import { } from "../../helpers/provider-runtime.mjs"; import { completeOpenAIBatchTrace, + currentSpan, openaiBatchesRetrieveTraced, openaiFilesCreateTraced, } from "braintrust"; @@ -693,6 +694,57 @@ export async function runOpenAIInstrumentationScenario(options) { await collectAsync(chatStream); }); + await runOperation( + "openai-stream-reasoning-operation", + "stream-reasoning", + async () => { + const baseReasoningClient = new options.OpenAI({ + apiKey: process.env.DEEPSEEK_API_KEY, + baseURL: process.env.DEEPSEEK_BASE_URL, + maxRetries: 0, + }); + const reasoningClient = options.decorateClient + ? options.decorateClient(baseReasoningClient) + : baseReasoningClient; + // Genuine DeepSeek recordings from PR #2522 (commit 43100efd0f2ee4fffe44b4e9a711aa6f66c71b0f). + // Reproduce #2511 with the plain OpenAI client pointed at a custom baseURL. + const stream = await reasoningClient.chat.completions.create({ + model: "deepseek-flash", + messages: [ + { + role: "user", + content: + "Which is greater, 9.11 or 9.8? Answer with the greater number only.", + }, + ], + thinking: { type: "enabled" }, + reasoning_effort: "low", + max_tokens: 2048, + stream: true, + stream_options: { include_usage: true }, + }); + const reasoning = []; + const content = []; + let usage; + for await (const chunk of stream) { + const delta = chunk.choices[0]?.delta; + if (delta?.reasoning_content) + reasoning.push(delta.reasoning_content); + if (delta?.content) content.push(delta.content); + if (chunk.usage) usage = chunk.usage; + } + // Keep the application's result independent of the instrumentation's aggregation. + currentSpan().log({ + output: { + reasoning: reasoning.join(""), + content: content.join(""), + reasoningChunks: reasoning.length, + usage, + }, + }); + }, + ); + await runOperation( "openai-stream-audio-operation", "stream-audio", diff --git a/e2e/scripts/bump-e2e-versions.mjs b/e2e/scripts/bump-e2e-versions.mjs index d7ed675a1..069c1981f 100644 --- a/e2e/scripts/bump-e2e-versions.mjs +++ b/e2e/scripts/bump-e2e-versions.mjs @@ -22,6 +22,7 @@ const INSTALL_SECRET_ENV_VARS = [ "COHERE_API_KEY", "ELEVENLABS_API_KEY", "CURSOR_API_KEY", + "DEEPSEEK_API_KEY", "GEMINI_API_KEY", "GH_TOKEN", "GITHUB_TOKEN", diff --git a/e2e/scripts/run-e2e-bump-docker.mjs b/e2e/scripts/run-e2e-bump-docker.mjs index 93b547b3d..84bcbabd5 100644 --- a/e2e/scripts/run-e2e-bump-docker.mjs +++ b/e2e/scripts/run-e2e-bump-docker.mjs @@ -38,6 +38,7 @@ const ALLOWED_ENV_KEYS = [ "COHERE_BASE_URL", "CURSOR_API_KEY", "CURSOR_BACKEND_URL", + "DEEPSEEK_API_KEY", "GEMINI_API_KEY", "GEMINI_BASE_URL", "GEMINI_NEXT_GEN_API_BASE_URL", diff --git a/js/src/instrumentation/plugins/openai-plugin.test.ts b/js/src/instrumentation/plugins/openai-plugin.test.ts index ddcb66e7d..127d102de 100644 --- a/js/src/instrumentation/plugins/openai-plugin.test.ts +++ b/js/src/instrumentation/plugins/openai-plugin.test.ts @@ -300,6 +300,108 @@ describe("parseMetricsFromUsage", () => { }); describe("aggregateChatCompletionChunks", () => { + describe("reasoning_content", () => { + it("concatenates reasoning separately from content for each choice", () => { + const chunks = [ + { + choices: [ + { + index: 1, + delta: { role: "assistant", reasoning_content: "Let " }, + }, + { + index: 0, + delta: { role: "assistant", reasoning_content: "Think " }, + }, + ], + }, + { + choices: [ + { index: 0, delta: { reasoning_content: "first.", content: "An" } }, + { + index: 1, + delta: { reasoning_content: "me think.", content: "Other" }, + }, + ], + }, + { + choices: [ + { + index: 1, + delta: { reasoning_content: null }, + finish_reason: "length", + }, + { index: 0, delta: { content: "swer" }, finish_reason: "stop" }, + ], + }, + { + choices: [], + usage: { prompt_tokens: 2, completion_tokens: 8, total_tokens: 10 }, + }, + ]; + const originalChunks = structuredClone(chunks); + + expect(aggregateChatCompletionChunks(chunks)).toEqual({ + output: [ + { + index: 0, + message: { + role: "assistant", + content: "Answer", + reasoning_content: "Think first.", + }, + logprobs: null, + finish_reason: "stop", + }, + { + index: 1, + message: { + role: "assistant", + content: "Other", + reasoning_content: "Let me think.", + }, + logprobs: null, + finish_reason: "length", + }, + ], + metrics: { prompt_tokens: 2, completion_tokens: 8, tokens: 10 }, + }); + expect(chunks).toEqual(originalChunks); + }); + + it.each([ + { fragments: [undefined, undefined], expected: undefined }, + { fragments: [null, undefined, null], expected: null }, + { fragments: ["", undefined, ""], expected: "" }, + { fragments: [null, "", null], expected: "" }, + { + fragments: [null, "Think", undefined, null, "", " more", null], + expected: "Think more", + }, + ])( + "preserves reasoning fragments $fragments as $expected", + ({ fragments, expected }) => { + const chunks = fragments.map((reasoning_content) => ({ + choices: [ + { + index: 0, + delta: + reasoning_content === undefined ? {} : { reasoning_content }, + }, + ], + })); + const { message } = aggregateChatCompletionChunks(chunks).output[0]; + + if (expected === undefined) { + expect(message).not.toHaveProperty("reasoning_content"); + } else { + expect(message).toHaveProperty("reasoning_content", expected); + } + expect(message.content).toBeUndefined(); + }, + ); + }); + describe("basic aggregation", () => { it("should aggregate simple text chunks", () => { const chunks = [ diff --git a/js/src/instrumentation/plugins/openai-plugin.ts b/js/src/instrumentation/plugins/openai-plugin.ts index dc0886c50..f36df9ed3 100644 --- a/js/src/instrumentation/plugins/openai-plugin.ts +++ b/js/src/instrumentation/plugins/openai-plugin.ts @@ -409,6 +409,7 @@ type AggregatedChatChoice = { index: number; role: string | undefined; content: string | undefined; + reasoning_content: string | null | undefined; refusal: string | undefined; audio: NonNullable | undefined; toolCallsByIndex: Map< @@ -424,6 +425,7 @@ function createAggregatedChatChoice(index: number): AggregatedChatChoice { index, role: undefined, content: undefined, + reasoning_content: undefined, refusal: undefined, audio: undefined, toolCallsByIndex: new Map(), @@ -442,6 +444,9 @@ function toChatChoice(choice: AggregatedChatChoice): OpenAIChatChoice { message: { role: choice.role, content: choice.content, + ...(choice.reasoning_content !== undefined + ? { reasoning_content: choice.reasoning_content } + : {}), ...(choice.refusal !== undefined ? { refusal: choice.refusal } : {}), ...(choice.audio !== undefined ? { audio: choice.audio } : {}), tool_calls: toolCalls.length > 0 ? toolCalls : undefined, @@ -453,7 +458,7 @@ function toChatChoice(choice: AggregatedChatChoice): OpenAIChatChoice { /** * Aggregate chat completion chunks into a single response. - * Combines role (first), content and audio transcripts (concatenated), + * Combines role (first), content, reasoning_content and audio transcripts (concatenated), * tool_calls (by index), finish_reason (last), and usage (last chunk). */ export function aggregateChatCompletionChunks( @@ -515,6 +520,14 @@ export function aggregateChatCompletionChunks( (aggregatedChoice.content || "") + delta.content; } + if (typeof delta.reasoning_content === "string") { + aggregatedChoice.reasoning_content = + (aggregatedChoice.reasoning_content ?? "") + delta.reasoning_content; + } else if (delta.reasoning_content === null) { + // Retain explicit nulls, but never discard text from earlier chunks. + aggregatedChoice.reasoning_content ??= null; + } + if (delta.refusal) { aggregatedChoice.refusal = (aggregatedChoice.refusal || "") + delta.refusal; diff --git a/js/src/vendor-sdk-types/openai-common.ts b/js/src/vendor-sdk-types/openai-common.ts index 6b7f1ef54..15cb745fb 100644 --- a/js/src/vendor-sdk-types/openai-common.ts +++ b/js/src/vendor-sdk-types/openai-common.ts @@ -98,6 +98,7 @@ interface OpenAIChatAudio { export interface OpenAIChatMessage { role?: string; content?: unknown; + reasoning_content?: string | null; refusal?: string; audio?: OpenAIChatAudio | null; tool_calls?: OpenAIChatToolCall[]; @@ -135,6 +136,7 @@ export interface OpenAIChatCompletion { interface OpenAIChatDelta { role?: string; content?: string; + reasoning_content?: string | null; refusal?: string; audio?: OpenAIChatAudio | null; tool_calls?: OpenAIChatToolCallDelta[];