{
  "test_id": "tests/integration/responses/test_tool_responses.py::test_response_function_call_ordering_2[client_with_models-txt=openai/gpt-4o]",
  "request": {
    "method": "POST",
    "url": "https://api.openai.com/v1/v1/chat/completions",
    "headers": {},
    "body": {
      "model": "gpt-4o",
      "messages": [
        {
          "role": "user",
          "content": "Is the weather better in San Francisco or Los Angeles?"
        }
      ],
      "stream": true,
      "tools": [
        {
          "type": "function",
          "function": {
            "type": "function",
            "name": "get_weather",
            "description": "Get current temperature for a given location.",
            "parameters": {
              "additionalProperties": false,
              "properties": {
                "location": {
                  "description": "City and country e.g. Bogot\u00e1, Colombia",
                  "type": "string"
                }
              },
              "required": [
                "location"
              ],
              "type": "object"
            },
            "strict": null
          }
        }
      ]
    },
    "endpoint": "/v1/chat/completions",
    "model": "gpt-4o"
  },
  "response": {
    "body": [
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": "assistant",
                "tool_calls": null
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "hNvFDJ6w"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": "call_VeQ0JBvrjUPMx6FVQliYseD6",
                    "function": {
                      "arguments": "",
                      "name": "get_weather"
                    },
                    "type": "function"
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "3GW1sp1"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "{\"lo",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "MeHqnZF1skfEWe"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "catio",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "FGFQTIZCQNTTmL"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "n\": \"S",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "OWT9tHKfb1h"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "an F",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "l0S9gqxE7FBas0E"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "ranci",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "EtsD8U3yWAzxfX"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "sco, U",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "fuRUXk6psiFZS"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 0,
                    "id": null,
                    "function": {
                      "arguments": "SA\"}",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "zS7KBZ77SJnsHp"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": "call_vEJqxX6A5y5ITfKlklzI3ia9",
                    "function": {
                      "arguments": "",
                      "name": "get_weather"
                    },
                    "type": "function"
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "rmHh7cd"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "{\"lo",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "UhhS4nYkmFYhgh"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "catio",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "WPCcFmAidAxkvv"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "n\": \"L",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "fK29PfZahnT"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "os A",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "Um2oZ7mv8rBcdvk"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "ngele",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "Dyv9KaIgXXZh0I"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "s, USA",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "RKOniLAWnp2Di"
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": [
                  {
                    "index": 1,
                    "id": null,
                    "function": {
                      "arguments": "\"}",
                      "name": null
                    },
                    "type": null
                  }
                ]
              },
              "finish_reason": null,
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": ""
        }
      },
      {
        "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
        "__data__": {
          "id": "rec-f2e35fd69fce",
          "choices": [
            {
              "delta": {
                "content": null,
                "function_call": null,
                "refusal": null,
                "role": null,
                "tool_calls": null
              },
              "finish_reason": "tool_calls",
              "index": 0,
              "logprobs": null
            }
          ],
          "created": 0,
          "model": "gpt-4o-2024-08-06",
          "object": "chat.completion.chunk",
          "service_tier": "default",
          "system_fingerprint": "fp_f64f290af2",
          "usage": null,
          "obfuscation": "a"
        }
      }
    ],
    "is_streaming": true
  }
}
