Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

34.2 KB
Raw Blame
interactions:
- request:
    body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
      Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
      a focused execution plan for the following task:\n\n## Task\nWhat is 15 + 27?\n\n##
      Expected Output\nComplete the task successfully\n\n## Available Tools\nNo tools
      available\n\n## Planning Principles\nFocus on WHAT needs to be accomplished,
      not HOW. Group related actions into logical units. Fewer steps = better. Most
      tasks need 3-6 steps. Hard limit: 20 steps.\n\n## Step Types (only these are
      valid):\n1. **Tool Step**: Uses a tool to gather information or take action\n2.
      **Output Step**: Synthesizes prior results into the final deliverable (usually
      the last step)\n\n## Rules:\n- Each step must either USE A TOOL or PRODUCE THE
      FINAL OUTPUT\n- Combine related tool calls: \"Research A, B, and C\" = ONE step,
      not three\n- Combine all synthesis into ONE final output step\n- NO standalone
      \"thinking\" steps (review, verify, confirm, refine, analyze) - these happen
      naturally between steps\n\nFor each step: State the action, specify the tool
      (if any), and note dependencies.\n\nAfter your plan, state READY or NOT READY."}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
      or refine a reasoning plan for a task with structured steps","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"A
      brief summary of the overall plan."},"steps":{"type":"array","description":"List
      of discrete steps to execute the plan","items":{"type":"object","properties":{"step_number":{"type":"integer","description":"Step
      number (1-based)"},"description":{"type":"string","description":"What to do
      in this step"},"tool_to_use":{"type":["string","null"],"description":"Tool to
      use for this step, or null if no tool needed"},"depends_on":{"type":"array","items":{"type":"integer"},"description":"Step
      numbers this step depends on (empty array if none)"}},"required":["step_number","description","tool_to_use","depends_on"],"additionalProperties":false}},"ready":{"type":"boolean","description":"Whether
      the agent is ready to execute the task."}},"required":["plan","steps","ready"],"additionalProperties":false}}}]}'
    headers:
      User-Agent:
      - X-USER-AGENT-XXX
      accept:
      - application/json
      accept-encoding:
      - ACCEPT-ENCODING-XXX
      authorization:
      - AUTHORIZATION-XXX
      connection:
      - keep-alive
      content-length:
      - '2317'
      content-type:
      - application/json
      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-D8WidmJV9i13DE24mvjP1ZirakLg4\",\n  \"object\":
        \"chat.completion\",\n  \"created\": 1770924767,\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_xQ7jJFuvWGusUiruNaZjuV6F\",\n            \"type\":
        \"function\",\n            \"function\": {\n              \"name\": \"create_reasoning_plan\",\n
        \             \"arguments\": \"{\\\"plan\\\":\\\"Calculate the sum of 15 and
        27.\\\",\\\"steps\\\":[{\\\"step_number\\\":1,\\\"description\\\":\\\"Add
        the numbers 15 and 27 together.\\\",\\\"tool_to_use\\\":null,\\\"depends_on\\\":[]},{\\\"step_number\\\":2,\\\"description\\\":\\\"Provide
        the final result of 15 + 27.\\\",\\\"tool_to_use\\\":null,\\\"depends_on\\\":[1]}],\\\"ready\\\":true}\"\n
        \           }\n          }\n        ],\n        \"refusal\": null,\n        \"annotations\":
        []\n      },\n      \"logprobs\": null,\n      \"finish_reason\": \"tool_calls\"\n
        \   }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 440,\n    \"completion_tokens\":
        88,\n    \"total_tokens\": 528,\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_f4ae844694\"\n}\n"
    headers:
      CF-RAY:
      - CF-RAY-XXX
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Thu, 12 Feb 2026 19:32:49 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:
      - '1643'
      openai-project:
      - OPENAI-PROJECT-XXX
      openai-version:
      - '2020-10-01'
      set-cookie:
      - SET-COOKIE-XXX
      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
