ch09_who_retries

show:
mock turns=9 · messages=22
live turns=9 · messages=23
scenario service_is_busy
scenario service_is_busy · tools=place_order, price_of · 59.5ms · 2 turns · ended: no_tool_calls
turn 1 · 58.8ms · asked for: price_of
model mock · 3.1ms · asked for: price_of
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 55.6ms (model provider 0.1 · library 55.5) · given: item=milk · attempts: 2 · returned: 1.20
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/status/429?item=milk
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
429
headers (3)
show
content-length0
content-typetext/plain; charset=utf-8
retry-after1
null
attempt {"number": 1, "message": "['https://httpbin.org'] answered ['429']", "retryable": true, "idempotent": true, "caller_can_fix": false}
backoff {"seconds": 0.05, "before_attempt": 2}
wire request
attempt
1
method
GET
url
https://httpbin.org/get?item=milk
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
200
headers (2)
show
content-length39
content-typeapplication/json
{
  "args": {
    "item": "milk"
  },
  "price": "1.20"
}
attempt {"number": 2}
result {"value": "1.20"}
turn 2 · 0.4ms · responded with: Milk is 1.20.
model mock · 0.4ms · responded with: Milk is 1.20.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
[2]ai
price_of({"item": "milk"})
[3]tool1.20
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]aiMilk is 1.20.
ended {"reason": "no_tool_calls"}
scenario service_is_busy · tools=place_order, price_of · 2487.1ms · 2 turns · ended: no_tool_calls
turn 1 · 1772.4ms · 416 in / 39 out · asked for: price_of
model live · 1198.1ms (model provider 970.0 · library 228.0) · 416 in / 39 out · asked for: price_of
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length766
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "How much is milk?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:02 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 6375c26956bc0f0a63d43a140369a4b0.cloudfront.net (CloudFront)
x-amz-cf-idq_d_Vw9Yg-zCzN1gtcsZ6RVkGk_Pvh6T2XVOm18hzvGiRlICTU0GbQ==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id407030b8d800edc1a8630fac2bcdd4a2
{
  "id": "f212178a-8a29-45ac-aaa3-7d97e29eacc1",
  "object": "chat.completion",
  "created": 1789336322,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_ET_A9rAcO8Ca5BLjkVV8E0x7978",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 416,
    "completion_tokens": 39,
    "total_tokens": 455,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 160
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 574.2ms (model provider 323.0 · library 251.2) · given: item=milk · attempts: 2 · returned: 1.20
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/status/429?item=milk
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
429
headers (7)
show
access-control-allow-credentialstrue
access-control-allow-origin*
connectionkeep-alive
content-length0
content-typetext/html; charset=utf-8
dateSun, 13 Sep 2026 21:52:03 GMT
servergunicorn/19.9.0
null
attempt {"number": 1, "message": "['https://httpbin.org'] answered ['429']", "retryable": true, "idempotent": true, "caller_can_fix": false}
backoff {"seconds": 0.05, "before_attempt": 2}
wire request
attempt
1
method
GET
url
https://httpbin.org/get?item=milk
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
200
headers (7)
show
access-control-allow-credentialstrue
access-control-allow-origin*
connectionkeep-alive
content-length390
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:03 GMT
servergunicorn/19.9.0
{
  "args": {
    "item": "milk"
  },
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, zstd",
    "Authorization": "Bearer primer-demo-key",
    "Host": "httpbin.org",
    "User-Agent": "python-httpx/0.28.1",
    "X-Amzn-Trace-Id": "Root=1-6aa71b03-230aab01066b7d8920513e73"
  },
  "origin": "71.218.120.63",
  "url": "https://httpbin.org/get?item=milk"
}
attempt {"number": 2}
result {"value": "1.20"}
turn 2 · 714.4ms · 470 in / 9 out · responded with: Milk is £1.20.
model live · 714.4ms (model provider 700.9 · library 13.5) · 470 in / 9 out · responded with: Milk is £1.20.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
[2]ai
price_of({"item": "milk"})
[3]tool1.20
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length1032
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "How much is milk?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_ET_A9rAcO8Ca5BLjkVV8E0x7978",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ]
    },
    {
      "content": "1.20",
      "role": "tool",
      "tool_call_id": "call_00_ET_A9rAcO8Ca5BLjkVV8E0x7978"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:04 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 8e3b59cbfaa682579fb24502d1ad1194.cloudfront.net (CloudFront)
x-amz-cf-idCXQHhrxvnJaUiqiYq2i_47tas9D2dICbJr7sOvSbesL26Vii-HhSaA==
x-amz-cf-popDEN53-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idab98ea7db3d6a3855dd05f076de378e2
{
  "id": "902478d7-4dba-4a29-929e-54fd4d346cd7",
  "object": "chat.completion",
  "created": 1789336324,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Milk is \u00a31.20.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 470,
    "completion_tokens": 9,
    "total_tokens": 479,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 214
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiMilk is £1.20.
ended {"reason": "no_tool_calls"}
scenario order_may_have_landed
scenario order_may_have_landed · tools=place_order, price_of · 0.8ms · 2 turns · ended: no_tool_calls
turn 1 · 0.5ms · asked for: place_order
model mock · 0.3ms · asked for: place_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 2 bottles of milk.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
place_order({"item": "milk", "quantity": 2})
tool place_order · 0.2ms · given: item=milk, quantity=2 · raised: ['https://httpbin.org'] did not answer in time, and the call
args {"item": "milk", "quantity": 2}
wire request
attempt
1
method
GET
url
https://httpbin.org/delay/10?item=milk&quantity=2
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
attempt {"number": 1, "message": "['https://httpbin.org'] did not answer in time, and the call may have been received", "retryable": true, "idempotent": false, "caller_can_fix": false}
failed {"message": "['https://httpbin.org'] did not answer in time, and the call may have been received", "retryable": true, "idempotent": false, "caller_can_fix": false}
turn 2 · 0.3ms · responded with: The order may or may not have been placed. Please check before ordering again.
model mock · 0.3ms · responded with: The order may or may not have been placed. Please check before ordering again.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 2 bottles of milk.
[2]ai
place_order({"item": "milk", "quantity": 2})
[3]tool['place_order'] did not confirm: ['https://httpbin.org'] did not answer in time, and the call may have been received. It may have taken effect. Do not call it again; say what is uncertain.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]aiThe order may or may not have been placed. Please check before ordering again.
ended {"reason": "no_tool_calls"}
scenario order_may_have_landed · tools=place_order, price_of · 4149.5ms · 2 turns · ended: no_tool_calls
turn 1 · 3002.2ms · 418 in / 69 out · asked for: place_order
model live · 850.7ms (model provider 838.3 · library 12.4) · 418 in / 69 out · asked for: place_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 2 bottles of milk.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length773
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Order 2 bottles of milk.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:04 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 2049902380178fd7b885115d80ccf966.cloudfront.net (CloudFront)
x-amz-cf-idIta1mnTZPvLFBhGDsJLepL82HTMkOgF35-k7d1Qnb0cydUjTOpDjgw==
x-amz-cf-popDEN52-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idc62131828f451cc8c815f7a9fd75c24f
{
  "id": "ad68a2d3-fb77-489c-9ab3-21346f4f9209",
  "object": "chat.completion",
  "created": 1789336324,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user wants 2 bottles of milk. Just place the order.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_K8V6AHIBwnmmWiKtCE2H6233",
            "type": "function",
            "function": {
              "name": "place_order",
              "arguments": "{\"item\": \"milk\", \"quantity\": 2}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 418,
    "completion_tokens": 69,
    "total_tokens": 487,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 14
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 162
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
place_order({"item": "milk", "quantity": 2})
tool place_order · 2151.4ms · given: item=milk, quantity=2 · raised: ['https://httpbin.org'] did not answer in time, and the call
args {"item": "milk", "quantity": 2}
wire request
attempt
1
method
GET
url
https://httpbin.org/delay/10?item=milk&quantity=2
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
attempt {"number": 1, "message": "['https://httpbin.org'] did not answer in time, and the call may have been received", "retryable": true, "idempotent": false, "caller_can_fix": false}
failed {"message": "['https://httpbin.org'] did not answer in time, and the call may have been received", "retryable": true, "idempotent": false, "caller_can_fix": false}
turn 2 · 1147.2ms · 544 in / 94 out · responded with: I tried to place the order for 2 bottles of milk, but the request timed out and didn't con... (192 more characters)
model live · 1147.2ms (model provider 1139.3 · library 7.9) · 544 in / 94 out · responded with: I tried to place the order for 2 bottles of milk, but the request timed out and didn't con... (192 more characters)
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 2 bottles of milk.
[2]ai
place_order({"item": "milk", "quantity": 2})
[3]tool['place_order'] did not confirm: ['https://httpbin.org'] did not answer in time, and the call may have been received. It may have taken effect. Do not call it again; say what is uncertain.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length1315
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Order 2 bottles of milk.",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_K8V6AHIBwnmmWiKtCE2H6233",
          "function": {
            "name": "place_order",
            "arguments": "{\"item\": \"milk\", \"quantity\": 2}"
          }
        }
      ],
      "reasoning_content": "The user wants 2 bottles of milk. Just place the order."
    },
    {
      "content": "['place_order'] did not confirm: ['https://httpbin.org'] did not answer in time, and the call may have been received. It may have taken effect. Do not call it again; say what is uncertain.",
      "role": "tool",
      "tool_call_id": "call_00_K8V6AHIBwnmmWiKtCE2H6233"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:07 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 ba437ea2340585e48bd8901315998164.cloudfront.net (CloudFront)
x-amz-cf-idR--gsQ7m560SO4D6yFp-bOaxF-Rzn2NWiPUFLCqli6te_cCmniB-3g==
x-amz-cf-popDEN53-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idd918e34650b2c5a9889cc6a6b9855fdd
{
  "id": "01e69c6f-dd25-4941-b96f-6b313c85e819",
  "object": "chat.completion",
  "created": 1789336327,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I tried to place the order for 2 bottles of milk, but the request timed out and didn't confirm. It may or may not have gone through.\n\nI didn't retry, since doing so could order it twice. If you want, check whether the order appears on your side \u2014 if it doesn't, I can place it again.",
        "reasoning_content": "The order call timed out \u2014 may or may not have been placed. I should not retry. Report uncertainty."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 544,
    "completion_tokens": 94,
    "total_tokens": 638,
    "prompt_tokens_details": {
      "cached_tokens": 384
    },
    "completion_tokens_details": {
      "reasoning_tokens": 23
    },
    "prompt_cache_hit_tokens": 384,
    "prompt_cache_miss_tokens": 160
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI tried to place the order for 2 bottles of milk, but the request timed out and didn't confirm. It may or may not have gone through. I didn't retry, since doing so could order it twice. If you want, check whether the order appears on your side — if it doesn't, I can place it again.
ended {"reason": "no_tool_calls"}
scenario arguments_are_wrong
scenario arguments_are_wrong · tools=place_order, price_of · 1.1ms · 3 turns · ended: no_tool_calls
turn 1 · 0.3ms · asked for: place_order
model mock · 0.3ms · asked for: place_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 20 bottles of milk.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
place_order({"item": "milk", "quantity": 20})
tool place_order · 0.0ms · given: item=milk, quantity=20 · raised: quantity ['20'] must be between 1 and 12
args {"item": "milk", "quantity": 20}
attempt {"number": 1, "message": "quantity ['20'] must be between 1 and 12", "retryable": false, "idempotent": false, "caller_can_fix": true}
failed {"message": "quantity ['20'] must be between 1 and 12", "retryable": false, "idempotent": false, "caller_can_fix": true}
turn 2 · 0.5ms · asked for: place_order
model mock · 0.2ms · asked for: place_order
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 20 bottles of milk.
[2]ai
place_order({"item": "milk", "quantity": 20})
[3]tool['place_order'] rejected the arguments: quantity ['20'] must be between 1 and 12. Correct them and call it again.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]ai
place_order({"item": "milk", "quantity": 12})
tool place_order · 0.2ms (model provider 0.1 · library 0.2) · given: item=milk, quantity=12 · returned: ordered 12 x milk
args {"item": "milk", "quantity": 12}
wire request
attempt
1
method
GET
url
https://httpbin.org/get?item=milk&quantity=12
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
200
headers (2)
show
content-length47
content-typeapplication/json
{
  "args": {
    "item": "milk"
  },
  "reference": "ord-8812"
}
attempt {"number": 1}
result {"value": "ordered 12 x milk"}
turn 3 · 0.3ms · responded with: I ordered 12, the most allowed in one order.
model mock · 0.3ms · responded with: I ordered 12, the most allowed in one order.
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 20 bottles of milk.
[2]ai
place_order({"item": "milk", "quantity": 20})
[3]tool['place_order'] rejected the arguments: quantity ['20'] must be between 1 and 12. Correct them and call it again.
[4]ai
place_order({"item": "milk", "quantity": 12})
[5]toolordered 12 x milk
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 6, "roles": ["system", "human", "ai", "tool", "ai", "tool"]}
reply
rolecontent
[0]aiI ordered 12, the most allowed in one order.
ended {"reason": "no_tool_calls"}
scenario arguments_are_wrong · tools=place_order, price_of · 5059.9ms · 3 turns · ended: no_tool_calls
turn 1 · 1506.7ms · 418 in / 194 out · asked for: place_order
model live · 1506.7ms (model provider 1499.6 · library 7.1) · 418 in / 194 out · asked for: place_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 20 bottles of milk.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length774
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Order 20 bottles of milk.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:08 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 d9978c4c79926d2f68f210859236f550.cloudfront.net (CloudFront)
x-amz-cf-idmIN3SKwFpjMk3b4fRVlEDDwddp3Lfav6RCDcmdmwDm5Gl70ZDhZtkw==
x-amz-cf-popDEN53-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id59bb71af81ec1cb88be90e7017ebfa9c
{
  "id": "41fe6696-e1a6-4c9c-8315-39feee3aecbb",
  "object": "chat.completion",
  "created": 1789336328,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user wants 20 bottles of milk. The tool is place_order with item \"milk\" and quantity 20.\n\nBut wait \u2014 maybe I should check price? The task just says order 20 bottles of milk. Placing order twice orders it twice, so a single call with quantity 20 is right.\n\nShould I check price first? Not necessary but could be useful. Simpler: just place the order. But being careful \u2014 maybe I should check the price to inform. The instruction: answer briefly and plainly. Let's just place the order.\n\nActually, could there be a trap? Perhaps the item enum includes milk. Fine.\n\nPlace order for milk, quantity 20.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_ygBaqDPyj5jH3Dx5HvjL3909",
            "type": "function",
            "function": {
              "name": "place_order",
              "arguments": "{\"item\": \"milk\", \"quantity\": 20}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 418,
    "completion_tokens": 194,
    "total_tokens": 612,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 139
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 162
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
place_order({"item": "milk", "quantity": 20})
tool place_order · 0.0ms · given: item=milk, quantity=20 · raised: quantity ['20'] must be between 1 and 12
args {"item": "milk", "quantity": 20}
attempt {"number": 1, "message": "quantity ['20'] must be between 1 and 12", "retryable": false, "idempotent": false, "caller_can_fix": true}
failed {"message": "quantity ['20'] must be between 1 and 12", "retryable": false, "idempotent": false, "caller_can_fix": true}
turn 2 · 2465.9ms · 651 in / 193 out · asked for: place_order, place_order · responded with: The max per order is 12, so I'll split it into two orders (12 + 8 = 20).
model live · 2024.0ms (model provider 2015.7 · library 8.3) · 651 in / 193 out · asked for: place_order, place_order · responded with: The max per order is 12, so I'll split it into two orders (12 + 8 = 20).
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 20 bottles of milk.
[2]ai
place_order({"item": "milk", "quantity": 20})
[3]tool['place_order'] rejected the arguments: quantity ['20'] must be between 1 and 12. Correct them and call it again.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length1802
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Order 20 bottles of milk.",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_ygBaqDPyj5jH3Dx5HvjL3909",
          "function": {
            "name": "place_order",
            "arguments": "{\"item\": \"milk\", \"quantity\": 20}"
          }
        }
      ],
      "reasoning_content": "The user wants 20 bottles of milk. The tool is place_order with item \"milk\" and quantity 20.\n\nBut wait \u2014 maybe I should check price? The task just says order 20 bottles of milk. Placing order twice orders it twice, so a single call with quantity 20 is right.\n\nShould I check price first? Not necessary but could be useful. Simpler: just place the order. But being careful \u2014 maybe I should check the price to inform. The instruction: answer briefly and plainly. Let's just place the order.\n\nActually, could there be a trap? Perhaps the item enum includes milk. Fine.\n\nPlace order for milk, quantity 20."
    },
    {
      "content": "['place_order'] rejected the arguments: quantity ['20'] must be between 1 and 12. Correct them and call it again.",
      "role": "tool",
      "tool_call_id": "call_00_ygBaqDPyj5jH3Dx5HvjL3909"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:10 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 a5f8144ef16599e2b755229616dbcef6.cloudfront.net (CloudFront)
x-amz-cf-idCejAeRrhWIH-hf0Lmlsqk5V99pYTY-fLEMedEUJJ-3bx_PU4Lt29og==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idbe0558c1dfab7ddbb06f51ff891f8b60
{
  "id": "5cad0921-3031-421a-9563-beaed5d2c333",
  "object": "chat.completion",
  "created": 1789336330,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The max per order is 12, so I'll split it into two orders (12 + 8 = 20).",
        "reasoning_content": "The system rejected quantity 20, max is 12 per order. So I need to split into multiple orders: 12 + 8 = 20.\n\nLet me place two orders: one for 12, one for 8.\n\nThese are independent? They both need to happen; can be in same block. Yes, no dependency.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_WTguMdAa0L0Eo4MQbLLF0042",
            "type": "function",
            "function": {
              "name": "place_order",
              "arguments": "{\"item\": \"milk\", \"quantity\": 12}"
            }
          },
          {
            "index": 1,
            "id": "call_01_wVN46r9RtJMWoN6vyRUe5802",
            "type": "function",
            "function": {
              "name": "place_order",
              "arguments": "{\"item\": \"milk\", \"quantity\": 8}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 651,
    "completion_tokens": 193,
    "total_tokens": 844,
    "prompt_tokens_details": {
      "cached_tokens": 512
    },
    "completion_tokens_details": {
      "reasoning_tokens": 69
    },
    "prompt_cache_hit_tokens": 512,
    "prompt_cache_miss_tokens": 139
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiThe max per order is 12, so I'll split it into two orders (12 + 8 = 20).
place_order({"item": "milk", "quantity": 12})
place_order({"item": "milk", "quantity": 8})
tool place_order · 242.9ms (model provider 235.7 · library 7.3) · given: item=milk, quantity=12 · returned: ordered 12 x milk
args {"item": "milk", "quantity": 12}
wire request
attempt
1
method
GET
url
https://httpbin.org/get?item=milk&quantity=12
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
200
headers (7)
show
access-control-allow-credentialstrue
access-control-allow-origin*
connectionkeep-alive
content-length425
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:12 GMT
servergunicorn/19.9.0
{
  "args": {
    "item": "milk",
    "quantity": "12"
  },
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, zstd",
    "Authorization": "Bearer primer-demo-key",
    "Host": "httpbin.org",
    "User-Agent": "python-httpx/0.28.1",
    "X-Amzn-Trace-Id": "Root=1-6aa71b0c-51ca095b0e97b1f42328c82a"
  },
  "origin": "71.218.120.63",
  "url": "https://httpbin.org/get?item=milk&quantity=12"
}
attempt {"number": 1}
result {"value": "ordered 12 x milk"}
tool place_order · 198.9ms (model provider 190.5 · library 8.4) · given: item=milk, quantity=8 · returned: ordered 8 x milk
args {"item": "milk", "quantity": 8}
wire request
attempt
1
method
GET
url
https://httpbin.org/get?item=milk&quantity=8
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
200
headers (7)
show
access-control-allow-credentialstrue
access-control-allow-origin*
connectionkeep-alive
content-length423
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:12 GMT
servergunicorn/19.9.0
{
  "args": {
    "item": "milk",
    "quantity": "8"
  },
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, zstd",
    "Authorization": "Bearer primer-demo-key",
    "Host": "httpbin.org",
    "User-Agent": "python-httpx/0.28.1",
    "X-Amzn-Trace-Id": "Root=1-6aa71b0c-38586e3a42c434231d7ca35b"
  },
  "origin": "71.218.120.63",
  "url": "https://httpbin.org/get?item=milk&quantity=8"
}
attempt {"number": 1}
result {"value": "ordered 8 x milk"}
turn 3 · 1087.1ms · 874 in / 28 out · responded with: Done — 20 bottles of milk ordered as two orders (12 + 8), since the order limit is 12 per ... (6 more characters)
model live · 1087.1ms (model provider 1077.8 · library 9.3) · 874 in / 28 out · responded with: Done — 20 bottles of milk ordered as two orders (12 + 8), since the order limit is 12 per ... (6 more characters)
context sent — 7 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanOrder 20 bottles of milk.
[2]ai
place_order({"item": "milk", "quantity": 20})
[3]tool['place_order'] rejected the arguments: quantity ['20'] must be between 1 and 12. Correct them and call it again.
[4]aiThe max per order is 12, so I'll split it into two orders (12 + 8 = 20).
place_order({"item": "milk", "quantity": 12})
place_order({"item": "milk", "quantity": 8})
[5]toolordered 12 x milk
[6]toolordered 8 x milk
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length2682
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Order 20 bottles of milk.",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_ygBaqDPyj5jH3Dx5HvjL3909",
          "function": {
            "name": "place_order",
            "arguments": "{\"item\": \"milk\", \"quantity\": 20}"
          }
        }
      ],
      "reasoning_content": "The user wants 20 bottles of milk. The tool is place_order with item \"milk\" and quantity 20.\n\nBut wait \u2014 maybe I should check price? The task just says order 20 bottles of milk. Placing order twice orders it twice, so a single call with quantity 20 is right.\n\nShould I check price first? Not necessary but could be useful. Simpler: just place the order. But being careful \u2014 maybe I should check the price to inform. The instruction: answer briefly and plainly. Let's just place the order.\n\nActually, could there be a trap? Perhaps the item enum includes milk. Fine.\n\nPlace order for milk, quantity 20."
    },
    {
      "content": "['place_order'] rejected the arguments: quantity ['20'] must be between 1 and 12. Correct them and call it again.",
      "role": "tool",
      "tool_call_id": "call_00_ygBaqDPyj5jH3Dx5HvjL3909"
    },
    {
      "content": "The max per order is 12, so I'll split it into two orders (12 + 8 = 20).",
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_WTguMdAa0L0Eo4MQbLLF0042",
          "function": {
            "name": "place_order",
            "arguments": "{\"item\": \"milk\", \"quantity\": 12}"
          }
        },
        {
          "type": "function",
          "id": "call_01_wVN46r9RtJMWoN6vyRUe5802",
          "function": {
            "name": "place_order",
            "arguments": "{\"item\": \"milk\", \"quantity\": 8}"
          }
        }
      ],
      "reasoning_content": "The system rejected quantity 20, max is 12 per order. So I need to split into multiple orders: 12 + 8 = 20.\n\nLet me place two orders: one for 12, one for 8.\n\nThese are independent? They both need to happen; can be in same block. Yes, no dependency."
    },
    {
      "content": "ordered 12 x milk",
      "role": "tool",
      "tool_call_id": "call_00_WTguMdAa0L0Eo4MQbLLF0042"
    },
    {
      "content": "ordered 8 x milk",
      "role": "tool",
      "tool_call_id": "call_01_wVN46r9RtJMWoN6vyRUe5802"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:12 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 901770ea429e342cd86b7d04579a8c40.cloudfront.net (CloudFront)
x-amz-cf-id608eeyQOKAKNMsvL6XHugA6wDcqeN2dQTbQeHHr0TAUc3upGiMjE0g==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id66b7a203321972960ef9a99556b1cd32
{
  "id": "d3ffee7d-d94b-41ce-afe2-e457be826500",
  "object": "chat.completion",
  "created": 1789336332,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Done \u2014 20 bottles of milk ordered as two orders (12 + 8), since the order limit is 12 per order.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 874,
    "completion_tokens": 28,
    "total_tokens": 902,
    "prompt_tokens_details": {
      "cached_tokens": 640
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 640,
    "prompt_cache_miss_tokens": 234
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiDone — 20 bottles of milk ordered as two orders (12 + 8), since the order limit is 12 per order.
ended {"reason": "no_tool_calls"}
scenario service_says_no
scenario service_says_no · tools=place_order, price_of · 0.7ms · 2 turns · ended: no_tool_calls
turn 1 · 0.4ms · asked for: price_of
model mock · 0.2ms · asked for: price_of
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 0.1ms (model provider 0.0 · library 0.1) · given: item=milk · raised: ['https://httpbin.org'] answered ['404']
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/status/404?item=milk
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
404
headers (2)
show
content-length0
content-typetext/plain; charset=utf-8
null
attempt {"number": 1, "message": "['https://httpbin.org'] answered ['404']", "retryable": false, "idempotent": true, "caller_can_fix": false}
failed {"message": "['https://httpbin.org'] answered ['404']", "retryable": false, "idempotent": true, "caller_can_fix": false}
turn 2 · 0.3ms · responded with: I could not get the price of milk.
model mock · 0.3ms · responded with: I could not get the price of milk.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
[2]ai
price_of({"item": "milk"})
[3]tool['price_of'] failed: ['https://httpbin.org'] answered ['404']. It will not succeed. Answer without it.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
tools declared to the mock model {"names": ["place_order", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]aiI could not get the price of milk.
ended {"reason": "no_tool_calls"}
scenario service_says_no · tools=place_order, price_of · 2488.4ms · 2 turns · ended: no_tool_calls
turn 1 · 1382.3ms · 416 in / 52 out · asked for: price_of
model live · 1158.2ms (model provider 1148.4 · library 9.8) · 416 in / 52 out · asked for: price_of
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length766
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "How much is milk?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:14 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 f91d1b84d49f9e5cc7391ee66e3cbed0.cloudfront.net (CloudFront)
x-amz-cf-idgBNLwCr4a5__6rAmc4QApZdkFriFj3X3zf55J3v8RK1RyV-IVIvUzA==
x-amz-cf-popDEN52-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idd91bc7a0d64223a69b800f9645a218bf
{
  "id": "2666a2e3-c93e-4bf4-816b-ed49e14402fb",
  "object": "chat.completion",
  "created": 1789336333,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "Just answer with the price. I need to call price_of.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_9Na7quz0x1DzR3V6CpmW8098",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 416,
    "completion_tokens": 52,
    "total_tokens": 468,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 13
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 160
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 224.1ms (model provider 216.8 · library 7.3) · given: item=milk · raised: ['https://httpbin.org'] answered ['404']
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/status/404?item=milk
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (6)
show
accept*/*
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
hosthttpbin.org
user-agentpython-httpx/0.28.1
null
wire response
status
404
headers (7)
show
access-control-allow-credentialstrue
access-control-allow-origin*
connectionkeep-alive
content-length0
content-typetext/html; charset=utf-8
dateSun, 13 Sep 2026 21:52:15 GMT
servergunicorn/19.9.0
null
attempt {"number": 1, "message": "['https://httpbin.org'] answered ['404']", "retryable": false, "idempotent": true, "caller_can_fix": false}
failed {"message": "['https://httpbin.org'] answered ['404']", "retryable": false, "idempotent": true, "caller_can_fix": false}
turn 2 · 1106.0ms · 505 in / 44 out · responded with: I couldn't check the price — the pricing lookup failed, so I don't have the current price ... (58 more characters)
model live · 1106.0ms (model provider 1097.5 · library 8.4) · 505 in / 44 out · responded with: I couldn't check the price — the pricing lookup failed, so I don't have the current price ... (58 more characters)
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanHow much is milk?
[2]ai
price_of({"item": "milk"})
[3]tool['price_of'] failed: ['https://httpbin.org'] answered ['404']. It will not succeed. Answer without it.
declared tools (2)
tooldescriptionschema
place_orderOrder a quantity of an item. Placing an order twice orders it twice.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "Order a quantity of an item. Placing an order twice orders it twice.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}, "quantity": {"title": "Quantity", "type": "integer"}}, "required": ["item", "quantity"], "title": "place_order", "type": "object"}
price_ofThe current shelf price of one of an item, in pounds.{"$defs": {"GroceryItem": {"enum": ["bread", "butter", "chips", "milk"], "type": "string"}}, "description": "The current shelf price of one of an item, in pounds.", "properties": {"item": {"$ref": "#/$defs/GroceryItem"}}, "required": ["item"], "title": "price_of", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length1199
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "How much is milk?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_9Na7quz0x1DzR3V6CpmW8098",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ],
      "reasoning_content": "Just answer with the price. I need to call price_of."
    },
    {
      "content": "['price_of'] failed: ['https://httpbin.org'] answered ['404']. It will not succeed. Answer without it.",
      "role": "tool",
      "tool_call_id": "call_00_9Na7quz0x1DzR3V6CpmW8098"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "place_order",
        "description": "Order a quantity of an item. Placing an order twice orders it twice.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          },
          "required": [
            "item",
            "quantity"
          ],
          "type": "object"
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "price_of",
        "description": "The current shelf price of one of an item, in pounds.",
        "parameters": {
          "properties": {
            "item": {
              "enum": [
                "bread",
                "butter",
                "chips",
                "milk"
              ],
              "type": "string"
            }
          },
          "required": [
            "item"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:52:15 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 be2104da500d7ae8e7fdecc1f206496c.cloudfront.net (CloudFront)
x-amz-cf-idnhqB7F4wvuzfh_dOJVtgIeXe6pQk6XyJFL7clxp5EHhkGXwnrIjP3g==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-ide9fe8f6b623728a2bee6e641e1e5660c
{
  "id": "6c5233b6-62a6-49cc-9700-bcc148780a49",
  "object": "chat.completion",
  "created": 1789336335,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I couldn't check the price \u2014 the pricing lookup failed, so I don't have the current price of milk. You'd need to check the shelf or try again later.",
        "reasoning_content": "The tool failed. Answer without it."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 505,
    "completion_tokens": 44,
    "total_tokens": 549,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 8
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 249
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI couldn't check the price — the pricing lookup failed, so I don't have the current price of milk. You'd need to check the shelf or try again later.
ended {"reason": "no_tool_calls"}