diff --git a/lib/crewai/tests/agents/test_lite_agent.py b/lib/crewai/tests/agents/test_lite_agent.py index 3049847eb..daa17f4e7 100644 --- a/lib/crewai/tests/agents/test_lite_agent.py +++ b/lib/crewai/tests/agents/test_lite_agent.py @@ -268,7 +268,13 @@ async def test_lite_agent_returns_usage_metrics_async(): "What is the population of Tokyo? Return your structured output in JSON format with the following fields: summary, confidence" ) assert isinstance(result, LiteAgentOutput) - assert "21 million" in result.raw or "37 million" in result.raw + # Check for population data in various formats (text or numeric) + assert ( + "21 million" in result.raw + or "37 million" in result.raw + or "21000000" in result.raw + or "37000000" in result.raw + ) assert result.usage_metrics is not None assert result.usage_metrics["total_tokens"] > 0 diff --git a/lib/crewai/tests/cassettes/agents/test_lite_agent_returns_usage_metrics_async.yaml b/lib/crewai/tests/cassettes/agents/test_lite_agent_returns_usage_metrics_async.yaml index 2c838fa0a..1d47a0b36 100644 --- a/lib/crewai/tests/cassettes/agents/test_lite_agent_returns_usage_metrics_async.yaml +++ b/lib/crewai/tests/cassettes/agents/test_lite_agent_returns_usage_metrics_async.yaml @@ -1,202 +1,236 @@ interactions: - request: - body: '{"messages": [{"role": "system", "content": "You are Research Assistant. You are a helpful research assistant who can search for information about the population of Tokyo.\nYour personal goal is: Find information about the population of Tokyo\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nTool Name: search_web\nTool Arguments: {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Search the web for information about a topic.\n\nIMPORTANT: Use the following format in your response:\n\n```\nThought: you should always think about what to do\nAction: the action to take, only one name of [search_web], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple JSON object, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n```\n\nOnce all necessary information is gathered, return the following format:\n\n```\nThought: - I now know the final answer\nFinal Answer: the final answer to the original input question\n```"}, {"role": "user", "content": "What is the population of Tokyo? Return your structured output in JSON format with the following fields: summary, confidence"}], "model": "gpt-4o-mini", "stop": ["\nObservation:"], "stream": false}' + body: '{"messages":[{"role":"system","content":"You are Research Assistant. You + are a helpful research assistant who can search for information about the population + of Tokyo.\nYour personal goal is: Find information about the population of Tokyo"},{"role":"user","content":"\nCurrent + Task: What is the population of Tokyo? Return your structured output in JSON + format with the following fields: summary, confidence\n\nThis is VERY important + to you, your job depends on it!"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"search_web","description":"Search + the web for information about a topic.","parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object"}}}]}' headers: + User-Agent: + - X-USER-AGENT-XXX accept: - application/json accept-encoding: - - gzip, deflate + - ACCEPT-ENCODING-XXX + authorization: + - AUTHORIZATION-XXX connection: - keep-alive content-length: - - '1307' + - '746' content-type: - application/json host: - api.openai.com - user-agent: - - OpenAI/Python 1.93.0 x-stainless-arch: - - arm64 + - X-STAINLESS-ARCH-XXX x-stainless-async: - 'false' x-stainless-lang: - python x-stainless-os: - - MacOS + - X-STAINLESS-OS-XXX x-stainless-package-version: - - 1.93.0 + - 1.83.0 + x-stainless-read-timeout: + - X-STAINLESS-READ-TIMEOUT-XXX x-stainless-retry-count: - '0' x-stainless-runtime: - CPython x-stainless-runtime-version: - - 3.12.9 + - 3.13.3 method: POST uri: https://api.openai.com/v1/chat/completions response: body: - string: "{\n \"id\": \"chatcmpl-CJ4IL9Lrv5uLvy1xI6zDvdRKJZNb4\",\n \"object\": \"chat.completion\",\n \"created\": 1758660777,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```\\nThought: I need to find the current population of Tokyo to provide accurate information.\\nAction: search_web\\nAction Input: {\\\"query\\\":\\\"current population of Tokyo 2023\\\"}\\n```\\n\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 245,\n \"completion_tokens\": 39,\n \"total_tokens\": 284,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\"\ - : 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_560af6e559\"\n}\n" + string: "{\n \"id\": \"chatcmpl-D0tWuVq6ppHxdHXbHiTqbMxcevRfD\",\n \"object\": + \"chat.completion\",\n \"created\": 1769105828,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n + \ \"id\": \"call_OiYZ9WMTDha7FNJEZyo9rc1j\",\n \"type\": + \"function\",\n \"function\": {\n \"name\": \"search_web\",\n + \ \"arguments\": \"{\\\"query\\\":\\\"current population of Tokyo + 2023\\\"}\"\n }\n }\n ],\n \"refusal\": + null,\n \"annotations\": []\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 124,\n \"completion_tokens\": 20,\n \"total_tokens\": 144,\n \"prompt_tokens_details\": + {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": + {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": + 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": + \"default\",\n \"system_fingerprint\": \"fp_c4585b5b9c\"\n}\n" headers: CF-RAY: - - 983cedc3ed1dce58-SJC + - CF-RAY-XXX Connection: - keep-alive Content-Type: - application/json Date: - - Tue, 23 Sep 2025 20:52:58 GMT + - Thu, 22 Jan 2026 18:17:08 GMT Server: - cloudflare Set-Cookie: - - __cf_bm=qN.M._e3GBXz.pvFikVYUJWNrZtECXfy3qiEiGSDhkM-1758660778-1.0.1.1-S.Rb0cyuo6AWn0pda0wa_zWItqO5mW7yYZMhL_dl7n2W7Z9lfDMk_6Ss3WdBJULEVpU61gh7cigu2tcdxdd7_UeSfUcCjhe684Yw3Cgy3tE; path=/; expires=Tue, 23-Sep-25 21:22:58 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None - - _cfuvid=0TVxd.Cye5d8Z7ZJrkx4SlmbSJpaR39lRpqKXy0KRTU-1758660778824-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + - SET-COOKIE-XXX Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload + - STS-XXX Transfer-Encoding: - chunked X-Content-Type-Options: - - nosniff + - X-CONTENT-TYPE-XXX access-control-expose-headers: - - X-Request-ID + - ACCESS-CONTROL-XXX alt-svc: - h3=":443"; ma=86400 cf-cache-status: - DYNAMIC openai-organization: - - crewai-iuxna1 + - OPENAI-ORG-XXX openai-processing-ms: - - '1007' + - '657' openai-project: - - proj_xitITlrFeen7zjNSzML82h9x + - OPENAI-PROJECT-XXX openai-version: - '2020-10-01' x-envoy-upstream-service-time: - - '1170' + - '739' x-openai-proxy-wasm: - v0.1 - x-ratelimit-limit-project-tokens: - - '150000000' x-ratelimit-limit-requests: - - '30000' + - X-RATELIMIT-LIMIT-REQUESTS-XXX x-ratelimit-limit-tokens: - - '150000000' - x-ratelimit-remaining-project-tokens: - - '149999715' + - X-RATELIMIT-LIMIT-TOKENS-XXX x-ratelimit-remaining-requests: - - '29999' + - X-RATELIMIT-REMAINING-REQUESTS-XXX x-ratelimit-remaining-tokens: - - '149999712' - x-ratelimit-reset-project-tokens: - - 0s + - X-RATELIMIT-REMAINING-TOKENS-XXX x-ratelimit-reset-requests: - - 2ms + - X-RATELIMIT-RESET-REQUESTS-XXX x-ratelimit-reset-tokens: - - 0s + - X-RATELIMIT-RESET-TOKENS-XXX x-request-id: - - req_f71c78a53b2f460c80d450ce47a0cc6c + - X-REQUEST-ID-XXX status: code: 200 message: OK - request: - body: '{"messages": [{"role": "system", "content": "You are Research Assistant. You are a helpful research assistant who can search for information about the population of Tokyo.\nYour personal goal is: Find information about the population of Tokyo\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nTool Name: search_web\nTool Arguments: {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Search the web for information about a topic.\n\nIMPORTANT: Use the following format in your response:\n\n```\nThought: you should always think about what to do\nAction: the action to take, only one name of [search_web], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple JSON object, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n```\n\nOnce all necessary information is gathered, return the following format:\n\n```\nThought: - I now know the final answer\nFinal Answer: the final answer to the original input question\n```"}, {"role": "user", "content": "What is the population of Tokyo? Return your structured output in JSON format with the following fields: summary, confidence"}, {"role": "assistant", "content": "```\nThought: I need to find the current population of Tokyo to provide accurate information.\nAction: search_web\nAction Input: {\"query\":\"current population of Tokyo 2023\"}\n```\n\nObservation: Tokyo''s population in 2023 was approximately 21 million people in the city proper, and 37 million in the greater metropolitan area."}], "model": "gpt-4o-mini", "stop": ["\nObservation:"], "stream": false}' + body: '{"messages":[{"role":"system","content":"You are Research Assistant. You + are a helpful research assistant who can search for information about the population + of Tokyo.\nYour personal goal is: Find information about the population of Tokyo"},{"role":"user","content":"\nCurrent + Task: What is the population of Tokyo? Return your structured output in JSON + format with the following fields: summary, confidence\n\nThis is VERY important + to you, your job depends on it!"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_OiYZ9WMTDha7FNJEZyo9rc1j","type":"function","function":{"name":"search_web","arguments":"{\"query\":\"current + population of Tokyo 2023\"}"}}]},{"role":"tool","tool_call_id":"call_OiYZ9WMTDha7FNJEZyo9rc1j","content":"Tokyo''s + population in 2023 was approximately 21 million people in the city proper, and + 37 million in the greater metropolitan area."},{"role":"user","content":"Analyze + the tool result. If requirements are met, provide the Final Answer. Otherwise, + call the next tool. Deliver only the answer without meta-commentary."}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"search_web","description":"Search + the web for information about a topic.","parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object"}}}]}' headers: + User-Agent: + - X-USER-AGENT-XXX accept: - application/json accept-encoding: - - gzip, deflate + - ACCEPT-ENCODING-XXX + authorization: + - AUTHORIZATION-XXX connection: - keep-alive content-length: - - '1675' + - '1341' content-type: - application/json cookie: - - __cf_bm=qN.M._e3GBXz.pvFikVYUJWNrZtECXfy3qiEiGSDhkM-1758660778-1.0.1.1-S.Rb0cyuo6AWn0pda0wa_zWItqO5mW7yYZMhL_dl7n2W7Z9lfDMk_6Ss3WdBJULEVpU61gh7cigu2tcdxdd7_UeSfUcCjhe684Yw3Cgy3tE; _cfuvid=0TVxd.Cye5d8Z7ZJrkx4SlmbSJpaR39lRpqKXy0KRTU-1758660778824-0.0.1.1-604800000 + - COOKIE-XXX host: - api.openai.com - user-agent: - - OpenAI/Python 1.93.0 x-stainless-arch: - - arm64 + - X-STAINLESS-ARCH-XXX x-stainless-async: - 'false' x-stainless-lang: - python x-stainless-os: - - MacOS + - X-STAINLESS-OS-XXX x-stainless-package-version: - - 1.93.0 + - 1.83.0 + x-stainless-read-timeout: + - X-STAINLESS-READ-TIMEOUT-XXX x-stainless-retry-count: - '0' x-stainless-runtime: - CPython x-stainless-runtime-version: - - 3.12.9 + - 3.13.3 method: POST uri: https://api.openai.com/v1/chat/completions response: body: - string: "{\n \"id\": \"chatcmpl-CJ4IM0EqgCOVcjLCap3abh4ERIkB8\",\n \"object\": \"chat.completion\",\n \"created\": 1758660778,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```\\nThought: I now know the final answer\\nFinal Answer: {\\n \\\"summary\\\": \\\"As of 2023, the population of Tokyo is approximately 21 million people in the city proper and around 37 million in the greater metropolitan area.\\\",\\n \\\"confidence\\\": \\\"high\\\"\\n}\\n```\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 318,\n \"completion_tokens\": 60,\n \"total_tokens\": 378,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\"\ - : 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_560af6e559\"\n}\n" + string: "{\n \"id\": \"chatcmpl-D0tWv4vUNd0xdFfxXVtTzHtH7hXo2\",\n \"object\": + \"chat.completion\",\n \"created\": 1769105829,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"{\\n \\\"summary\\\": {\\n \\\"city_proper_population\\\": + 21000000,\\n \\\"greater_metropolitan_population\\\": 37000000\\n },\\n + \ \\\"confidence\\\": \\\"high\\\"\\n}\",\n \"refusal\": null,\n \"annotations\": + []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n + \ }\n ],\n \"usage\": {\n \"prompt_tokens\": 215,\n \"completion_tokens\": + 41,\n \"total_tokens\": 256,\n \"prompt_tokens_details\": {\n \"cached_tokens\": + 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": + {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": + 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": + \"default\",\n \"system_fingerprint\": \"fp_c4585b5b9c\"\n}\n" headers: CF-RAY: - - 983cedcbdf08ce58-SJC + - CF-RAY-XXX Connection: - keep-alive Content-Type: - application/json Date: - - Tue, 23 Sep 2025 20:53:00 GMT + - Thu, 22 Jan 2026 18:17:10 GMT Server: - cloudflare Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload + - STS-XXX Transfer-Encoding: - chunked X-Content-Type-Options: - - nosniff + - X-CONTENT-TYPE-XXX access-control-expose-headers: - - X-Request-ID + - ACCESS-CONTROL-XXX alt-svc: - h3=":443"; ma=86400 cf-cache-status: - DYNAMIC openai-organization: - - crewai-iuxna1 + - OPENAI-ORG-XXX openai-processing-ms: - - '1731' + - '1088' openai-project: - - proj_xitITlrFeen7zjNSzML82h9x + - OPENAI-PROJECT-XXX openai-version: - '2020-10-01' x-envoy-upstream-service-time: - - '1754' + - '1351' x-openai-proxy-wasm: - v0.1 - x-ratelimit-limit-project-tokens: - - '150000000' x-ratelimit-limit-requests: - - '30000' + - X-RATELIMIT-LIMIT-REQUESTS-XXX x-ratelimit-limit-tokens: - - '150000000' - x-ratelimit-remaining-project-tokens: - - '149999632' + - X-RATELIMIT-LIMIT-TOKENS-XXX x-ratelimit-remaining-requests: - - '29999' + - X-RATELIMIT-REMAINING-REQUESTS-XXX x-ratelimit-remaining-tokens: - - '149999632' - x-ratelimit-reset-project-tokens: - - 0s + - X-RATELIMIT-REMAINING-TOKENS-XXX x-ratelimit-reset-requests: - - 2ms + - X-RATELIMIT-RESET-REQUESTS-XXX x-ratelimit-reset-tokens: - - 0s + - X-RATELIMIT-RESET-TOKENS-XXX x-request-id: - - req_b363b74b736d47bb85a0c6ba41a10b22 + - X-REQUEST-ID-XXX status: code: 200 message: OK diff --git a/lib/crewai/tests/cassettes/agents/test_lite_agent_with_tools.yaml b/lib/crewai/tests/cassettes/agents/test_lite_agent_with_tools.yaml index 3585f38aa..81c89e392 100644 --- a/lib/crewai/tests/cassettes/agents/test_lite_agent_with_tools.yaml +++ b/lib/crewai/tests/cassettes/agents/test_lite_agent_with_tools.yaml @@ -1,521 +1,477 @@ interactions: - request: - body: '{"messages": [{"role": "system", "content": "You are Research Assistant. - You are a helpful research assistant who can search for information about the - population of Tokyo.\nYour personal goal is: Find information about the population - of Tokyo\n\nYou ONLY have access to the following tools, and should NEVER make - up tools that are not listed here:\n\nTool Name: search_web\nTool Arguments: - {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Search - the web for information about a topic.\n\nIMPORTANT: Use the following format - in your response:\n\n```\nThought: you should always think about what to do\nAction: - the action to take, only one name of [search_web], just the name, exactly as - it''s written.\nAction Input: the input to the action, just a simple JSON object, - enclosed in curly braces, using \" to wrap keys and values.\nObservation: the - result of the action\n```\n\nOnce all necessary information is gathered, return - the following format:\n\n```\nThought: I now know the final answer\nFinal Answer: - the final answer to the original input question\n```"}, {"role": "user", "content": - "What is the population of Tokyo and how many people would that be per square - kilometer if Tokyo''s area is 2,194 square kilometers?"}], "model": "gpt-4o-mini", - "stop": []}' + body: '{"messages":[{"role":"system","content":"You are Research Assistant. You + are a helpful research assistant who can search for information about the population + of Tokyo.\nYour personal goal is: Find information about the population of Tokyo"},{"role":"user","content":"\nCurrent + Task: What is the population of Tokyo and how many people would that be per + square kilometer if Tokyo''s area is 2,194 square kilometers?\n\nThis is VERY + important to you, your job depends on it!"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"search_web","description":"Search + the web for information about a topic.","parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object"}}}]}' headers: + User-Agent: + - X-USER-AGENT-XXX accept: - application/json accept-encoding: - - gzip, deflate, zstd + - ACCEPT-ENCODING-XXX + authorization: + - AUTHORIZATION-XXX connection: - keep-alive content-length: - - '1280' + - '752' content-type: - application/json host: - api.openai.com - user-agent: - - OpenAI/Python 1.68.2 x-stainless-arch: - - arm64 + - X-STAINLESS-ARCH-XXX x-stainless-async: - 'false' x-stainless-lang: - python x-stainless-os: - - MacOS + - X-STAINLESS-OS-XXX x-stainless-package-version: - - 1.68.2 - x-stainless-raw-response: - - 'true' + - 1.83.0 x-stainless-read-timeout: - - '600.0' + - X-STAINLESS-READ-TIMEOUT-XXX x-stainless-retry-count: - '0' x-stainless-runtime: - CPython x-stainless-runtime-version: - - 3.12.8 + - 3.13.3 method: POST uri: https://api.openai.com/v1/chat/completions response: - content: "{\n \"id\": \"chatcmpl-BHEnpxAj1kSC6XAUxC3lDuHZzp4T9\",\n \"object\": - \"chat.completion\",\n \"created\": 1743448177,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n - \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": - \"assistant\",\n \"content\": \"```\\nThought: I need to find the current - population of Tokyo to calculate the population density.\\nAction: search_web\\nAction - Input: {\\\"query\\\":\\\"current population of Tokyo 2023\\\"}\\n```\\n\",\n - \ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": - null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": - 251,\n \"completion_tokens\": 41,\n \"total_tokens\": 292,\n \"prompt_tokens_details\": - {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": - {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": - 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": - \"default\",\n \"system_fingerprint\": \"fp_b376dfbbd5\"\n}\n" + body: + string: "{\n \"id\": \"chatcmpl-D0tWEY5aWisWibS5wCCRZd8EtOeCC\",\n \"object\": + \"chat.completion\",\n \"created\": 1769105786,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n + \ \"id\": \"call_SDEJLw8giXTnpn5F0rSPgSO6\",\n \"type\": + \"function\",\n \"function\": {\n \"name\": \"search_web\",\n + \ \"arguments\": \"{\\\"query\\\":\\\"current population of Tokyo + 2023\\\"}\"\n }\n }\n ],\n \"refusal\": + null,\n \"annotations\": []\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 129,\n \"completion_tokens\": 20,\n \"total_tokens\": 149,\n \"prompt_tokens_details\": + {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": + {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": + 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": + \"default\",\n \"system_fingerprint\": \"fp_c4585b5b9c\"\n}\n" headers: CF-RAY: - - 929224621caa15b4-SJC + - CF-RAY-XXX Connection: - keep-alive Content-Type: - application/json Date: - - Mon, 31 Mar 2025 19:09:38 GMT + - Thu, 22 Jan 2026 18:16:26 GMT Server: - cloudflare Set-Cookie: - - __cf_bm=lFp0qMEF8XsDLnRNgKznAW30x4CW7Ov_R_1y90OvOPo-1743448178-1.0.1.1-n9T6ffJvOtX6aaUCbbMDNY6KEq3d3ajgtZi7hUklSw4SGBd1Ev.HK8fQe6pxQbU5MsOb06j7e1taxo5SRxUkXp9KxrzUSPZ.oomnIgOHjLk; - path=/; expires=Mon, 31-Mar-25 19:39:38 GMT; domain=.api.openai.com; HttpOnly; - Secure; SameSite=None - - _cfuvid=QPN2C5j8nyEThYQY2uARI13U6EWRRnrF_6XLns6RuQw-1743448178193-0.0.1.1-604800000; - path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None + - SET-COOKIE-XXX + Strict-Transport-Security: + - STS-XXX Transfer-Encoding: - chunked X-Content-Type-Options: - - nosniff + - X-CONTENT-TYPE-XXX access-control-expose-headers: - - X-Request-ID + - ACCESS-CONTROL-XXX alt-svc: - h3=":443"; ma=86400 cf-cache-status: - DYNAMIC openai-organization: - - crewai-iuxna1 + - OPENAI-ORG-XXX openai-processing-ms: - - '1156' + - '646' + openai-project: + - OPENAI-PROJECT-XXX openai-version: - '2020-10-01' - strict-transport-security: - - max-age=31536000; includeSubDomains; preload + x-envoy-upstream-service-time: + - '666' + x-openai-proxy-wasm: + - v0.1 x-ratelimit-limit-requests: - - '30000' + - X-RATELIMIT-LIMIT-REQUESTS-XXX x-ratelimit-limit-tokens: - - '150000000' + - X-RATELIMIT-LIMIT-TOKENS-XXX x-ratelimit-remaining-requests: - - '29999' + - X-RATELIMIT-REMAINING-REQUESTS-XXX x-ratelimit-remaining-tokens: - - '149999711' + - X-RATELIMIT-REMAINING-TOKENS-XXX x-ratelimit-reset-requests: - - 2ms + - X-RATELIMIT-RESET-REQUESTS-XXX x-ratelimit-reset-tokens: - - 0s + - X-RATELIMIT-RESET-TOKENS-XXX x-request-id: - - req_4e6d771474288d33bdec811401977c80 - http_version: HTTP/1.1 - status_code: 200 -- request: - body: '{"messages": [{"role": "system", "content": "You are Research Assistant. - You are a helpful research assistant who can search for information about the - population of Tokyo.\nYour personal goal is: Find information about the population - of Tokyo\n\nYou ONLY have access to the following tools, and should NEVER make - up tools that are not listed here:\n\nTool Name: search_web\nTool Arguments: - {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Search - the web for information about a topic.\n\nIMPORTANT: Use the following format - in your response:\n\n```\nThought: you should always think about what to do\nAction: - the action to take, only one name of [search_web], just the name, exactly as - it''s written.\nAction Input: the input to the action, just a simple JSON object, - enclosed in curly braces, using \" to wrap keys and values.\nObservation: the - result of the action\n```\n\nOnce all necessary information is gathered, return - the following format:\n\n```\nThought: I now know the final answer\nFinal Answer: - the final answer to the original input question\n```"}, {"role": "user", "content": - "What is the population of Tokyo and how many people would that be per square - kilometer if Tokyo''s area is 2,194 square kilometers?"}, {"role": "assistant", - "content": "```\nThought: I need to find the current population of Tokyo to - calculate the population density.\nAction: search_web\nAction Input: {\"query\":\"current - population of Tokyo 2023\"}\n```\n\nObservation: Tokyo''s population in 2023 - was approximately 21 million people in the city proper, and 37 million in the - greater metropolitan area."}], "model": "gpt-4o-mini", "stop": []}' - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate, zstd - connection: - - keep-alive - content-length: - - '1652' - content-type: - - application/json - cookie: - - __cf_bm=lFp0qMEF8XsDLnRNgKznAW30x4CW7Ov_R_1y90OvOPo-1743448178-1.0.1.1-n9T6ffJvOtX6aaUCbbMDNY6KEq3d3ajgtZi7hUklSw4SGBd1Ev.HK8fQe6pxQbU5MsOb06j7e1taxo5SRxUkXp9KxrzUSPZ.oomnIgOHjLk; - _cfuvid=QPN2C5j8nyEThYQY2uARI13U6EWRRnrF_6XLns6RuQw-1743448178193-0.0.1.1-604800000 - host: - - api.openai.com - user-agent: - - OpenAI/Python 1.68.2 - x-stainless-arch: - - arm64 - x-stainless-async: - - 'false' - x-stainless-lang: - - python - x-stainless-os: - - MacOS - x-stainless-package-version: - - 1.68.2 - x-stainless-raw-response: - - 'true' - x-stainless-read-timeout: - - '600.0' - x-stainless-retry-count: - - '0' - x-stainless-runtime: - - CPython - x-stainless-runtime-version: - - 3.12.8 - method: POST - uri: https://api.openai.com/v1/chat/completions - response: - content: "{\n \"id\": \"chatcmpl-BHEnqB0VnEIObehNbRRxGmyYyAru0\",\n \"object\": - \"chat.completion\",\n \"created\": 1743448178,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n - \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": - \"assistant\",\n \"content\": \"```\\nThought: I have found that the - population of Tokyo is approximately 21 million people. Now, I need to calculate - the population density using the area of 2,194 square kilometers.\\n```\\n\\nPopulation - Density = Population / Area = 21,000,000 / 2,194 \u2248 9,570 people per square - kilometer.\\n\\n```\\nFinal Answer: The population of Tokyo is approximately - 21 million people, resulting in a population density of about 9,570 people per - square kilometer.\\n```\",\n \"refusal\": null,\n \"annotations\": - []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n - \ }\n ],\n \"usage\": {\n \"prompt_tokens\": 325,\n \"completion_tokens\": - 104,\n \"total_tokens\": 429,\n \"prompt_tokens_details\": {\n \"cached_tokens\": - 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n - \ \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": - 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": - \"default\",\n \"system_fingerprint\": \"fp_b376dfbbd5\"\n}\n" - headers: - CF-RAY: - - 9292246a3c7c15b4-SJC - Connection: - - keep-alive - Content-Type: - - application/json - Date: - - Mon, 31 Mar 2025 19:09:40 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: - - crewai-iuxna1 - openai-processing-ms: - - '1796' - openai-version: - - '2020-10-01' - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - x-ratelimit-limit-requests: - - '30000' - x-ratelimit-limit-tokens: - - '150000000' - x-ratelimit-remaining-requests: - - '29999' - x-ratelimit-remaining-tokens: - - '149999630' - x-ratelimit-reset-requests: - - 2ms - x-ratelimit-reset-tokens: - - 0s - x-request-id: - - req_73c3da7f5c7f244a8b4790cd2a686127 - http_version: HTTP/1.1 - status_code: 200 -- request: - body: !!binary | - Cs4BCiQKIgoMc2VydmljZS5uYW1lEhIKEGNyZXdBSS10ZWxlbWV0cnkSpQEKEgoQY3Jld2FpLnRl - bGVtZXRyeRKOAQoQIy0eVsjB7Rn1tmA3fvylUxIIP0BZv2JQ6vAqClRvb2wgVXNhZ2UwATmgHXCF - 4fgxGEEgZ4OF4fgxGEobCg5jcmV3YWlfdmVyc2lvbhIJCgcwLjEwOC4wShkKCXRvb2xfbmFtZRIM - CgpzZWFyY2hfd2ViSg4KCGF0dGVtcHRzEgIYAXoCGAGFAQABAAA= - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, zstd - Connection: - - keep-alive - Content-Length: - - '209' - Content-Type: - - application/x-protobuf - User-Agent: - - OTel-OTLP-Exporter-Python/1.31.1 - method: POST - uri: https://telemetry.crewai.com:4319/v1/traces - response: - body: - string: "\n\0" - headers: - Content-Length: - - '2' - Content-Type: - - application/x-protobuf - Date: - - Mon, 31 Mar 2025 19:09:40 GMT + - X-REQUEST-ID-XXX status: code: 200 message: OK - request: - body: '{"messages": [{"role": "system", "content": "You are Research Assistant. - You are a helpful research assistant who can search for information about the - population of Tokyo.\nYour personal goal is: Find information about the population - of Tokyo\n\nYou ONLY have access to the following tools, and should NEVER make - up tools that are not listed here:\n\nTool Name: search_web\nTool Arguments: - {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Search - the web for information about a topic.\n\nIMPORTANT: Use the following format - in your response:\n\n```\nThought: you should always think about what to do\nAction: - the action to take, only one name of [search_web], just the name, exactly as - it''s written.\nAction Input: the input to the action, just a simple JSON object, - enclosed in curly braces, using \" to wrap keys and values.\nObservation: the - result of the action\n```\n\nOnce all necessary information is gathered, return - the following format:\n\n```\nThought: I now know the final answer\nFinal Answer: - the final answer to the original input question\n```"}, {"role": "user", "content": - "What are the effects of climate change on coral reefs?"}], "model": "gpt-4o-mini", - "stop": []}' + body: '{"messages":[{"role":"system","content":"You are Research Assistant. You + are a helpful research assistant who can search for information about the population + of Tokyo.\nYour personal goal is: Find information about the population of Tokyo"},{"role":"user","content":"\nCurrent + Task: What is the population of Tokyo and how many people would that be per + square kilometer if Tokyo''s area is 2,194 square kilometers?\n\nThis is VERY + important to you, your job depends on it!"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_SDEJLw8giXTnpn5F0rSPgSO6","type":"function","function":{"name":"search_web","arguments":"{\"query\":\"current + population of Tokyo 2023\"}"}}]},{"role":"tool","tool_call_id":"call_SDEJLw8giXTnpn5F0rSPgSO6","content":"Tokyo''s + population in 2023 was approximately 21 million people in the city proper, and + 37 million in the greater metropolitan area."},{"role":"user","content":"Analyze + the tool result. If requirements are met, provide the Final Answer. Otherwise, + call the next tool. Deliver only the answer without meta-commentary."}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"search_web","description":"Search + the web for information about a topic.","parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object"}}}]}' headers: + User-Agent: + - X-USER-AGENT-XXX accept: - application/json accept-encoding: - - gzip, deflate, zstd + - ACCEPT-ENCODING-XXX + authorization: + - AUTHORIZATION-XXX connection: - keep-alive content-length: - - '1204' + - '1347' content-type: - application/json cookie: - - __cf_bm=lFp0qMEF8XsDLnRNgKznAW30x4CW7Ov_R_1y90OvOPo-1743448178-1.0.1.1-n9T6ffJvOtX6aaUCbbMDNY6KEq3d3ajgtZi7hUklSw4SGBd1Ev.HK8fQe6pxQbU5MsOb06j7e1taxo5SRxUkXp9KxrzUSPZ.oomnIgOHjLk; - _cfuvid=QPN2C5j8nyEThYQY2uARI13U6EWRRnrF_6XLns6RuQw-1743448178193-0.0.1.1-604800000 + - COOKIE-XXX host: - api.openai.com - user-agent: - - OpenAI/Python 1.68.2 x-stainless-arch: - - arm64 + - X-STAINLESS-ARCH-XXX x-stainless-async: - 'false' x-stainless-lang: - python x-stainless-os: - - MacOS + - X-STAINLESS-OS-XXX x-stainless-package-version: - - 1.68.2 - x-stainless-raw-response: - - 'true' + - 1.83.0 x-stainless-read-timeout: - - '600.0' + - X-STAINLESS-READ-TIMEOUT-XXX x-stainless-retry-count: - '0' x-stainless-runtime: - CPython x-stainless-runtime-version: - - 3.12.8 + - 3.13.3 method: POST uri: https://api.openai.com/v1/chat/completions response: - content: "{\n \"id\": \"chatcmpl-BHEnsVlmHXlessiDjYgHjd6Cz2hlT\",\n \"object\": - \"chat.completion\",\n \"created\": 1743448180,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n - \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": - \"assistant\",\n \"content\": \"```\\nThought: I should search for information - about the effects of climate change on coral reefs.\\nAction: search_web\\nAction - Input: {\\\"query\\\":\\\"effects of climate change on coral reefs\\\"}\\n```\\n\",\n - \ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": - null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": - 234,\n \"completion_tokens\": 41,\n \"total_tokens\": 275,\n \"prompt_tokens_details\": - {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": - {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": - 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": - \"default\",\n \"system_fingerprint\": \"fp_b376dfbbd5\"\n}\n" + body: + string: "{\n \"id\": \"chatcmpl-D0tWFH0RTZQzqCOqB6oE7YaXUpwpt\",\n \"object\": + \"chat.completion\",\n \"created\": 1769105787,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"The population of Tokyo in 2023 is + approximately 21 million people. Given Tokyo's area of 2,194 square kilometers, + the population density is about 9,573 people per square kilometer.\",\n \"refusal\": + null,\n \"annotations\": []\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 220,\n \"completion_tokens\": 42,\n \"total_tokens\": 262,\n \"prompt_tokens_details\": + {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": + {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": + 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": + \"default\",\n \"system_fingerprint\": \"fp_c4585b5b9c\"\n}\n" headers: CF-RAY: - - 92922476092e15b4-SJC + - CF-RAY-XXX Connection: - keep-alive Content-Type: - application/json Date: - - Mon, 31 Mar 2025 19:09:41 GMT + - Thu, 22 Jan 2026 18:16:27 GMT Server: - cloudflare + Strict-Transport-Security: + - STS-XXX Transfer-Encoding: - chunked X-Content-Type-Options: - - nosniff + - X-CONTENT-TYPE-XXX access-control-expose-headers: - - X-Request-ID + - ACCESS-CONTROL-XXX alt-svc: - h3=":443"; ma=86400 cf-cache-status: - DYNAMIC openai-organization: - - crewai-iuxna1 + - OPENAI-ORG-XXX openai-processing-ms: - - '1057' + - '907' + openai-project: + - OPENAI-PROJECT-XXX openai-version: - '2020-10-01' - strict-transport-security: - - max-age=31536000; includeSubDomains; preload + x-envoy-upstream-service-time: + - '973' + x-openai-proxy-wasm: + - v0.1 x-ratelimit-limit-requests: - - '30000' + - X-RATELIMIT-LIMIT-REQUESTS-XXX x-ratelimit-limit-tokens: - - '150000000' + - X-RATELIMIT-LIMIT-TOKENS-XXX x-ratelimit-remaining-requests: - - '29999' + - X-RATELIMIT-REMAINING-REQUESTS-XXX x-ratelimit-remaining-tokens: - - '149999730' + - X-RATELIMIT-REMAINING-TOKENS-XXX x-ratelimit-reset-requests: - - 2ms + - X-RATELIMIT-RESET-REQUESTS-XXX x-ratelimit-reset-tokens: - - 0s + - X-RATELIMIT-RESET-TOKENS-XXX x-request-id: - - req_0db30a142a72b224c52d2388deef7200 - http_version: HTTP/1.1 - status_code: 200 + - X-REQUEST-ID-XXX + status: + code: 200 + message: OK - request: - body: '{"messages": [{"role": "system", "content": "You are Research Assistant. - You are a helpful research assistant who can search for information about the - population of Tokyo.\nYour personal goal is: Find information about the population - of Tokyo\n\nYou ONLY have access to the following tools, and should NEVER make - up tools that are not listed here:\n\nTool Name: search_web\nTool Arguments: - {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Search - the web for information about a topic.\n\nIMPORTANT: Use the following format - in your response:\n\n```\nThought: you should always think about what to do\nAction: - the action to take, only one name of [search_web], just the name, exactly as - it''s written.\nAction Input: the input to the action, just a simple JSON object, - enclosed in curly braces, using \" to wrap keys and values.\nObservation: the - result of the action\n```\n\nOnce all necessary information is gathered, return - the following format:\n\n```\nThought: I now know the final answer\nFinal Answer: - the final answer to the original input question\n```"}, {"role": "user", "content": - "What are the effects of climate change on coral reefs?"}, {"role": "assistant", - "content": "```\nThought: I should search for information about the effects - of climate change on coral reefs.\nAction: search_web\nAction Input: {\"query\":\"effects - of climate change on coral reefs\"}\n```\n\nObservation: Climate change severely - impacts coral reefs through: 1) Ocean warming causing coral bleaching, 2) Ocean - acidification reducing calcification, 3) Sea level rise affecting light availability, - 4) Increased storm frequency damaging reef structures. Sources: NOAA Coral Reef - Conservation Program, Global Coral Reef Alliance."}], "model": "gpt-4o-mini", - "stop": []}' + body: '{"messages":[{"role":"system","content":"You are Research Assistant. You + are a helpful research assistant who can search for information about the population + of Tokyo.\nYour personal goal is: Find information about the population of Tokyo"},{"role":"user","content":"\nCurrent + Task: What are the effects of climate change on coral reefs?\n\nThis is VERY + important to you, your job depends on it!"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"search_web","description":"Search + the web for information about a topic.","parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object"}}}]}' headers: + User-Agent: + - X-USER-AGENT-XXX accept: - application/json accept-encoding: - - gzip, deflate, zstd + - ACCEPT-ENCODING-XXX + authorization: + - AUTHORIZATION-XXX connection: - keep-alive content-length: - - '1772' + - '676' content-type: - application/json cookie: - - __cf_bm=lFp0qMEF8XsDLnRNgKznAW30x4CW7Ov_R_1y90OvOPo-1743448178-1.0.1.1-n9T6ffJvOtX6aaUCbbMDNY6KEq3d3ajgtZi7hUklSw4SGBd1Ev.HK8fQe6pxQbU5MsOb06j7e1taxo5SRxUkXp9KxrzUSPZ.oomnIgOHjLk; - _cfuvid=QPN2C5j8nyEThYQY2uARI13U6EWRRnrF_6XLns6RuQw-1743448178193-0.0.1.1-604800000 + - COOKIE-XXX host: - api.openai.com - user-agent: - - OpenAI/Python 1.68.2 x-stainless-arch: - - arm64 + - X-STAINLESS-ARCH-XXX x-stainless-async: - 'false' x-stainless-lang: - python x-stainless-os: - - MacOS + - X-STAINLESS-OS-XXX x-stainless-package-version: - - 1.68.2 - x-stainless-raw-response: - - 'true' + - 1.83.0 x-stainless-read-timeout: - - '600.0' + - X-STAINLESS-READ-TIMEOUT-XXX x-stainless-retry-count: - '0' x-stainless-runtime: - CPython x-stainless-runtime-version: - - 3.12.8 + - 3.13.3 method: POST uri: https://api.openai.com/v1/chat/completions response: - content: "{\n \"id\": \"chatcmpl-BHEntjDYNZqWsFxx678q6KZguXh2w\",\n \"object\": - \"chat.completion\",\n \"created\": 1743448181,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n - \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": - \"assistant\",\n \"content\": \"```\\nThought: I now know the final answer\\nFinal - Answer: Climate change affects coral reefs primarily through ocean warming leading - to coral bleaching, ocean acidification reducing calcification, increased sea - level affecting light availability, and more frequent storms damaging reef structures.\\n```\",\n - \ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": - null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": - 340,\n \"completion_tokens\": 52,\n \"total_tokens\": 392,\n \"prompt_tokens_details\": - {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": - {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": - 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": - \"default\",\n \"system_fingerprint\": \"fp_86d0290411\"\n}\n" + body: + string: "{\n \"id\": \"chatcmpl-D0tWGhLco3obH1zYP6PqrxHOzr58H\",\n \"object\": + \"chat.completion\",\n \"created\": 1769105788,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n + \ \"id\": \"call_2QbttIDG2E7pyHGU5y0VMZYI\",\n \"type\": + \"function\",\n \"function\": {\n \"name\": \"search_web\",\n + \ \"arguments\": \"{\\\"query\\\":\\\"effects of climate change + on coral reefs\\\"}\"\n }\n }\n ],\n \"refusal\": + null,\n \"annotations\": []\n },\n \"logprobs\": null,\n + \ \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": + 112,\n \"completion_tokens\": 20,\n \"total_tokens\": 132,\n \"prompt_tokens_details\": + {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": + {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": + 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": + \"default\",\n \"system_fingerprint\": \"fp_c4585b5b9c\"\n}\n" headers: CF-RAY: - - 9292247d48ac15b4-SJC + - CF-RAY-XXX Connection: - keep-alive Content-Type: - application/json Date: - - Mon, 31 Mar 2025 19:09:42 GMT + - Thu, 22 Jan 2026 18:16:28 GMT Server: - cloudflare + Strict-Transport-Security: + - STS-XXX Transfer-Encoding: - chunked X-Content-Type-Options: - - nosniff + - X-CONTENT-TYPE-XXX access-control-expose-headers: - - X-Request-ID + - ACCESS-CONTROL-XXX alt-svc: - h3=":443"; ma=86400 cf-cache-status: - DYNAMIC openai-organization: - - crewai-iuxna1 + - OPENAI-ORG-XXX openai-processing-ms: - - '952' + - '567' + openai-project: + - OPENAI-PROJECT-XXX openai-version: - '2020-10-01' - strict-transport-security: - - max-age=31536000; includeSubDomains; preload + x-envoy-upstream-service-time: + - '584' + x-openai-proxy-wasm: + - v0.1 x-ratelimit-limit-requests: - - '30000' + - X-RATELIMIT-LIMIT-REQUESTS-XXX x-ratelimit-limit-tokens: - - '150000000' + - X-RATELIMIT-LIMIT-TOKENS-XXX x-ratelimit-remaining-requests: - - '29999' + - X-RATELIMIT-REMAINING-REQUESTS-XXX x-ratelimit-remaining-tokens: - - '149999599' + - X-RATELIMIT-REMAINING-TOKENS-XXX x-ratelimit-reset-requests: - - 2ms + - X-RATELIMIT-RESET-REQUESTS-XXX x-ratelimit-reset-tokens: - - 0s + - X-RATELIMIT-RESET-TOKENS-XXX x-request-id: - - req_7529bbfbafb1a594022d8d25e41ba109 - http_version: HTTP/1.1 - status_code: 200 + - X-REQUEST-ID-XXX + status: + code: 200 + message: OK +- request: + body: '{"messages":[{"role":"system","content":"You are Research Assistant. You + are a helpful research assistant who can search for information about the population + of Tokyo.\nYour personal goal is: Find information about the population of Tokyo"},{"role":"user","content":"\nCurrent + Task: What are the effects of climate change on coral reefs?\n\nThis is VERY + important to you, your job depends on it!"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_2QbttIDG2E7pyHGU5y0VMZYI","type":"function","function":{"name":"search_web","arguments":"{\"query\":\"effects + of climate change on coral reefs\"}"}}]},{"role":"tool","tool_call_id":"call_2QbttIDG2E7pyHGU5y0VMZYI","content":"Climate + change severely impacts coral reefs through: 1) Ocean warming causing coral + bleaching, 2) Ocean acidification reducing calcification, 3) Sea level rise + affecting light availability, 4) Increased storm frequency damaging reef structures. + Sources: NOAA Coral Reef Conservation Program, Global Coral Reef Alliance."},{"role":"user","content":"Analyze + the tool result. If requirements are met, provide the Final Answer. Otherwise, + call the next tool. Deliver only the answer without meta-commentary."}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"search_web","description":"Search + the web for information about a topic.","parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object"}}}]}' + headers: + User-Agent: + - X-USER-AGENT-XXX + accept: + - application/json + accept-encoding: + - ACCEPT-ENCODING-XXX + authorization: + - AUTHORIZATION-XXX + connection: + - keep-alive + content-length: + - '1467' + content-type: + - application/json + cookie: + - COOKIE-XXX + host: + - api.openai.com + x-stainless-arch: + - X-STAINLESS-ARCH-XXX + x-stainless-async: + - 'false' + x-stainless-lang: + - python + x-stainless-os: + - X-STAINLESS-OS-XXX + x-stainless-package-version: + - 1.83.0 + x-stainless-read-timeout: + - X-STAINLESS-READ-TIMEOUT-XXX + x-stainless-retry-count: + - '0' + x-stainless-runtime: + - CPython + x-stainless-runtime-version: + - 3.13.3 + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: "{\n \"id\": \"chatcmpl-D0tWGy9RIEM5ioFwhUbwGssr4LoAo\",\n \"object\": + \"chat.completion\",\n \"created\": 1769105788,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n + \ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": + \"assistant\",\n \"content\": \"Climate change severely impacts coral + reefs through the following effects:\\n\\n1. Ocean warming leads to coral + bleaching, which occurs when corals expel the symbiotic algae (zooxanthellae) + that provide them with food and color.\\n2. Ocean acidification reduces the + ability of corals to calcify and build their skeletons, weakening their structures.\\n3. + Sea level rise affects light availability, which is crucial for coral photosynthesis.\\n4. + Increased storm frequency and intensity result in physical damage to reef + structures.\",\n \"refusal\": null,\n \"annotations\": []\n + \ },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n + \ ],\n \"usage\": {\n \"prompt_tokens\": 235,\n \"completion_tokens\": + 103,\n \"total_tokens\": 338,\n \"prompt_tokens_details\": {\n \"cached_tokens\": + 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": + {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": + 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": + \"default\",\n \"system_fingerprint\": \"fp_c4585b5b9c\"\n}\n" + headers: + CF-RAY: + - CF-RAY-XXX + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Thu, 22 Jan 2026 18:16:31 GMT + Server: + - cloudflare + Strict-Transport-Security: + - STS-XXX + Transfer-Encoding: + - chunked + X-Content-Type-Options: + - X-CONTENT-TYPE-XXX + access-control-expose-headers: + - ACCESS-CONTROL-XXX + alt-svc: + - h3=":443"; ma=86400 + cf-cache-status: + - DYNAMIC + openai-organization: + - OPENAI-ORG-XXX + openai-processing-ms: + - '2311' + openai-project: + - OPENAI-PROJECT-XXX + openai-version: + - '2020-10-01' + x-envoy-upstream-service-time: + - '2408' + x-openai-proxy-wasm: + - v0.1 + x-ratelimit-limit-requests: + - X-RATELIMIT-LIMIT-REQUESTS-XXX + x-ratelimit-limit-tokens: + - X-RATELIMIT-LIMIT-TOKENS-XXX + x-ratelimit-remaining-requests: + - X-RATELIMIT-REMAINING-REQUESTS-XXX + x-ratelimit-remaining-tokens: + - X-RATELIMIT-REMAINING-TOKENS-XXX + x-ratelimit-reset-requests: + - X-RATELIMIT-RESET-REQUESTS-XXX + x-ratelimit-reset-tokens: + - X-RATELIMIT-RESET-TOKENS-XXX + x-request-id: + - X-REQUEST-ID-XXX + status: + code: 200 + message: OK version: 1