- request:
    body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
      math tutor\n\nYour goal: Help solve math problems step by step\n\nYou are executing
      a specific step in a multi-step plan. Focus ONLY on completing\nthe current
      step. Do not plan ahead or worry about future steps.\n\nBefore acting, briefly
      reason about what you need to do and which approach\nor tool would be most helpful
      for this specific step."},{"role":"user","content":"## Current Step\nAdd the
      numbers 15 and 27 together.\n\nComplete this step and provide your result."}],"model":"gpt-4o-mini"}'
    headers:
      User-Agent:
      - X-USER-AGENT-XXX
      accept:
      - application/json
      accept-encoding:
      - ACCEPT-ENCODING-XXX
      authorization:
      - AUTHORIZATION-XXX
      connection:
      - keep-alive
      content-length:
      - '574'
      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-D8WifMUkNsYirBHDQMHraML9Sfxhr\",\n  \"object\":
        \"chat.completion\",\n  \"created\": 1770924769,\n  \"model\": \"gpt-4o-mini-2024-07-18\",\n
        \ \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\":
        \"assistant\",\n        \"content\": \"To add the numbers 15 and 27 together,
        I will perform the addition:\\n\\n15 + 27 = 42\\n\\nThe result is 42.\",\n
        \       \"refusal\": null,\n        \"annotations\": []\n      },\n      \"logprobs\":
        null,\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\":
        111,\n    \"completion_tokens\": 31,\n    \"total_tokens\": 142,\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_f4ae844694\"\n}\n"
    headers:
      CF-RAY:
      - CF-RAY-XXX
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Thu, 12 Feb 2026 19:32:50 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:
      - '975'
      openai-project:
      - OPENAI-PROJECT-XXX
      openai-version:
      - '2020-10-01'
      set-cookie:
      - SET-COOKIE-XXX
      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
