{ "test_id": "tests/integration/responses/test_tool_responses.py::test_max_tool_calls_with_mcp_tools[openai_client-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": "Get the experiment ID for 'boiling_point' and get the user ID for 'charlie'" }, { "role": "assistant", "content": "", "tool_calls": [ { "index": 0, "id": "call_z8P1RQv54BLxyMlRdMFkcCGd", "type": "function", "function": { "name": "get_experiment_id", "arguments": "{\"experiment_name\": \"boiling_point\"}" } }, { "index": 1, "id": "call_I5tcLgyMADoVwLKDj9HkTCs5", "type": "function", "function": { "name": "get_user_id", "arguments": "{\"username\": \"charlie\"}" } } ] }, { "role": "tool", "tool_call_id": "call_z8P1RQv54BLxyMlRdMFkcCGd", "content": [ { "type": "text", "text": "exp_004" } ] }, { "role": "tool", "tool_call_id": "call_I5tcLgyMADoVwLKDj9HkTCs5", "content": [ { "type": "text", "text": "user_11111" } ] } ], "stream": true, "stream_options": { "include_usage": true }, "tools": [ { "type": "function", "function": { "name": "get_user_id", "description": "\n Get the user ID for a given username. This ID is needed for other operations.\n\n :param username: The username to look up\n :return: The user ID for the username\n ", "parameters": { "properties": { "username": { "title": "Username", "type": "string" } }, "required": [ "username" ], "title": "get_user_idArguments", "type": "object" } } }, { "type": "function", "function": { "name": "get_user_permissions", "description": "\n Get the permissions for a user ID. Requires a valid user ID from get_user_id.\n\n :param user_id: The user ID to check permissions for\n :return: The permissions for the user\n ", "parameters": { "properties": { "user_id": { "title": "User Id", "type": "string" } }, "required": [ "user_id" ], "title": "get_user_permissionsArguments", "type": "object" } } }, { "type": "function", "function": { "name": "check_file_access", "description": "\n Check if a user can access a specific file. Requires a valid user ID.\n\n :param user_id: The user ID to check access for\n :param filename: The filename to check access to\n :return: Whether the user can access the file (yes/no)\n ", "parameters": { "properties": { "user_id": { "title": "User Id", "type": "string" }, "filename": { "title": "Filename", "type": "string" } }, "required": [ "user_id", "filename" ], "title": "check_file_accessArguments", "type": "object" } } }, { "type": "function", "function": { "name": "get_experiment_id", "description": "\n Get the experiment ID for a given experiment name. This ID is needed to get results.\n\n :param experiment_name: The name of the experiment\n :return: The experiment ID\n ", "parameters": { "properties": { "experiment_name": { "title": "Experiment Name", "type": "string" } }, "required": [ "experiment_name" ], "title": "get_experiment_idArguments", "type": "object" } } }, { "type": "function", "function": { "name": "get_experiment_results", "description": "\n Get the results for an experiment ID. Requires a valid experiment ID from get_experiment_id.\n\n :param experiment_id: The experiment ID to get results for\n :return: The experiment results\n ", "parameters": { "properties": { "experiment_id": { "title": "Experiment Id", "type": "string" } }, "required": [ "experiment_id" ], "title": "get_experiment_resultsArguments", "type": "object" } } } ] }, "endpoint": "/v1/chat/completions", "model": "gpt-4o" }, "response": { "body": [ { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "", "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_c98e05ca17", "usage": null, "obfuscation": "wwHFAiwvH4WszR" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "The", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "9715Kiw8g6FeU" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " experiment", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "f3RUP" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " ID", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "uTou0sZw0Trqr" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " for", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "O3FUhiRX4t3O" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " '", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "8Row2VeWyXlavX" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "bo", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "R6KU5Aed2Y4hdt" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "iling", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "aXOqmJlIAIp" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "_point", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "AEyQ67P1E9" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "'", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "pxs1ElabWHWYTsE" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " is", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "f4fvZlQAsoFLb" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " `", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "XIUUCRzVlWEjdW" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "exp", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "x2dM9CVkT0ICQ" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "_", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "Ls8dfHOXPeHjdGE" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "004", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "RF1hpcOB964EM" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "`,", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "QnLWon1Lh1bPrb" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " and", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "0OHZT5bnbdwa" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " the", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "jtbU7bWjfj72" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " user", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "nCopvKj1JIE" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " ID", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "2ZDuFZoCixweF" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " for", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "u3QmR0zYiExg" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " '", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "z6tGgyH3Gw667d" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "char", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "HalCDTgB5QRV" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "lie", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "5UJBpMTsZMjVF" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "'", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "p8zU7xEpcUR63Lh" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " is", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "t0fKxlCyUxaFU" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": " `", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "lRSEHqi9mVmVZJ" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "user", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "8C6DeNABBjpJ" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "_", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "L4qXmW7bonqcf97" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "111", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "zje3cRhC3fzKb" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "11", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "NgeVi1nYcUbkmN" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": "`.", "function_call": null, "refusal": null, "role": null, "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_c98e05ca17", "usage": null, "obfuscation": "d83dlilKTeA1RE" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [ { "delta": { "content": null, "function_call": null, "refusal": null, "role": null, "tool_calls": null }, "finish_reason": "stop", "index": 0, "logprobs": null } ], "created": 0, "model": "gpt-4o-2024-08-06", "object": "chat.completion.chunk", "service_tier": "default", "system_fingerprint": "fp_c98e05ca17", "usage": null, "obfuscation": "HnPRpNWz4n" } }, { "__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk", "__data__": { "id": "rec-b376e47c1857", "choices": [], "created": 0, "model": "gpt-4o-2024-08-06", "object": "chat.completion.chunk", "service_tier": "default", "system_fingerprint": "fp_c98e05ca17", "usage": { "completion_tokens": 32, "prompt_tokens": 465, "total_tokens": 497, "completion_tokens_details": { "accepted_prediction_tokens": 0, "audio_tokens": 0, "reasoning_tokens": 0, "rejected_prediction_tokens": 0 }, "prompt_tokens_details": { "audio_tokens": 0, "cached_tokens": 0 } }, "obfuscation": "sfrloH58kmZpA" } } ], "is_streaming": true }, "id_normalization_mapping": {} }