ch07_tool_http

show:
mock turns=10 · messages=25
live turns=10 · messages=25
scenario service_answers
scenario service_answers · tools=price_of · 3.7ms · 2 turns · ended: no_tool_calls
turn 1 · 3.3ms · asked for: price_of
model mock · 2.8ms · 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 (1)
tooldescriptionschema
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": ["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.4ms (model provider 0.2 · library 0.2) · given: item=milk · returned: 1.20
args {"item": "milk"}
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-length140
content-typeapplication/json
{
  "args": {
    "item": "milk"
  },
  "headers": {
    "Authorization": "Bearer primer-demo-key",
    "Host": "httpbin.org"
  },
  "url": "https://httpbin.org/get?item=milk"
}
result {"value": "1.20"}
turn 2 · 0.3ms · responded with: Milk is 1.20.
model mock · 0.3ms · 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 (1)
tooldescriptionschema
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": ["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_answers · tools=price_of · 2116.0ms · 2 turns · ended: no_tool_calls
turn 1 · 1408.9ms · 330 in / 51 out · asked for: price_of
model live · 1182.8ms (model provider 1004.0 · library 178.8) · 330 in / 51 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 (1)
tooldescriptionschema
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-length454
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": "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:51:40 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 b29a91b65eb208088dd6199048205ee4.cloudfront.net (CloudFront)
x-amz-cf-id6xtgUIClhwLRAMqbsgjNsSb3Eqt94nrTDP0XVowvVhwGQLVMWWsCTg==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id1c5cae46f237465553abd0ae81491cf2
{
  "id": "d5177a4f-f3fe-4684-af80-74b6564fa925",
  "object": "chat.completion",
  "created": 1789336299,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user asks the price of milk. Use the tool.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_L2Pv2e2TQsHdvuTbcF0L8037",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 330,
    "completion_tokens": 51,
    "total_tokens": 381,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 12
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 202
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 226.0ms (model provider 220.6 · library 5.4) · given: item=milk · returned: 1.20
args {"item": "milk"}
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:51:40 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-6aa71aec-6c5796766e7997552592f819"
  },
  "origin": "71.218.120.63",
  "url": "https://httpbin.org/get?item=milk"
}
result {"value": "1.20"}
turn 2 · 706.9ms · 396 in / 9 out · responded with: Milk costs £1.20.
model live · 706.8ms (model provider 697.2 · library 9.7) · 396 in / 9 out · responded with: Milk costs £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 (1)
tooldescriptionschema
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-length783
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_L2Pv2e2TQsHdvuTbcF0L8037",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ],
      "reasoning_content": "The user asks the price of milk. Use the tool."
    },
    {
      "content": "1.20",
      "role": "tool",
      "tool_call_id": "call_00_L2Pv2e2TQsHdvuTbcF0L8037"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "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:51:41 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 d367a81605c570be8f51546cf4468ece.cloudfront.net (CloudFront)
x-amz-cf-idBewgDKqSDHk_oaoOIa7M-chZXSJTViRavwZwZHxgT1dX9krnsdX1Zw==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id6df5cab6822733d80b3d1fc5eafd0c8a
{
  "id": "4cc188d5-e3ec-47ed-bbf6-f7acf8571683",
  "object": "chat.completion",
  "created": 1789336301,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Milk costs \u00a31.20.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 396,
    "completion_tokens": 9,
    "total_tokens": 405,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 140
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiMilk costs £1.20.
ended {"reason": "no_tool_calls"}
scenario service_rate_limits
scenario service_rate_limits · tools=price_of · 0.6ms · 2 turns · ended: no_tool_calls
turn 1 · 0.3ms · 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 (1)
tooldescriptionschema
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": ["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.2ms (model provider 0.0 · library 0.1) · given: item=milk · raised: PriceServiceError (['https://httpbin.org'] answered ['429'])
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-after3
null
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] answered ['429']"}
turn 2 · 0.2ms · responded with: I could not get the price of milk.
model mock · 0.2ms · 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 ['429']. Answer without it.
declared tools (1)
tooldescriptionschema
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": ["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_rate_limits · tools=price_of · 2430.8ms · 2 turns · ended: no_tool_calls
turn 1 · 874.1ms · 330 in / 48 out · asked for: price_of
model live · 682.4ms (model provider 672.9 · library 9.6) · 330 in / 48 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 (1)
tooldescriptionschema
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-length454
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": "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:51:41 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 0ca89aa790ddfc1fc4c04f63c3cabae6.cloudfront.net (CloudFront)
x-amz-cf-idcD1wSMX31UUzAyMqWAvulm2Z8cF6c60q9UtRhA5zFzRieedN5B-dgQ==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idaf8f08b62f8a3d8fe4927b59327bb61e
{
  "id": "9994cfda-5c13-4179-9038-0904e8a11c17",
  "object": "chat.completion",
  "created": 1789336301,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "User asks price of milk. Call tool.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_29KVzNEumh3bwuoRZBPW4110",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 330,
    "completion_tokens": 48,
    "total_tokens": 378,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 9
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 202
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 191.6ms (model provider 185.5 · library 6.1) · given: item=milk · raised: PriceServiceError (['https://httpbin.org'] answered ['429'])
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:51:42 GMT
servergunicorn/19.9.0
null
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] answered ['429']"}
turn 2 · 1556.7ms · 410 in / 77 out · responded with: I couldn't get the price — the price lookup failed (the service returned a "too many reque... (152 more characters)
model live · 1556.7ms (model provider 1545.0 · library 11.6) · 410 in / 77 out · responded with: I couldn't get the price — the price lookup failed (the service returned a "too many reque... (152 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 ['429']. Answer without it.
declared tools (1)
tooldescriptionschema
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-length849
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_29KVzNEumh3bwuoRZBPW4110",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ],
      "reasoning_content": "User asks price of milk. Call tool."
    },
    {
      "content": "['price_of'] failed: ['https://httpbin.org'] answered ['429']. Answer without it.",
      "role": "tool",
      "tool_call_id": "call_00_29KVzNEumh3bwuoRZBPW4110"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "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:51:42 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 b35c566c5c237e7090b19170d36f7ad2.cloudfront.net (CloudFront)
x-amz-cf-idw4Kz0grmXUFKmB4PNPAksJlSgQLbxFSRlThb3Iz0wDzy2nzHps3zhQ==
x-amz-cf-popDEN53-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id75a5d6a3f550efc2e4a61c66ec6e1ff5
{
  "id": "45083037-958d-4e5d-9fd3-85dde7f0dff2",
  "object": "chat.completion",
  "created": 1789336302,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I couldn't get the price \u2014 the price lookup failed (the service returned a \"too many requests\" error). I don't have another way to check it, so I can't tell you how much milk costs right now. Feel free to ask again in a moment and I'll retry.",
        "reasoning_content": "The tool failed. I should answer plainly that I couldn't get the price."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 410,
    "completion_tokens": 77,
    "total_tokens": 487,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 16
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 154
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI couldn't get the price — the price lookup failed (the service returned a "too many requests" error). I don't have another way to check it, so I can't tell you how much milk costs right now. Feel free to ask again in a moment and I'll retry.
ended {"reason": "no_tool_calls"}
scenario service_is_broken
scenario service_is_broken · tools=price_of · 0.5ms · 2 turns · ended: no_tool_calls
turn 1 · 0.3ms · 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 (1)
tooldescriptionschema
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": ["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: PriceServiceError (['https://httpbin.org'] answered ['500'])
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/status/500?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
500
headers (2)
show
content-length0
content-typetext/plain; charset=utf-8
null
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] answered ['500']"}
turn 2 · 0.1ms · responded with: I could not get the price of milk.
model mock · 0.1ms · 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 ['500']. Answer without it.
declared tools (1)
tooldescriptionschema
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": ["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_is_broken · tools=price_of · 2501.6ms · 2 turns · ended: no_tool_calls
turn 1 · 1303.5ms · 330 in / 39 out · asked for: price_of
model live · 1112.5ms (model provider 1104.6 · library 7.8) · 330 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 (1)
tooldescriptionschema
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-length454
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": "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:51:44 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 053c5da1899ec0e6bd16002f05ca768a.cloudfront.net (CloudFront)
x-amz-cf-iduRiEFNV8dULleqcZgCf31-YImyUTJE4_ha-mDtlFqgKdBGv9CrLzxA==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idff4b1e41351dd40641a7804b875fe4c4
{
  "id": "10a8b994-341a-4789-b10b-3edbb58c3b09",
  "object": "chat.completion",
  "created": 1789336304,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_ET_D7oOKuyDQw9FFAPylzbl2921",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 330,
    "completion_tokens": 39,
    "total_tokens": 369,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 202
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 191.0ms (model provider 185.3 · library 5.6) · given: item=milk · raised: PriceServiceError (['https://httpbin.org'] answered ['500'])
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/status/500?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
500
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:51:45 GMT
servergunicorn/19.9.0
null
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] answered ['500']"}
turn 2 · 1198.1ms · 401 in / 52 out · responded with: I couldn't look it up — the price service returned an error, so I don't have the price of ... (37 more characters)
model live · 1198.1ms (model provider 1188.7 · library 9.4) · 401 in / 52 out · responded with: I couldn't look it up — the price service returned an error, so I don't have the price of ... (37 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 ['500']. Answer without it.
declared tools (1)
tooldescriptionschema
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-length797
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_D7oOKuyDQw9FFAPylzbl2921",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ]
    },
    {
      "content": "['price_of'] failed: ['https://httpbin.org'] answered ['500']. Answer without it.",
      "role": "tool",
      "tool_call_id": "call_00_ET_D7oOKuyDQw9FFAPylzbl2921"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "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:51:45 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 ab0145b9843311a8d571dbd6cb58e86a.cloudfront.net (CloudFront)
x-amz-cf-id5ja4fGdfYsTKO2tH_NKAkrbjj3rDkPTaE1hKUOF8m3tn4Aj3TLiazw==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id9812910eda6194bb2294a7735c468dd5
{
  "id": "26abd613-4761-42aa-b9ad-65b0a1a4fed5",
  "object": "chat.completion",
  "created": 1789336305,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I couldn't look it up \u2014 the price service returned an error, so I don't have the price of milk right now. Want me to try again?",
        "reasoning_content": "The tool failed. Answer without it, i.e., say I couldn't get the price."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 401,
    "completion_tokens": 52,
    "total_tokens": 453,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 19
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 145
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI couldn't look it up — the price service returned an error, so I don't have the price of milk right now. Want me to try again?
ended {"reason": "no_tool_calls"}
scenario service_says_no
scenario service_says_no · tools=price_of · 0.8ms · 2 turns · ended: no_tool_calls
turn 1 · 0.5ms · asked for: price_of
model mock · 0.3ms · 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 (1)
tooldescriptionschema
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": ["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.2ms (model provider 0.1 · library 0.1) · given: item=milk · raised: PriceServiceError (['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
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] answered ['404']"}
turn 2 · 0.2ms · responded with: I could not get the price of milk.
model mock · 0.2ms · 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']. Answer without it.
declared tools (1)
tooldescriptionschema
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": ["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=price_of · 2286.2ms · 2 turns · ended: no_tool_calls
turn 1 · 1097.2ms · 330 in / 39 out · asked for: price_of
model live · 901.6ms (model provider 892.6 · library 9.0) · 330 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 (1)
tooldescriptionschema
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-length454
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": "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:51:46 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 afe2a1120748a37da1066bf9f260ec02.cloudfront.net (CloudFront)
x-amz-cf-idGCHpM4e9nkUiYIzLbD_SULdgVJqIJROXaHsybu3VgB1QP95NIn2z3g==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-ide171b5d3bdcdf8934b667204501e25f3
{
  "id": "054c1033-97cc-4b8c-b23d-062a27cc6be1",
  "object": "chat.completion",
  "created": 1789336306,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_ET_aeTnKddgtmtn2IXO7Y021273",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 330,
    "completion_tokens": 39,
    "total_tokens": 369,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 202
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 195.6ms (model provider 187.8 · library 7.8) · given: item=milk · raised: PriceServiceError (['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:51:47 GMT
servergunicorn/19.9.0
null
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] answered ['404']"}
turn 2 · 1188.9ms · 401 in / 52 out · responded with: I couldn't get the price — the lookup failed, so I don't have a current figure for milk. Y... (46 more characters)
model live · 1188.9ms (model provider 1178.4 · library 10.5) · 401 in / 52 out · responded with: I couldn't get the price — the lookup failed, so I don't have a current figure for milk. Y... (46 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']. Answer without it.
declared tools (1)
tooldescriptionschema
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-length797
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_aeTnKddgtmtn2IXO7Y021273",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ]
    },
    {
      "content": "['price_of'] failed: ['https://httpbin.org'] answered ['404']. Answer without it.",
      "role": "tool",
      "tool_call_id": "call_00_ET_aeTnKddgtmtn2IXO7Y021273"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "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:51:47 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 ebcfae1084a6f4b6ecf9ff045173381c.cloudfront.net (CloudFront)
x-amz-cf-idyMgonZHX1uGvcaASBlcJMbynysQTf0KDp6UTFpQo1Kkv0HOr4cRTtw==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idc6e49506ba9d2a1f36657d6ca5770f8b
{
  "id": "51e1bec6-f83d-41f3-b76a-ef72da96b200",
  "object": "chat.completion",
  "created": 1789336307,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I couldn't get the price \u2014 the lookup failed, so I don't have a current figure for milk. You may need to check the shelf price directly.",
        "reasoning_content": "The tool failed. I should answer without it. Just say I couldn't retrieve the price."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 401,
    "completion_tokens": 52,
    "total_tokens": 453,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 19
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 145
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI couldn't get the price — the lookup failed, so I don't have a current figure for milk. You may need to check the shelf price directly.
ended {"reason": "no_tool_calls"}
scenario service_is_slow
scenario service_is_slow · tools=price_of · 0.5ms · 2 turns · ended: no_tool_calls
turn 1 · 0.3ms · 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 (1)
tooldescriptionschema
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": ["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 · given: item=milk · raised: PriceServiceError (['https://httpbin.org'] did not answer in time)
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/delay/10?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
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] did not answer in time"}
turn 2 · 0.2ms · responded with: I could not get the price of milk.
model mock · 0.2ms · 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'] did not answer in time. Answer without it.
declared tools (1)
tooldescriptionschema
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": ["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_is_slow · tools=price_of · 4133.7ms · 2 turns · ended: no_tool_calls
turn 1 · 3336.4ms · 330 in / 39 out · asked for: price_of
model live · 1185.5ms (model provider 1174.3 · library 11.2) · 330 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 (1)
tooldescriptionschema
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-length454
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": "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:51:49 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 898cace407c8c555d5663d79cc4cc36a.cloudfront.net (CloudFront)
x-amz-cf-idr_PJVM6MsyL4kShC425722uYSZYnoOjgkWZlrzQ4BseDvetFDwjVVg==
x-amz-cf-popDEN52-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id378a3a7f923fcb0e5942022268c2d300
{
  "id": "19db9fea-5d9e-4299-82d8-713bf4ceadb3",
  "object": "chat.completion",
  "created": 1789336309,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_ET_VTBaT0ijCfo27tQyLcHo8300",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"milk\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 330,
    "completion_tokens": 39,
    "total_tokens": 369,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 202
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "milk"})
tool price_of · 2150.8ms · given: item=milk · raised: PriceServiceError (['https://httpbin.org'] did not answer in time)
args {"item": "milk"}
wire request
attempt
1
method
GET
url
https://httpbin.org/delay/10?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
failed {"exception": "PriceServiceError", "message": "['https://httpbin.org'] did not answer in time"}
turn 2 · 797.3ms · 403 in / 49 out · responded with: I couldn't retrieve the price — the lookup timed out, so I don't have a figure for milk ri... (30 more characters)
model live · 797.1ms (model provider 784.0 · library 13.1) · 403 in / 49 out · responded with: I couldn't retrieve the price — the lookup timed out, so I don't have a figure for milk ri... (30 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'] did not answer in time. Answer without it.
declared tools (1)
tooldescriptionschema
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-length803
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_VTBaT0ijCfo27tQyLcHo8300",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"milk\"}"
          }
        }
      ]
    },
    {
      "content": "['price_of'] failed: ['https://httpbin.org'] did not answer in time. Answer without it.",
      "role": "tool",
      "tool_call_id": "call_00_ET_VTBaT0ijCfo27tQyLcHo8300"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "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:51:52 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-id_fKSKkS6Kvhi5nmVWOzxDr486bFvMdGGaooeWZEs8Bo_oI4-8rnJEQ==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id03d4d024dc2c074617788f00dda607f0
{
  "id": "9c9f2d98-889d-4141-abbc-fb47eac22093",
  "object": "chat.completion",
  "created": 1789336312,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I couldn't retrieve the price \u2014 the lookup timed out, so I don't have a figure for milk right now. Want me to try again?",
        "reasoning_content": "The tool failed. I should answer without it \u2014 say I couldn't get the price."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 403,
    "completion_tokens": 49,
    "total_tokens": 452,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 18
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 147
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI couldn't retrieve the price — the lookup timed out, so I don't have a figure for milk right now. Want me to try again?
ended {"reason": "no_tool_calls"}