diff --git a/deploy/package.json b/deploy/package.json index d34c95c..957f269 100644 --- a/deploy/package.json +++ b/deploy/package.json @@ -19,7 +19,7 @@ "@pydantic/logfire-cf-workers": "^0.9.0" }, "devDependencies": { - "openai": "^4.70.3", + "openai": "^6.6.0", "wrangler": "^4.27.0" } } diff --git a/gateway/package.json b/gateway/package.json index afccf26..7b838ab 100644 --- a/gateway/package.json +++ b/gateway/package.json @@ -21,6 +21,6 @@ "@google/genai": "^1.15.0", "@types/mime-types": "^3.0.1", "groq-sdk": "^0.30.0", - "openai": "^4.104.0" + "openai": "^6.6.0" } } diff --git a/gateway/src/api/chat.ts b/gateway/src/api/chat.ts index 9ca0ee0..0bf74be 100644 --- a/gateway/src/api/chat.ts +++ b/gateway/src/api/chat.ts @@ -89,12 +89,22 @@ function mapOutputParts(message: ChatCompletion.Choice['message']): MessagePart[ parts.push({ type: 'text', content: message.content }) } else if (message.tool_calls) { for (const toolCall of message.tool_calls) { - parts.push({ - type: 'tool_call', - id: toolCall.id, - name: toolCall.function.name, - arguments: toolCall.function.arguments, - }) + if (toolCall.type === 'function') { + parts.push({ + type: 'tool_call', + id: toolCall.id, + name: toolCall.function.name, + arguments: toolCall.function.arguments, + }) + } else { + // https://platform.openai.com/docs/guides/function-calling#custom-tools + parts.push({ + type: 'tool_call', + id: toolCall.id, + name: toolCall.custom.name, + arguments: toolCall.custom.input, + }) + } } } else { logfire.warning('unexpected message content', { message }) diff --git a/gateway/test/gateway.spec.ts.snap b/gateway/test/gateway.spec.ts.snap index d86a07b..3dd7c51 100644 --- a/gateway/test/gateway.spec.ts.snap +++ b/gateway/test/gateway.spec.ts.snap @@ -14,18 +14,18 @@ exports[`custom proxyPrefixLength > inference > proxyPrefixLength 1`] = ` }, }, ], - "created": 1758119097, - "id": "chatcmpl-CGnNZyR6FU8Xsw5X4N2YdTtaYBuWV", + "created": 1761137036, + "id": "chatcmpl-CTSU0dW3oVCau0NVeg6fCWcUUQj2a", "model": "gpt-5-2025-08-07", "object": "chat.completion", "service_tier": "default", "system_fingerprint": null, "usage": { - "completion_tokens": 11, + "completion_tokens": 75, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, - "reasoning_tokens": 0, + "reasoning_tokens": 64, "rejected_prediction_tokens": 0, }, "prompt_tokens": 23, @@ -34,9 +34,9 @@ exports[`custom proxyPrefixLength > inference > proxyPrefixLength 1`] = ` "cached_tokens": 0, }, "pydantic_ai_gateway": { - "cost_estimate": 0.00013875, + "cost_estimate": 0.00077875, }, - "total_tokens": 34, + "total_tokens": 98, }, } `; diff --git a/gateway/test/providers/openai.spec.ts b/gateway/test/providers/openai.spec.ts index ca94de3..a668a07 100644 --- a/gateway/test/providers/openai.spec.ts +++ b/gateway/test/providers/openai.spec.ts @@ -27,16 +27,16 @@ describe('openai', () => { const limitDb = new LimitDbD1(env.limitsDB) const projectStatus = await limitDb.spendStatus('project') expect(projectStatus).toEqual([ - { entityId: IDS.projectDefault, limit: 4, scope: 'monthly', scopeInterval: expect.any(Date), spend: 0.00013875 }, + { entityId: IDS.projectDefault, limit: 4, scope: 'monthly', scopeInterval: expect.any(Date), spend: 0.00077875 }, ]) const userStatus = await limitDb.spendStatus('user') expect(userStatus).toEqual([ - { entityId: IDS.userDefault, limit: 3, scope: 'weekly', scopeInterval: expect.any(Date), spend: 0.00013875 }, + { entityId: IDS.userDefault, limit: 3, scope: 'weekly', scopeInterval: expect.any(Date), spend: 0.00077875 }, ]) const keyStatus = await limitDb.spendStatus('key') expect(keyStatus.sort((a, b) => a.limit - b.limit)).toEqual([ - { entityId: IDS.keyHealthy, limit: 1, scope: 'daily', scopeInterval: expect.any(Date), spend: 0.00013875 }, - { entityId: IDS.keyHealthy, limit: 2, scope: 'total', scopeInterval: null, spend: 0.00013875 }, + { entityId: IDS.keyHealthy, limit: 1, scope: 'daily', scopeInterval: expect.any(Date), spend: 0.00077875 }, + { entityId: IDS.keyHealthy, limit: 2, scope: 'total', scopeInterval: null, spend: 0.00077875 }, ]) }) @@ -69,18 +69,18 @@ describe('openai', () => { expect(completion).toMatchSnapshot('llm') expect(completion.usage).toMatchInlineSnapshot(` { - "input_tokens": 1315, + "input_tokens": 2003, "input_tokens_details": { "cached_tokens": 0, }, - "output_tokens": 799, + "output_tokens": 1436, "output_tokens_details": { - "reasoning_tokens": 768, + "reasoning_tokens": 1408, }, "pydantic_ai_gateway": { - "cost_estimate": 0.00963375, + "cost_estimate": 0.01686375, }, - "total_tokens": 2114, + "total_tokens": 3439, } `) expect(otelBatch, 'otelBatch length not 1').toHaveLength(1) diff --git a/gateway/test/providers/openai.spec.ts.snap b/gateway/test/providers/openai.spec.ts.snap index 018069f..c08a924 100644 --- a/gateway/test/providers/openai.spec.ts.snap +++ b/gateway/test/providers/openai.spec.ts.snap @@ -14,18 +14,18 @@ exports[`openai > openai chat > llm 1`] = ` }, }, ], - "created": 1758119097, - "id": "chatcmpl-CGnNZyR6FU8Xsw5X4N2YdTtaYBuWV", + "created": 1761137036, + "id": "chatcmpl-CTSU0dW3oVCau0NVeg6fCWcUUQj2a", "model": "gpt-5-2025-08-07", "object": "chat.completion", "service_tier": "default", "system_fingerprint": null, "usage": { - "completion_tokens": 11, + "completion_tokens": 75, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, - "reasoning_tokens": 0, + "reasoning_tokens": 64, "rejected_prediction_tokens": 0, }, "prompt_tokens": 23, @@ -34,9 +34,9 @@ exports[`openai > openai chat > llm 1`] = ` "cached_tokens": 0, }, "pydantic_ai_gateway": { - "cost_estimate": 0.00013875, + "cost_estimate": 0.00077875, }, - "total_tokens": 34, + "total_tokens": 98, }, } `; @@ -120,7 +120,7 @@ exports[`openai > openai chat > span 1`] = ` { "key": "gen_ai.response.id", "value": { - "stringValue": "chatcmpl-CGnNZyR6FU8Xsw5X4N2YdTtaYBuWV", + "stringValue": "chatcmpl-CTSU0dW3oVCau0NVeg6fCWcUUQj2a", }, }, { @@ -277,26 +277,13 @@ exports[`openai > openai chat > span 1`] = ` { "key": "http.request.body.text", "value": { - "stringValue": "{ - "model": "gpt-5", - "messages": [ - { - "role": "developer", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "What is the capital of France?" - } - ], - "max_completion_tokens": 1024 -}", + "stringValue": "{"model":"gpt-5","messages":[{"role":"developer","content":"You are a helpful assistant."},{"role":"user","content":"What is the capital of France?"}],"max_completion_tokens":1024}", }, }, { "key": "http.response.body.text", "value": { - "stringValue": "{"id":"chatcmpl-CGnNZyR6FU8Xsw5X4N2YdTtaYBuWV","object":"chat.completion","created":1758119097,"model":"gpt-5-2025-08-07","choices":[{"index":0,"message":{"role":"assistant","content":"Paris.","refusal":null,"annotations":[]},"finish_reason":"stop"}],"usage":{"prompt_tokens":23,"completion_tokens":11,"total_tokens":34,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"pydantic_ai_gateway":{"cost_estimate":0.00013875}},"service_tier":"default","system_fingerprint":null}", + "stringValue": "{"id":"chatcmpl-CTSU0dW3oVCau0NVeg6fCWcUUQj2a","object":"chat.completion","created":1761137036,"model":"gpt-5-2025-08-07","choices":[{"index":0,"message":{"role":"assistant","content":"Paris.","refusal":null,"annotations":[]},"finish_reason":"stop"}],"usage":{"prompt_tokens":23,"completion_tokens":75,"total_tokens":98,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0},"pydantic_ai_gateway":{"cost_estimate":0.00077875}},"service_tier":"default","system_fingerprint":null}", }, }, { @@ -324,7 +311,7 @@ exports[`openai > openai chat > span 1`] = ` { "key": "gen_ai.usage.output_tokens", "value": { - "intValue": 11, + "intValue": 75, }, }, { @@ -352,9 +339,9 @@ exports[`openai > openai responses > llm 1`] = ` "billing": { "payer": "developer", }, - "created_at": 1760710235, + "created_at": 1761137039, "error": null, - "id": "resp_09a44ce9e90671e50068f24e5bb64c81929ad39ba693aa7353", + "id": "resp_0533f4a927d05e0f0068f8d18f47448190857248a91b82b094", "incomplete_details": null, "instructions": "reply concisely", "max_output_tokens": null, @@ -364,7 +351,7 @@ exports[`openai > openai responses > llm 1`] = ` "object": "response", "output": [ { - "id": "rs_09a44ce9e90671e50068f24e5c4e188192bc9efb89f5dded5d", + "id": "rs_0533f4a927d05e0f0068f8d19076fc81908688f1b9f20b3ab4", "summary": [], "type": "reasoning", }, @@ -373,17 +360,17 @@ exports[`openai > openai responses > llm 1`] = ` { "annotations": [], "logprobs": [], - "text": "Usually blue (daytime), but it varies—red/orange at sunrise/sunset, gray when cloudy, black at night.", + "text": "Usually blue in daylight; it can turn red/orange at sunrise or sunset, gray when cloudy, and black at night.", "type": "output_text", }, ], - "id": "msg_09a44ce9e90671e50068f24e5f72908192b4a75475d74255dc", + "id": "msg_0533f4a927d05e0f0068f8d1957aa481909f1f206a4b132609", "role": "assistant", "status": "completed", "type": "message", }, ], - "output_text": "Usually blue (daytime), but it varies—red/orange at sunrise/sunset, gray when cloudy, black at night.", + "output_text": "Usually blue in daylight; it can turn red/orange at sunrise or sunset, gray when cloudy, and black at night.", "parallel_tool_calls": true, "previous_response_id": null, "prompt_cache_key": null, @@ -412,14 +399,14 @@ exports[`openai > openai responses > llm 1`] = ` "input_tokens_details": { "cached_tokens": 0, }, - "output_tokens": 224, + "output_tokens": 223, "output_tokens_details": { "reasoning_tokens": 192, }, "pydantic_ai_gateway": { - "cost_estimate": 0.0022649999999999997, + "cost_estimate": 0.002255, }, - "total_tokens": 244, + "total_tokens": 243, }, "user": null, } @@ -516,17 +503,13 @@ exports[`openai > openai responses > span 1`] = ` { "key": "http.request.body.text", "value": { - "stringValue": "{ - "model": "gpt-5", - "instructions": "reply concisely", - "input": "what color is the sky?" -}", + "stringValue": "{"model":"gpt-5","instructions":"reply concisely","input":"what color is the sky?"}", }, }, { "key": "http.response.body.text", "value": { - "stringValue": "{"id":"resp_09a44ce9e90671e50068f24e5bb64c81929ad39ba693aa7353","object":"response","created_at":1760710235,"status":"completed","background":false,"billing":{"payer":"developer"},"error":null,"incomplete_details":null,"instructions":"reply concisely","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_09a44ce9e90671e50068f24e5c4e188192bc9efb89f5dded5d","type":"reasoning","summary":[]},{"id":"msg_09a44ce9e90671e50068f24e5f72908192b4a75475d74255dc","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Usually blue (daytime), but it varies—red/orange at sunrise/sunset, gray when cloudy, black at night."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":20,"input_tokens_details":{"cached_tokens":0},"output_tokens":224,"output_tokens_details":{"reasoning_tokens":192},"total_tokens":244,"pydantic_ai_gateway":{"cost_estimate":0.0022649999999999997}},"user":null,"metadata":{}}", + "stringValue": "{"id":"resp_0533f4a927d05e0f0068f8d18f47448190857248a91b82b094","object":"response","created_at":1761137039,"status":"completed","background":false,"billing":{"payer":"developer"},"error":null,"incomplete_details":null,"instructions":"reply concisely","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_0533f4a927d05e0f0068f8d19076fc81908688f1b9f20b3ab4","type":"reasoning","summary":[]},{"id":"msg_0533f4a927d05e0f0068f8d1957aa481909f1f206a4b132609","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Usually blue in daylight; it can turn red/orange at sunrise or sunset, gray when cloudy, and black at night."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":20,"input_tokens_details":{"cached_tokens":0},"output_tokens":223,"output_tokens_details":{"reasoning_tokens":192},"total_tokens":243,"pydantic_ai_gateway":{"cost_estimate":0.002255}},"user":null,"metadata":{}}", }, }, { @@ -554,7 +537,7 @@ exports[`openai > openai responses > span 1`] = ` { "key": "gen_ai.usage.output_tokens", "value": { - "intValue": 224, + "intValue": 223, }, }, { @@ -578,9 +561,9 @@ exports[`openai > openai responses with builtin tools > llm 1`] = ` "billing": { "payer": "developer", }, - "created_at": 1760710281, + "created_at": 1761137046, "error": null, - "id": "resp_0f2450162f078cbb0068f24e8955748191affcd350ce641443", + "id": "resp_0b4101be339436580068f8d196baf4819c9dc0a0d1b4a689d3", "incomplete_details": null, "instructions": "be precise", "max_output_tokens": null, @@ -590,53 +573,38 @@ exports[`openai > openai responses with builtin tools > llm 1`] = ` "object": "response", "output": [ { - "id": "rs_0f2450162f078cbb0068f24e8d85f4819197c895fdf516a1d2", + "id": "rs_0b4101be339436580068f8d19a1200819ca183d10bc7e74096", "summary": [], "type": "reasoning", }, { "code": "import math, decimal n = 123_902_139_123 -sqrt_double = math.sqrt(n) -sqrt_double", - "container_id": "cntr_68f24e8ca224819197e2720a847ba8680321606c6212ad11", - "id": "ci_0f2450162f078cbb0068f24e8fb0b48191989caf7138433a8c", +math.sqrt(n)", + "container_id": "cntr_68f8d19994b48191accc92a31040fa390e1012fb90655561", + "id": "ci_0b4101be339436580068f8d1a1ae94819c915d01bd1f7e94b3", "outputs": null, "status": "completed", "type": "code_interpreter_call", }, { - "id": "rs_0f2450162f078cbb0068f24e962850819188fd28b996082c40", - "summary": [], - "type": "reasoning", - }, - { - "code": "351997**2, 351998**2, n", - "container_id": "cntr_68f24e8ca224819197e2720a847ba8680321606c6212ad11", - "id": "ci_0f2450162f078cbb0068f24e9681e88191b6cacce605376df4", - "outputs": null, - "status": "completed", - "type": "code_interpreter_call", - }, - { - "id": "rs_0f2450162f078cbb0068f24e9837d88191a7aaa5be02696451", + "id": "rs_0b4101be339436580068f8d1a3ed40819c98690ffb713748e9", "summary": [], "type": "reasoning", }, { "code": "from decimal import Decimal, getcontext getcontext().prec = 50 -n = Decimal(123902139123) -sqrt_dec = n.sqrt() -sqrt_dec", - "container_id": "cntr_68f24e8ca224819197e2720a847ba8680321606c6212ad11", - "id": "ci_0f2450162f078cbb0068f24e9de0048191809cdecc84494a8d", +x = Decimal(n).sqrt() +x", + "container_id": "cntr_68f8d19994b48191accc92a31040fa390e1012fb90655561", + "id": "ci_0b4101be339436580068f8d1a7bc14819cb81409004809a62d", "outputs": null, "status": "completed", "type": "code_interpreter_call", }, { - "id": "rs_0f2450162f078cbb0068f24ea105f0819187396c82412a9fdb", + "id": "rs_0b4101be339436580068f8d1a973a4819cb954e00c111a5a39", "summary": [], "type": "reasoning", }, @@ -645,17 +613,17 @@ sqrt_dec", { "annotations": [], "logprobs": [], - "text": "The square root of 123902139123 is approximately 351,997.3566988820443179179564.", + "text": "The square root of 123902139123 is approximately 351,997.3566988820443.", "type": "output_text", }, ], - "id": "msg_0f2450162f078cbb0068f24ea8817081918421bee81a7f93bb", + "id": "msg_0b4101be339436580068f8d1ac3194819cb3fdaad1a454b069", "role": "assistant", "status": "completed", "type": "message", }, ], - "output_text": "The square root of 123902139123 is approximately 351,997.3566988820443179179564.", + "output_text": "The square root of 123902139123 is approximately 351,997.3566988820443.", "parallel_tool_calls": true, "previous_response_id": null, "prompt_cache_key": null, @@ -687,18 +655,18 @@ sqrt_dec", "top_p": 1, "truncation": "disabled", "usage": { - "input_tokens": 1315, + "input_tokens": 2003, "input_tokens_details": { "cached_tokens": 0, }, - "output_tokens": 799, + "output_tokens": 1436, "output_tokens_details": { - "reasoning_tokens": 768, + "reasoning_tokens": 1408, }, "pydantic_ai_gateway": { - "cost_estimate": 0.00963375, + "cost_estimate": 0.01686375, }, - "total_tokens": 2114, + "total_tokens": 3439, }, "user": null, } @@ -795,25 +763,13 @@ exports[`openai > openai responses with builtin tools > span 1`] = ` { "key": "http.request.body.text", "value": { - "stringValue": "{ - "model": "gpt-5", - "instructions": "be precise", - "input": "what's the root square of 123902139123?", - "tools": [ - { - "type": "code_interpreter", - "container": { - "type": "auto" - } - } - ] -}", + "stringValue": "{"model":"gpt-5","instructions":"be precise","input":"what's the root square of 123902139123?","tools":[{"type":"code_interpreter","container":{"type":"auto"}}]}", }, }, { "key": "http.response.body.text", "value": { - "stringValue": "{"id":"resp_0f2450162f078cbb0068f24e8955748191affcd350ce641443","object":"response","created_at":1760710281,"status":"completed","background":false,"billing":{"payer":"developer"},"error":null,"incomplete_details":null,"instructions":"be precise","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_0f2450162f078cbb0068f24e8d85f4819197c895fdf516a1d2","type":"reasoning","summary":[]},{"id":"ci_0f2450162f078cbb0068f24e8fb0b48191989caf7138433a8c","type":"code_interpreter_call","status":"completed","code":"import math, decimal\\r\\nn = 123_902_139_123\\r\\nsqrt_double = math.sqrt(n)\\r\\nsqrt_double","container_id":"cntr_68f24e8ca224819197e2720a847ba8680321606c6212ad11","outputs":null},{"id":"rs_0f2450162f078cbb0068f24e962850819188fd28b996082c40","type":"reasoning","summary":[]},{"id":"ci_0f2450162f078cbb0068f24e9681e88191b6cacce605376df4","type":"code_interpreter_call","status":"completed","code":"351997**2, 351998**2, n","container_id":"cntr_68f24e8ca224819197e2720a847ba8680321606c6212ad11","outputs":null},{"id":"rs_0f2450162f078cbb0068f24e9837d88191a7aaa5be02696451","type":"reasoning","summary":[]},{"id":"ci_0f2450162f078cbb0068f24e9de0048191809cdecc84494a8d","type":"code_interpreter_call","status":"completed","code":"from decimal import Decimal, getcontext\\r\\ngetcontext().prec = 50\\r\\nn = Decimal(123902139123)\\r\\nsqrt_dec = n.sqrt()\\r\\nsqrt_dec","container_id":"cntr_68f24e8ca224819197e2720a847ba8680321606c6212ad11","outputs":null},{"id":"rs_0f2450162f078cbb0068f24ea105f0819187396c82412a9fdb","type":"reasoning","summary":[]},{"id":"msg_0f2450162f078cbb0068f24ea8817081918421bee81a7f93bb","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The square root of 123902139123 is approximately 351,997.3566988820443179179564."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"code_interpreter","container":{"type":"auto"}}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":1315,"input_tokens_details":{"cached_tokens":0},"output_tokens":799,"output_tokens_details":{"reasoning_tokens":768},"total_tokens":2114,"pydantic_ai_gateway":{"cost_estimate":0.00963375}},"user":null,"metadata":{}}", + "stringValue": "{"id":"resp_0b4101be339436580068f8d196baf4819c9dc0a0d1b4a689d3","object":"response","created_at":1761137046,"status":"completed","background":false,"billing":{"payer":"developer"},"error":null,"incomplete_details":null,"instructions":"be precise","max_output_tokens":null,"max_tool_calls":null,"model":"gpt-5-2025-08-07","output":[{"id":"rs_0b4101be339436580068f8d19a1200819ca183d10bc7e74096","type":"reasoning","summary":[]},{"id":"ci_0b4101be339436580068f8d1a1ae94819c915d01bd1f7e94b3","type":"code_interpreter_call","status":"completed","code":"import math, decimal\\nn = 123_902_139_123\\nmath.sqrt(n)","container_id":"cntr_68f8d19994b48191accc92a31040fa390e1012fb90655561","outputs":null},{"id":"rs_0b4101be339436580068f8d1a3ed40819c98690ffb713748e9","type":"reasoning","summary":[]},{"id":"ci_0b4101be339436580068f8d1a7bc14819cb81409004809a62d","type":"code_interpreter_call","status":"completed","code":"from decimal import Decimal, getcontext\\ngetcontext().prec = 50\\nx = Decimal(n).sqrt()\\nx","container_id":"cntr_68f8d19994b48191accc92a31040fa390e1012fb90655561","outputs":null},{"id":"rs_0b4101be339436580068f8d1a973a4819cb954e00c111a5a39","type":"reasoning","summary":[]},{"id":"msg_0b4101be339436580068f8d1ac3194819cb3fdaad1a454b069","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"The square root of 123902139123 is approximately 351,997.3566988820443."}],"role":"assistant"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt_cache_key":null,"reasoning":{"effort":"medium","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tools":[{"type":"code_interpreter","container":{"type":"auto"}}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":2003,"input_tokens_details":{"cached_tokens":0},"output_tokens":1436,"output_tokens_details":{"reasoning_tokens":1408},"total_tokens":3439,"pydantic_ai_gateway":{"cost_estimate":0.01686375}},"user":null,"metadata":{}}", }, }, { @@ -825,7 +781,7 @@ exports[`openai > openai responses with builtin tools > span 1`] = ` { "key": "gen_ai.usage.input_tokens", "value": { - "intValue": 1315, + "intValue": 2003, }, }, { @@ -841,7 +797,7 @@ exports[`openai > openai responses with builtin tools > span 1`] = ` { "key": "gen_ai.usage.output_tokens", "value": { - "intValue": 799, + "intValue": 1436, }, }, { diff --git a/package-lock.json b/package-lock.json index 3f7165c..c2b27c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "@pydantic/logfire-cf-workers": "^0.9.0" }, "devDependencies": { - "openai": "^4.70.3", + "openai": "^6.6.0", "wrangler": "^4.27.0" } }, @@ -54,7 +54,7 @@ "@google/genai": "^1.15.0", "@types/mime-types": "^3.0.1", "groq-sdk": "^0.30.0", - "openai": "^4.104.0" + "openai": "^6.6.0" } }, "gateway/node_modules/@opentelemetry/api-logs": { @@ -5901,26 +5901,17 @@ "license": "MIT" }, "node_modules/openai": { - "version": "4.104.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", - "integrity": "sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-6.6.0.tgz", + "integrity": "sha512-1yWk4cBsHF5Bq9TreHYOHY7pbqdlT74COnm8vPx7WKn36StS+Hyk8DdAitnLaw67a5Cudkz5EmlFQjSrNnrA2w==", "dev": true, "license": "Apache-2.0", - "dependencies": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - }, "bin": { "openai": "bin/cli" }, "peerDependencies": { "ws": "^8.18.0", - "zod": "^3.23.8" + "zod": "^3.25 || ^4.0" }, "peerDependenciesMeta": { "ws": { @@ -5931,23 +5922,6 @@ } } }, - "node_modules/openai/node_modules/@types/node": { - "version": "18.19.124", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.124.tgz", - "integrity": "sha512-hY4YWZFLs3ku6D2Gqo3RchTd9VRCcrjqp/I0mmohYeUVA5Y8eCXKJEasHxLAJVZRJuQogfd1GiJ9lgogBgKeuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/openai/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "license": "MIT" - }, "node_modules/path-to-regexp": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", diff --git a/proxy-vcr/proxy_vcr/cassettes/5a46ecdad3c6fa2ea916253bf3c4de6bbc01773ddf1434281fb7b6b519b00619.yaml b/proxy-vcr/proxy_vcr/cassettes/5a46ecdad3c6fa2ea916253bf3c4de6bbc01773ddf1434281fb7b6b519b00619.yaml new file mode 100644 index 0000000..4a74e97 --- /dev/null +++ b/proxy-vcr/proxy_vcr/cassettes/5a46ecdad3c6fa2ea916253bf3c4de6bbc01773ddf1434281fb7b6b519b00619.yaml @@ -0,0 +1,99 @@ +interactions: +- request: + body: '{"stream":true,"model":"gpt-5","messages":[{"role":"developer","content":"You + are a helpful assistant."},{"role":"user","content":"What is the capital of + France?"}],"max_completion_tokens":1024,"stream_options":{"include_usage":true}}' + headers: + accept: + - '*/*' + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '234' + content-type: + - application/json + cookie: + - __cf_bm=DozbN_6AAZtvldTilT428le5P6DA6rHj8axy_69vofw-1761137038-1.0.1.1-oUzkRpDtiHEYFcJOVkdfXC9xAV4WP1fyLzkOL6iCxbgyFHnSYAh2T5WNguROOMXUZzoqKQmRpVoIaJnQbiz11DR_TclvP2OtQzDOnfUHFOQ; + _cfuvid=7haqTFLWfvR4AO3Dz3AASsArjOvy3j3DtCjeU5ZokkY-1761137038344-0.0.1.1-604800000 + host: + - api.openai.com + user-agent: + - python-httpx/0.28.1 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: 'data: {"id":"chatcmpl-CTSUYz43ywMLIFYgQY6YtWyFbry8G","object":"chat.completion.chunk","created":1761137070,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"x1esqmAGF6"} + + + data: {"id":"chatcmpl-CTSUYz43ywMLIFYgQY6YtWyFbry8G","object":"chat.completion.chunk","created":1761137070,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Paris"},"finish_reason":null}],"usage":null,"obfuscation":"ZODDDz4"} + + + data: {"id":"chatcmpl-CTSUYz43ywMLIFYgQY6YtWyFbry8G","object":"chat.completion.chunk","created":1761137070,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"6wuevQZVFGT"} + + + data: {"id":"chatcmpl-CTSUYz43ywMLIFYgQY6YtWyFbry8G","object":"chat.completion.chunk","created":1761137070,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"WNuOkE"} + + + data: {"id":"chatcmpl-CTSUYz43ywMLIFYgQY6YtWyFbry8G","object":"chat.completion.chunk","created":1761137070,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":23,"completion_tokens":11,"total_tokens":34,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"fHT239cMJq5"} + + + data: [DONE] + + + ' + headers: + CF-RAY: + - 9929161ede09d835-AMS + Connection: + - keep-alive + Content-Type: + - text/event-stream; charset=utf-8 + Date: + - Wed, 22 Oct 2025 12:44:32 GMT + Server: + - cloudflare + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + access-control-expose-headers: + - X-Request-ID + alt-svc: + - h3=":443"; ma=86400 + cf-cache-status: + - DYNAMIC + openai-organization: + - pydantic-28gund + openai-processing-ms: + - '1368' + openai-project: + - proj_dKobscVY9YJxeEaDJen54e3d + openai-version: + - '2020-10-01' + x-envoy-upstream-service-time: + - '1554' + x-openai-proxy-wasm: + - v0.1 + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '4000000' + x-ratelimit-remaining-requests: + - '9999' + x-ratelimit-remaining-tokens: + - '3999982' + x-ratelimit-reset-requests: + - 6ms + x-ratelimit-reset-tokens: + - 0s + x-request-id: + - req_1eed493c4504496ca7b64c2298699f93 + status: + code: 200 + message: OK +version: 1 diff --git a/proxy-vcr/proxy_vcr/cassettes/63cde077054c717c309079c14252d8480335a69d79609f9db35714a1ae97cfca.yaml b/proxy-vcr/proxy_vcr/cassettes/63cde077054c717c309079c14252d8480335a69d79609f9db35714a1ae97cfca.yaml new file mode 100644 index 0000000..e1f3cde --- /dev/null +++ b/proxy-vcr/proxy_vcr/cassettes/63cde077054c717c309079c14252d8480335a69d79609f9db35714a1ae97cfca.yaml @@ -0,0 +1,84 @@ +interactions: +- request: + body: '{"model":"gpt-5","instructions":"be precise","input":"what''s the root + square of 123902139123?","tools":[{"type":"code_interpreter","container":{"type":"auto"}}]}' + headers: + accept: + - '*/*' + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '161' + content-type: + - application/json + cookie: + - __cf_bm=DozbN_6AAZtvldTilT428le5P6DA6rHj8axy_69vofw-1761137038-1.0.1.1-oUzkRpDtiHEYFcJOVkdfXC9xAV4WP1fyLzkOL6iCxbgyFHnSYAh2T5WNguROOMXUZzoqKQmRpVoIaJnQbiz11DR_TclvP2OtQzDOnfUHFOQ; + _cfuvid=7haqTFLWfvR4AO3Dz3AASsArjOvy3j3DtCjeU5ZokkY-1761137038344-0.0.1.1-604800000 + host: + - api.openai.com + user-agent: + - python-httpx/0.28.1 + method: POST + uri: https://api.openai.com/v1/responses + response: + body: + string: !!binary | + H4sIAAAAAAAAA8xWwW7jNhC95ysInRLACUhRksUAufUTetsshBE1cthIpJYcBTYW+fdClC3Ljb3o + oS16k/hmHmfmDTn8ecdYYprkmSUew1DxOhNc1CilymSRl5wXZVs2QhU1tFkplFaN5sAbUWdQlKqR + yWaicPUfqOlE42zAeV17BMKmggkT20IIueVZEbFAQGOYfLTrhw4Jm9mpBv2+8260U1wtdAHnZdN1 + xu6SZ/bzjjHGkgEO6Cf/Bj+wcwP65I6xz2iM3rsJs2PXxQVjT7tUDRKYLlyigfyoyTgbI6qRDR61 + OeXRw75yIw0jVeTe0V44TyA511Uaukva3jXYTXy7gR7zx5Sn+SMvH/n2WLXImDyzbzGhOa2zIOG2 + HCBSzic5QJSyEbzWW9xmXBWROJLQYcBZEAjOToVboDD2PfjDtPH3uPa5uRaANjcDAAGo5n4QecNF + 3Yh2iyqr5dcAtGuwMpbQDx4JfSzTKpgbbRDByXeCTD84T6wHetuwBrXpoXu1lr0wkcpK8bQSUlUi + la92snkKPzzd24c1kSUwFn11zM2Sr47FVCqrp1wEaK1VClLwjLcgFUfBRdrWihd5nhfiTDcrd9L6 + FzX8hYggscmiiKosFG/beivkNitR/Vcibmstooh1KTKuOM9KrqBIm39HxNa7/iQeOyr62/y7YTuk + SSPc06s9f98/PE3nkL2wnL/aPXs5Odzbh1nkh1e7/3/LrLYS5iqrPEPOtRACcpD/qMx92N2OQEsx + H9Zatg1AIyDLs5oXVyLoMQTY4d9W1hLa8w22DuyC9nR34p4W72gA1jqC07377fsF2Lnd4F19BYlE + zyz5/Q1Z+DGCR+adI+ba6UJQPBVSiVQyExgMg3d70wNhd2AyFxultk8yLwpVlmXKs0w+JQv35/Fr + 2S7xrospQAgmEFiajSfDaJQM4KHrsLucAeTHeWwNHj+MG0N1moxzay4zYvCuH6jSoN+wesfDGjv3 + wzL0sG2dp1mqxoz9sZyrPjm26jwHA7RIh8o0aMm0Bi9mYkD/YTRWZE5ztIWxmxVKAjmP60QI+wE9 + 0BiXxRM/rkYljtG1zvdw/l91QLRbN3Dygb52wdBhlcwS91zLN2f0XPyRXLIA4evIvHVPXbkaVtGt + HOMOd+smOCtMbqhWvciXxWFdCD9aHTs5ltIEqLvTi2aMZ2qpkrEXD4mUc7n5iqzeKUuasUuasyu/ + qOhfXygik8U16Brz0mprd15e8JMj6M64zKRaBBvDZW/1SNAAwbTH593nnwAAAP//AwDc8oupaQoA + AA== + headers: + CF-RAY: + - 992915896c3bd835-AMS + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 22 Oct 2025 12:44:29 GMT + Server: + - cloudflare + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + alt-svc: + - h3=":443"; ma=86400 + cf-cache-status: + - DYNAMIC + openai-organization: + - pydantic-28gund + openai-processing-ms: + - '23135' + openai-project: + - proj_dKobscVY9YJxeEaDJen54e3d + openai-version: + - '2020-10-01' + x-envoy-upstream-service-time: + - '23367' + x-request-id: + - req_d27c632e891b483dbd3f9cb9e4dc5bd5 + status: + code: 200 + message: OK +version: 1 diff --git a/proxy-vcr/proxy_vcr/cassettes/94b5023ee22aa2f634c8d1bb4ab8d73be0d32e1b9ad5d28b48bc87606b47d957.yaml b/proxy-vcr/proxy_vcr/cassettes/94b5023ee22aa2f634c8d1bb4ab8d73be0d32e1b9ad5d28b48bc87606b47d957.yaml new file mode 100644 index 0000000..29d3dd3 --- /dev/null +++ b/proxy-vcr/proxy_vcr/cassettes/94b5023ee22aa2f634c8d1bb4ab8d73be0d32e1b9ad5d28b48bc87606b47d957.yaml @@ -0,0 +1,89 @@ +interactions: +- request: + body: '{"model":"gpt-5","messages":[{"role":"developer","content":"You are a helpful + assistant."},{"role":"user","content":"What is the capital of France?"}]}' + headers: + accept: + - '*/*' + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '151' + content-type: + - application/json + cookie: + - __cf_bm=DozbN_6AAZtvldTilT428le5P6DA6rHj8axy_69vofw-1761137038-1.0.1.1-oUzkRpDtiHEYFcJOVkdfXC9xAV4WP1fyLzkOL6iCxbgyFHnSYAh2T5WNguROOMXUZzoqKQmRpVoIaJnQbiz11DR_TclvP2OtQzDOnfUHFOQ; + _cfuvid=7haqTFLWfvR4AO3Dz3AASsArjOvy3j3DtCjeU5ZokkY-1761137038344-0.0.1.1-604800000 + host: + - api.openai.com + user-agent: + - python-httpx/0.28.1 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA4ySy07DMBBF9/kKy+umShpoaLaskFjwXACqImNPWlPHtuxJRan678juI0EUiY0X + c2au7h3PNiGESkErQvmSIW+tSq+fHp/h/qu5BcfXRXGHs+J187KaFTfl4wMdhQnz/gEcj1Njblqr + AKXRe8wdMISgmpfTPC/KrJxG0BoBKowtLKaX6SSbXKbZVZqVh7mlkRw8rchbQggh2/gGh1rAJ61I + NjpWWvCeLYBWpyZCqDMqVCjzXnpkGumoh9xoBB1N3zEn/XgIHTSdZ8Ga7pQaAKa1QRaiRVvzA9md + jDRSS7+sHTBvdBD3aCyNdJcQMo/Buh9eqXWmtVijWUGUnRR7Odovsod5foBokKm+XlyMzqjVApBJ + 5QeLoZzxJYh+st8i64Q0A5AMsv02c057n1vqxX/ke8A5WARRWwdC8p+B+zYH4cz+ajvtOBqmHtxa + cqhRggv/IKBhndqfAPUbj9DWjdQLcNbJeAfhq5Nd8g0AAP//AwDOjb9dBAMAAA== + headers: + CF-RAY: + - 99291640abd0d835-AMS + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 22 Oct 2025 12:44:38 GMT + Server: + - cloudflare + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + access-control-expose-headers: + - X-Request-ID + alt-svc: + - h3=":443"; ma=86400 + cf-cache-status: + - DYNAMIC + openai-organization: + - pydantic-28gund + openai-processing-ms: + - '2771' + openai-project: + - proj_dKobscVY9YJxeEaDJen54e3d + openai-version: + - '2020-10-01' + x-envoy-upstream-service-time: + - '2981' + x-openai-proxy-wasm: + - v0.1 + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '4000000' + x-ratelimit-remaining-requests: + - '9999' + x-ratelimit-remaining-tokens: + - '3999982' + x-ratelimit-reset-requests: + - 6ms + x-ratelimit-reset-tokens: + - 0s + x-request-id: + - req_f2e0d728f4a5482fa60907796e066abf + status: + code: 200 + message: OK +version: 1 diff --git a/proxy-vcr/proxy_vcr/cassettes/9a34bd0e1e046505da2fb7fe9a5d89202b270f742c50dced62bdc74ceb87c1c5.yaml b/proxy-vcr/proxy_vcr/cassettes/9a34bd0e1e046505da2fb7fe9a5d89202b270f742c50dced62bdc74ceb87c1c5.yaml new file mode 100644 index 0000000..6ec472b --- /dev/null +++ b/proxy-vcr/proxy_vcr/cassettes/9a34bd0e1e046505da2fb7fe9a5d89202b270f742c50dced62bdc74ceb87c1c5.yaml @@ -0,0 +1,79 @@ +interactions: +- request: + body: '{"model":"gpt-5","instructions":"reply concisely","input":"what color is + the sky?"}' + headers: + accept: + - '*/*' + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '83' + content-type: + - application/json + cookie: + - __cf_bm=DozbN_6AAZtvldTilT428le5P6DA6rHj8axy_69vofw-1761137038-1.0.1.1-oUzkRpDtiHEYFcJOVkdfXC9xAV4WP1fyLzkOL6iCxbgyFHnSYAh2T5WNguROOMXUZzoqKQmRpVoIaJnQbiz11DR_TclvP2OtQzDOnfUHFOQ; + _cfuvid=7haqTFLWfvR4AO3Dz3AASsArjOvy3j3DtCjeU5ZokkY-1761137038344-0.0.1.1-604800000 + host: + - api.openai.com + user-agent: + - python-httpx/0.28.1 + method: POST + uri: https://api.openai.com/v1/responses + response: + body: + string: !!binary | + H4sIAAAAAAAAA3RUy5KjMAy85ytcnJNZ80gC2e/Y09QUJYwg3hibsuXsUFP59y1MQmA3cwO11W6p + JX9tGItkHZ1YZNH1Jd+naZNBkRxrvkfecH7Im7yO8yY7ZlkeFzzfH5MshyKu8qTiRRZtRwpT/UZB + DxqjHU5xYREI6xJGLD4e4jg98rQImCMg78YcYbpeIWE9JVUgLq01Xo+6GlAOp7BUSuo2OrGvDWOM + RT0MaMf8Gq+oTI822jB2C4fRWjNi2isVAlI/bilrJJDKrVFH1guSRrupil4NTBgtpEM1TLo6+CyN + p95TSeaCesUwgmSMKgWoNXdnalQjadvTbr9LeLLf8XzHj/fWBcboxN5DVVNtT1fct54U/HhoRPDk + kOdNXBVNwqsUqsmTQEJDj1M94IweuzdDzncd2GG8+CPEbttXAjrXfq9gfwQIU1E0cZPwA2RVnCYH + XvyvoEPnoMXF/d/YH0BhNKF+dmUpbEX78AM/ac4OB0BrQ/Aw9P1jBSrT9tZUL5BAdGLRL+dBqYFV + yiOTmtUwKNme6SeTxARoRt5qZrH+YSzoFhkQc15b6ZAZO346pC1rLQzszxk1E8r4etgy0DWrFIjL + mKFHyrdoFnC7f82aImtUqBOck45A03R4PBgORT1YUArVevjI+mlpeotXabwrH3tZBlvn4eyt6Xoq + BYgzlhcclthzaOaVw6YxliY/a+m7e88XwzRmz1vooEEaSlmjJtlIXG2kQ3uVAkuSjy1uwKvJxsiR + sbgshLDr0QL5EI7f+D0a7Lqra4zt4Pm/GJNwbjnl0RVtZZykYVHMrHvq5dlIMTXfk4lm4Dk1EZm+ + XMwSn4P9UqP1WoRJDFVKB5V6PHU+7MRcgNSrxyXh2//ji+drLjPYVz8T+arUf9+sJElfIa+I5xF4 + ZsdFsmInQ6AW5Fk6t9G7teMdEtRAMN5w29z+AgAA//8DABOI9UR9BgAA + headers: + CF-RAY: + - 9929155c5d02d835-AMS + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 22 Oct 2025 12:44:05 GMT + Server: + - cloudflare + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + alt-svc: + - h3=":443"; ma=86400 + cf-cache-status: + - DYNAMIC + openai-organization: + - pydantic-28gund + openai-processing-ms: + - '6600' + openai-project: + - proj_dKobscVY9YJxeEaDJen54e3d + openai-version: + - '2020-10-01' + x-envoy-upstream-service-time: + - '6605' + x-request-id: + - req_6fc949608beb483bb392e65cde2d7cb7 + status: + code: 200 + message: OK +version: 1 diff --git a/proxy-vcr/proxy_vcr/cassettes/d5a7a1c1465d334c3ef88808e852989149627f75ee92af205719bc210ea5fb30.yaml b/proxy-vcr/proxy_vcr/cassettes/d5a7a1c1465d334c3ef88808e852989149627f75ee92af205719bc210ea5fb30.yaml new file mode 100644 index 0000000..57fc997 --- /dev/null +++ b/proxy-vcr/proxy_vcr/cassettes/d5a7a1c1465d334c3ef88808e852989149627f75ee92af205719bc210ea5fb30.yaml @@ -0,0 +1,92 @@ +interactions: +- request: + body: '{"model":"gpt-5","messages":[{"role":"developer","content":"You are a helpful + assistant."},{"role":"user","content":"What is the capital of France?"}],"max_completion_tokens":1024}' + headers: + accept: + - '*/*' + accept-encoding: + - gzip, deflate + connection: + - keep-alive + content-length: + - '180' + content-type: + - application/json + host: + - api.openai.com + user-agent: + - python-httpx/0.28.1 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA3SSQU8CMRCF7/srmp5Zs4CAcuVuNAocjNmM7exS7LZNO2s0hv9uWpCuES89zDfz + 8t50vgrGuJJ8ybjYAYnO6XL19Liu5HZqNyvoq7sNtvNmtRXr9cN+AnwUJ+zrHgX9TF0J2zmNpKw5 + YuERCKPqeDEfj6eLajpPoLMSdRxrHZWzclJNZmV1U1aL09zOKoGBL9lzwRhjX+mNDo3ED75k1ein + 0mEI0CJfnpsY497qWOEQggoEhvgoQ2ENoUmm78GrcDWEHps+QLRmeq0HAIyxBDFasvVyIoezkUYZ + FXa1RwjWRPFA1vFEDwVjLylY/8srd952jmqyb5hkJ9OjHM+LzHAxO0GyBDrXb29GF9RqiQRKh8Fi + uACxQ5kn8xahl8oOQDHI9tfMJe1jbmXarDK//lc/AyHQEcraeZRK/E6c2zzGO/uv7bzk5JgH9O9K + YE0KffwIiQ30+ngDPHwGwq5ulGnRO6/SIcS/Lg7FNwAAAP//AwBOVuRvBQMAAA== + headers: + CF-RAY: + - 99291547bd10d835-AMS + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 22 Oct 2025 12:43:58 GMT + Server: + - cloudflare + Set-Cookie: + - __cf_bm=DozbN_6AAZtvldTilT428le5P6DA6rHj8axy_69vofw-1761137038-1.0.1.1-oUzkRpDtiHEYFcJOVkdfXC9xAV4WP1fyLzkOL6iCxbgyFHnSYAh2T5WNguROOMXUZzoqKQmRpVoIaJnQbiz11DR_TclvP2OtQzDOnfUHFOQ; + path=/; expires=Wed, 22-Oct-25 13:13:58 GMT; domain=.api.openai.com; HttpOnly; + Secure; SameSite=None + - _cfuvid=7haqTFLWfvR4AO3Dz3AASsArjOvy3j3DtCjeU5ZokkY-1761137038344-0.0.1.1-604800000; + path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - nosniff + access-control-expose-headers: + - X-Request-ID + alt-svc: + - h3=":443"; ma=86400 + cf-cache-status: + - DYNAMIC + openai-organization: + - pydantic-28gund + openai-processing-ms: + - '2202' + openai-project: + - proj_dKobscVY9YJxeEaDJen54e3d + openai-version: + - '2020-10-01' + x-envoy-upstream-service-time: + - '2386' + x-openai-proxy-wasm: + - v0.1 + x-ratelimit-limit-requests: + - '10000' + x-ratelimit-limit-tokens: + - '4000000' + x-ratelimit-remaining-requests: + - '9999' + x-ratelimit-remaining-tokens: + - '3999982' + x-ratelimit-reset-requests: + - 6ms + x-ratelimit-reset-tokens: + - 0s + x-request-id: + - req_d7693e7f40a741249a88e71fc1a04359 + status: + code: 200 + message: OK +version: 1