- request:
    body: "{\"messages\":[{\"role\":\"system\",\"content\":\"You are a Planning Agent
      observing execution progress. After each step completes, you analyze what happened
      and decide whether the remaining plan is still valid.\\n\\nReason step-by-step
      about:\\n1. What new information was learned from this step's result\\n2. Whether
      the remaining steps still make sense given this new information\\n3. What refinements,
      if any, are needed for upcoming steps\\n4. Whether the overall goal has already
      been achieved\\n\\nBe conservative about triggering full replans \u2014 only
      do so when the remaining plan is fundamentally wrong, not just suboptimal.\"},{\"role\":\"user\",\"content\":\"##
      Original task\\n\\n\\n## Expected output\\n\\n\\n\\n## Just completed step 1\\nDescription:
      Add the numbers 15 and 27 together.\\nResult: To add the numbers 15 and 27 together,
      I will perform the addition:\\n\\n15 + 27 = 42\\n\\nThe result is 42.\\n\\n##
      Remaining plan steps:\\n  Step 2: Provide the final result of 15 + 27.\\n\\nAnalyze
      this step's result and provide your observation.\"}],\"model\":\"gpt-4o-mini\",\"response_format\":{\"type\":\"json_schema\",\"json_schema\":{\"schema\":{\"description\":\"Planner's
      observation after a step execution completes.\\n\\nReturned by the PlannerObserver
      after EVERY step \u2014 not just failures.\\nThe Planner uses this to decide
      whether to continue, refine, or replan.\\n\\nBased on PLAN-AND-ACT (Section
      3.3): the Planner observes what the Executor\\ndid and incorporates new information
      into the remaining plan.\\n\\nAttributes:\\n    step_completed_successfully:
      Whether the step achieved its objective.\\n    key_information_learned: New
      information revealed by this step\\n        (e.g., \\\"Found 3 products: A,
      B, C\\\"). Used to refine upcoming steps.\\n    remaining_plan_still_valid:
      Whether pending todos still make sense\\n        given the new information.
      True does NOT mean no refinement needed.\\n    suggested_refinements: Minor
      tweaks to upcoming step descriptions.\\n        These are lightweight in-place
      updates, not a full replan.\\n        Example: [\\\"Step 3 should select product
      B instead of 'best product'\\\"]\\n    needs_full_replan: The remaining plan
      is fundamentally wrong and must\\n        be regenerated from scratch. Mutually
      exclusive with\\n        remaining_plan_still_valid (if this is True, that should
      be False).\\n    replan_reason: Explanation of why a full replan is needed (None
      if not).\\n    goal_already_achieved: The overall task goal has been satisfied
      early.\\n        No more steps needed \u2014 skip remaining todos and finalize.\",\"properties\":{\"step_completed_successfully\":{\"description\":\"Whether
      the step achieved what it was asked to do\",\"title\":\"Step Completed Successfully\",\"type\":\"boolean\"},\"key_information_learned\":{\"default\":\"\",\"description\":\"What
      new information this step revealed\",\"title\":\"Key Information Learned\",\"type\":\"string\"},\"remaining_plan_still_valid\":{\"default\":true,\"description\":\"Whether
      the remaining pending todos still make sense given new information\",\"title\":\"Remaining
      Plan Still Valid\",\"type\":\"boolean\"},\"suggested_refinements\":{\"anyOf\":[{\"items\":{\"type\":\"string\"},\"type\":\"array\"},{\"type\":\"null\"}],\"description\":\"Minor
      tweaks to descriptions of upcoming steps (lightweight, no full replan)\",\"title\":\"Suggested
      Refinements\"},\"needs_full_replan\":{\"default\":false,\"description\":\"The
      remaining plan is fundamentally wrong and must be regenerated\",\"title\":\"Needs
      Full Replan\",\"type\":\"boolean\"},\"replan_reason\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"null\"}],\"description\":\"Explanation
      of why a full replan is needed\",\"title\":\"Replan Reason\"},\"goal_already_achieved\":{\"default\":false,\"description\":\"The
      overall task goal has been satisfied early; no more steps needed\",\"title\":\"Goal
      Already Achieved\",\"type\":\"boolean\"}},\"required\":[\"step_completed_successfully\",\"key_information_learned\",\"remaining_plan_still_valid\",\"suggested_refinements\",\"needs_full_replan\",\"replan_reason\",\"goal_already_achieved\"],\"title\":\"StepObservation\",\"type\":\"object\",\"additionalProperties\":false},\"name\":\"StepObservation\",\"strict\":true}},\"stream\":false}"
    headers:
      User-Agent:
      - X-USER-AGENT-XXX
      accept:
      - application/json
      accept-encoding:
      - ACCEPT-ENCODING-XXX
      authorization:
      - AUTHORIZATION-XXX
      connection:
      - keep-alive
      content-length:
      - '4037'
      content-type:
      - application/json
      cookie:
      - COOKIE-XXX
      host:
      - api.openai.com
      x-stainless-arch:
      - X-STAINLESS-ARCH-XXX
      x-stainless-async:
      - 'false'
      x-stainless-helper-method:
      - beta.chat.completions.parse
      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-D8Wihvgjx16HF7G4R4Hv2hHRX95Zi\",\n  \"object\":
        \"chat.completion\",\n  \"created\": 1770924771,\n  \"model\": \"gpt-4o-mini-2024-07-18\",\n
        \ \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\":
        \"assistant\",\n        \"content\": \"{\\\"step_completed_successfully\\\":true,\\\"key_information_learned\\\":\\\"The
        result of adding 15 and 27 is 42.\\\",\\\"remaining_plan_still_valid\\\":true,\\\"suggested_refinements\\\":null,\\\"needs_full_replan\\\":false,\\\"replan_reason\\\":null,\\\"goal_already_achieved\\\":true}\",\n
        \       \"refusal\": null,\n        \"annotations\": []\n      },\n      \"logprobs\":
        null,\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\":
        791,\n    \"completion_tokens\": 65,\n    \"total_tokens\": 856,\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_f4ae844694\"\n}\n"
    headers:
      CF-RAY:
      - CF-RAY-XXX
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Thu, 12 Feb 2026 19:32:52 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:
      - '1742'
      openai-project:
      - OPENAI-PROJECT-XXX
      openai-version:
      - '2020-10-01'
      set-cookie:
      - SET-COOKIE-XXX
      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
- request:
    body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
      math tutor\n\nYour goal: Help solve math problems step by step\n\nYou are executing
      a specific step in a multi-step plan. Focus ONLY on completing\nthe current
      step. Do not plan ahead or worry about future steps.\n\nBefore acting, briefly
      reason about what you need to do and which approach\nor tool would be most helpful
      for this specific step."},{"role":"user","content":"## Current Step\nProvide
      the final result of 15 + 27.\n\n## Context from previous steps:\nStep 1 result:
      To add the numbers 15 and 27 together, I will perform the addition:\n\n15 +
      27 = 42\n\nThe result is 42.\n\nComplete this step and provide your result."}],"model":"gpt-4o-mini"}'
    headers:
      User-Agent:
      - X-USER-AGENT-XXX
      accept:
      - application/json
      accept-encoding:
      - ACCEPT-ENCODING-XXX
      authorization:
      - AUTHORIZATION-XXX
      connection:
      - keep-alive
      content-length:
      - '731'
      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-D8WijqXxzVDrvN694O3RU1ndqJEOT\",\n  \"object\":
        \"chat.completion\",\n  \"created\": 1770924773,\n  \"model\": \"gpt-4o-mini-2024-07-18\",\n
        \ \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\":
        \"assistant\",\n        \"content\": \"The final result of 15 + 27 is 42.\",\n
        \       \"refusal\": null,\n        \"annotations\": []\n      },\n      \"logprobs\":
        null,\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\":
        154,\n    \"completion_tokens\": 13,\n    \"total_tokens\": 167,\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_7e4bf6ad56\"\n}\n"
    headers:
      CF-RAY:
      - CF-RAY-XXX
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Thu, 12 Feb 2026 19:32:53 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:
      - '545'
      openai-project:
      - OPENAI-PROJECT-XXX
      openai-version:
      - '2020-10-01'
      set-cookie:
      - SET-COOKIE-XXX
      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
- request:
    body: "{\"messages\":[{\"role\":\"system\",\"content\":\"You are a Planning Agent
      observing execution progress. After each step completes, you analyze what happened
      and decide whether the remaining plan is still valid.\\n\\nReason step-by-step
      about:\\n1. What new information was learned from this step's result\\n2. Whether
      the remaining steps still make sense given this new information\\n3. What refinements,
      if any, are needed for upcoming steps\\n4. Whether the overall goal has already
      been achieved\\n\\nBe conservative about triggering full replans \u2014 only
      do so when the remaining plan is fundamentally wrong, not just suboptimal.\"},{\"role\":\"user\",\"content\":\"##
      Original task\\n\\n\\n## Expected output\\n\\n\\n## Previously completed steps:\\n
      \ Step 1: Add the numbers 15 and 27 together.\\n    Result: To add the numbers
      15 and 27 together, I will perform the addition:\\n\\n15 + 27 = 42\\n\\nThe
      result is 42.\\n\\n## Just completed step 2\\nDescription: Provide the final
      result of 15 + 27.\\nResult: The final result of 15 + 27 is 42.\\n\\n\\nAnalyze
      this step's result and provide your observation.\"}],\"model\":\"gpt-4o-mini\",\"response_format\":{\"type\":\"json_schema\",\"json_schema\":{\"schema\":{\"description\":\"Planner's
      observation after a step execution completes.\\n\\nReturned by the PlannerObserver
      after EVERY step \u2014 not just failures.\\nThe Planner uses this to decide
      whether to continue, refine, or replan.\\n\\nBased on PLAN-AND-ACT (Section
      3.3): the Planner observes what the Executor\\ndid and incorporates new information
      into the remaining plan.\\n\\nAttributes:\\n    step_completed_successfully:
      Whether the step achieved its objective.\\n    key_information_learned: New
      information revealed by this step\\n        (e.g., \\\"Found 3 products: A,
      B, C\\\"). Used to refine upcoming steps.\\n    remaining_plan_still_valid:
      Whether pending todos still make sense\\n        given the new information.
      True does NOT mean no refinement needed.\\n    suggested_refinements: Minor
      tweaks to upcoming step descriptions.\\n        These are lightweight in-place
      updates, not a full replan.\\n        Example: [\\\"Step 3 should select product
      B instead of 'best product'\\\"]\\n    needs_full_replan: The remaining plan
      is fundamentally wrong and must\\n        be regenerated from scratch. Mutually
      exclusive with\\n        remaining_plan_still_valid (if this is True, that should
      be False).\\n    replan_reason: Explanation of why a full replan is needed (None
      if not).\\n    goal_already_achieved: The overall task goal has been satisfied
      early.\\n        No more steps needed \u2014 skip remaining todos and finalize.\",\"properties\":{\"step_completed_successfully\":{\"description\":\"Whether
      the step achieved what it was asked to do\",\"title\":\"Step Completed Successfully\",\"type\":\"boolean\"},\"key_information_learned\":{\"default\":\"\",\"description\":\"What
      new information this step revealed\",\"title\":\"Key Information Learned\",\"type\":\"string\"},\"remaining_plan_still_valid\":{\"default\":true,\"description\":\"Whether
      the remaining pending todos still make sense given new information\",\"title\":\"Remaining
      Plan Still Valid\",\"type\":\"boolean\"},\"suggested_refinements\":{\"anyOf\":[{\"items\":{\"type\":\"string\"},\"type\":\"array\"},{\"type\":\"null\"}],\"description\":\"Minor
      tweaks to descriptions of upcoming steps (lightweight, no full replan)\",\"title\":\"Suggested
      Refinements\"},\"needs_full_replan\":{\"default\":false,\"description\":\"The
      remaining plan is fundamentally wrong and must be regenerated\",\"title\":\"Needs
      Full Replan\",\"type\":\"boolean\"},\"replan_reason\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"null\"}],\"description\":\"Explanation
      of why a full replan is needed\",\"title\":\"Replan Reason\"},\"goal_already_achieved\":{\"default\":false,\"description\":\"The
      overall task goal has been satisfied early; no more steps needed\",\"title\":\"Goal
      Already Achieved\",\"type\":\"boolean\"}},\"required\":[\"step_completed_successfully\",\"key_information_learned\",\"remaining_plan_still_valid\",\"suggested_refinements\",\"needs_full_replan\",\"replan_reason\",\"goal_already_achieved\"],\"title\":\"StepObservation\",\"type\":\"object\",\"additionalProperties\":false},\"name\":\"StepObservation\",\"strict\":true}},\"stream\":false}"
    headers:
      User-Agent:
      - X-USER-AGENT-XXX
      accept:
      - application/json
      accept-encoding:
      - ACCEPT-ENCODING-XXX
      authorization:
      - AUTHORIZATION-XXX
      connection:
      - keep-alive
      content-length:
      - '4091'
      content-type:
      - application/json
      cookie:
      - COOKIE-XXX
      host:
      - api.openai.com
      x-stainless-arch:
      - X-STAINLESS-ARCH-XXX
      x-stainless-async:
      - 'false'
      x-stainless-helper-method:
      - beta.chat.completions.parse
      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-D8WijHLIWu3UpiSTF4oondCkkFWnq\",\n  \"object\":
        \"chat.completion\",\n  \"created\": 1770924773,\n  \"model\": \"gpt-4o-mini-2024-07-18\",\n
        \ \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\":
        \"assistant\",\n        \"content\": \"{\\\"step_completed_successfully\\\":true,\\\"key_information_learned\\\":\\\"The
        final result of the addition of 15 and 27 is confirmed to be 42, consistent
        with the previous step.\\\",\\\"remaining_plan_still_valid\\\":true,\\\"suggested_refinements\\\":null,\\\"needs_full_replan\\\":false,\\\"replan_reason\\\":null,\\\"goal_already_achieved\\\":true}\",\n
        \       \"refusal\": null,\n        \"annotations\": []\n      },\n      \"logprobs\":
        null,\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\":
        807,\n    \"completion_tokens\": 77,\n    \"total_tokens\": 884,\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_f4ae844694\"\n}\n"
    headers:
      CF-RAY:
      - CF-RAY-XXX
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Thu, 12 Feb 2026 19:32:55 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:
      - '1843'
      openai-project:
      - OPENAI-PROJECT-XXX
      openai-version:
      - '2020-10-01'
      set-cookie:
      - SET-COOKIE-XXX
      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
- request:
    body: '{"messages":[{"role":"system","content":"You are Math Assistant. You have
      completed a multi-step task. Synthesize the results from all steps into a single,
      coherent final response that directly addresses the original task. Do NOT list
      step numbers or say ''Step 1 result''. Produce a clean, polished answer as if
      you did it all at once."},{"role":"user","content":"## Original Task\nWhat is
      15 + 27?\n\n## Results from each step\nStep 1 (Add the numbers 15 and 27 together.):\nTo
      add the numbers 15 and 27 together, I will perform the addition:\n\n15 + 27
      = 42\n\nThe result is 42.\n\nStep 2 (Provide the final result of 15 + 27.):\nThe
      final result of 15 + 27 is 42.\n\nSynthesize these results into a single, coherent
      final answer."}],"model":"gpt-4o-mini"}'
    headers:
      User-Agent:
      - X-USER-AGENT-XXX
      accept:
      - application/json
      accept-encoding:
      - ACCEPT-ENCODING-XXX
      authorization:
      - AUTHORIZATION-XXX
      connection:
      - keep-alive
      content-length:
      - '757'
      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-D8WilXbtsRhcSEKpM0tfkI49oNjmn\",\n  \"object\":
        \"chat.completion\",\n  \"created\": 1770924775,\n  \"model\": \"gpt-4o-mini-2024-07-18\",\n
        \ \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\":
        \"assistant\",\n        \"content\": \"The result of adding 15 and 27 together
        is 42.\",\n        \"refusal\": null,\n        \"annotations\": []\n      },\n
        \     \"logprobs\": null,\n      \"finish_reason\": \"stop\"\n    }\n  ],\n
        \ \"usage\": {\n    \"prompt_tokens\": 178,\n    \"completion_tokens\": 14,\n
        \   \"total_tokens\": 192,\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_f4ae844694\"\n}\n"
    headers:
      CF-RAY:
      - CF-RAY-XXX
      Connection:
      - keep-alive
      Content-Type:
      - application/json
      Date:
      - Thu, 12 Feb 2026 19:32:56 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:
      - '492'
      openai-project:
      - OPENAI-PROJECT-XXX
      openai-version:
      - '2020-10-01'
      set-cookie:
      - SET-COOKIE-XXX
      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