interactions:
- request:
    body: '{"messages":[{"content":"Use the provided tool to calculate the square
      of 2.","role":"system"},{"role":"user","content":"What is the square of 2?"}],"model":"gpt-4o","stream":true,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"type":"function","function":{"name":"calculate_square_tool","description":"","parameters":{"additionalProperties":false,"properties":{"x":{"type":"integer"}},"required":["x"],"type":"object"},"strict":true}}]}'
    headers:
      accept:
      - application/json
      accept-encoding:
      - gzip, deflate
      connection:
      - keep-alive
      content-length:
      - '461'
      content-type:
      - application/json
      host:
      - api.openai.com
      user-agent:
      - pydantic-ai/0.3.0
      x-stainless-arch:
      - arm64
      x-stainless-async:
      - async:asyncio
      x-stainless-lang:
      - python
      x-stainless-os:
      - MacOS
      x-stainless-package-version:
      - 1.93.0
      x-stainless-read-timeout:
      - '600'
      x-stainless-retry-count:
      - '0'
      x-stainless-runtime:
      - CPython
      x-stainless-runtime-version:
      - 3.10.15
    method: POST
    uri: https://api.openai.com/v1/chat/completions
  response:
    body:
      string: 'data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_BPhRQvs8mbUXeHhEE6RAXTCW","type":"function","function":{"name":"calculate_square_tool","arguments":""}}],"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"x"}}]},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"2"}}]},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"tool_calls"}],"usage":null}


        data: {"id":"chatcmpl-BqmKXS9mjjbKcpdmuyNyTEvL7WMkG","object":"chat.completion.chunk","created":1751918537,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[],"usage":{"prompt_tokens":58,"completion_tokens":15,"total_tokens":73,"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}}}


        data: [DONE]


        '
    headers:
      CF-RAY:
      - 95b9f04b0d8d3ad6-IAD
      Connection:
      - keep-alive
      Content-Type:
      - text/event-stream; charset=utf-8
      Date:
      - Mon, 07 Jul 2025 20:02:18 GMT
      Server:
      - cloudflare
      Set-Cookie:
      - __cf_bm=PAFsQeqnF2hM_unP99W3giz6OA94w3l4COgM_sHScIc-1751918538-1.0.1.1-vNetZO70Hl5rFbOkBoebYsBdsJTT2XhHxfsJV881zq539VwRJfUP1xqb_WOe8zzMJgGRO9dAH_jp3Q13QeIdJLtl5EiGUE_kFE0fdUjEoeQ;
        path=/; expires=Mon, 07-Jul-25 20:32:18 GMT; domain=.api.openai.com; HttpOnly;
        Secure; SameSite=None
      - _cfuvid=xZz7_.qw1TG4RqR9og5otIe6zPbBog2eS53QIMAik0A-1751918538240-0.0.1.1-604800000;
        path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
      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:
      - datadog-4
      openai-processing-ms:
      - '469'
      openai-version:
      - '2020-10-01'
      strict-transport-security:
      - max-age=31536000; includeSubDomains; preload
      x-envoy-upstream-service-time:
      - '480'
      x-ratelimit-limit-requests:
      - '10000'
      x-ratelimit-limit-tokens:
      - '30000000'
      x-ratelimit-remaining-requests:
      - '9999'
      x-ratelimit-remaining-tokens:
      - '29999978'
      x-ratelimit-reset-requests:
      - 6ms
      x-ratelimit-reset-tokens:
      - 0s
      x-request-id:
      - req_0fefe7c93e35f08e7b53214bc6242baf
    status:
      code: 200
      message: OK
- request:
    body: '{"messages":[{"content":"Use the provided tool to calculate the square
      of 2.","role":"system"},{"role":"user","content":"What is the square of 2?"},{"role":"assistant","tool_calls":[{"id":"call_BPhRQvs8mbUXeHhEE6RAXTCW","type":"function","function":{"name":"calculate_square_tool","arguments":"{\"x\":2}"}}]},{"role":"tool","tool_call_id":"call_BPhRQvs8mbUXeHhEE6RAXTCW","content":"4"}],"model":"gpt-4o","stream":true,"stream_options":{"include_usage":true},"tool_choice":"auto","tools":[{"type":"function","function":{"name":"calculate_square_tool","description":"","parameters":{"additionalProperties":false,"properties":{"x":{"type":"integer"}},"required":["x"],"type":"object"},"strict":true}}]}'
    headers:
      accept:
      - application/json
      accept-encoding:
      - gzip, deflate
      connection:
      - keep-alive
      content-length:
      - '699'
      content-type:
      - application/json
      cookie:
      - __cf_bm=PAFsQeqnF2hM_unP99W3giz6OA94w3l4COgM_sHScIc-1751918538-1.0.1.1-vNetZO70Hl5rFbOkBoebYsBdsJTT2XhHxfsJV881zq539VwRJfUP1xqb_WOe8zzMJgGRO9dAH_jp3Q13QeIdJLtl5EiGUE_kFE0fdUjEoeQ;
        _cfuvid=xZz7_.qw1TG4RqR9og5otIe6zPbBog2eS53QIMAik0A-1751918538240-0.0.1.1-604800000
      host:
      - api.openai.com
      user-agent:
      - pydantic-ai/0.3.0
      x-stainless-arch:
      - arm64
      x-stainless-async:
      - async:asyncio
      x-stainless-lang:
      - python
      x-stainless-os:
      - MacOS
      x-stainless-package-version:
      - 1.93.0
      x-stainless-read-timeout:
      - '600'
      x-stainless-retry-count:
      - '0'
      x-stainless-runtime:
      - CPython
      x-stainless-runtime-version:
      - 3.10.15
    method: POST
    uri: https://api.openai.com/v1/chat/completions
  response:
    body:
      string: 'data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"The"},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"
        square"},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"
        of"},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"
        "},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"2"},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"
        is"},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"
        "},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"4"},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{"content":"."},"logprobs":null,"finish_reason":null}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null}


        data: {"id":"chatcmpl-BqmKYqwBD1AwIesOKSDmGws7VVbxp","object":"chat.completion.chunk","created":1751918538,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_a288987b44","choices":[],"usage":{"prompt_tokens":83,"completion_tokens":10,"total_tokens":93,"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}}}


        data: [DONE]


        '
    headers:
      CF-RAY:
      - 95b9f0512dd23ad6-IAD
      Connection:
      - keep-alive
      Content-Type:
      - text/event-stream; charset=utf-8
      Date:
      - Mon, 07 Jul 2025 20:02:19 GMT
      Server:
      - cloudflare
      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:
      - datadog-4
      openai-processing-ms:
      - '348'
      openai-version:
      - '2020-10-01'
      strict-transport-security:
      - max-age=31536000; includeSubDomains; preload
      x-envoy-upstream-service-time:
      - '354'
      x-ratelimit-limit-requests:
      - '10000'
      x-ratelimit-limit-tokens:
      - '30000000'
      x-ratelimit-remaining-requests:
      - '9999'
      x-ratelimit-remaining-tokens:
      - '29999975'
      x-ratelimit-reset-requests:
      - 6ms
      x-ratelimit-reset-tokens:
      - 0s
      x-request-id:
      - req_f12e1e65b6758eb5493b083fcb67a7d4
    status:
      code: 200
      message: OK
version: 1
