ch05_loop_endings

show:
mock turns=4 · messages=10
live turns=4 · messages=10
scenario within_token_limit
scenario within_token_limit · 4.2ms · 3 turns · ended: answer_received (finish_reason = stop)
turn 1 · 3.3ms · asked for: lowest_stock_item
model mock · 3.2ms · asked for: lowest_stock_item
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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": ["lowest_stock_item", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
lowest_stock_item({})
tool lowest_stock_item · 0.2ms · returned: butter
args {}
result {"value": "butter"}
turn 2 · 0.4ms · asked for: price_of
model mock · 0.3ms · asked for: price_of
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
[2]ai
lowest_stock_item({})
[3]toolbutter
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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": ["lowest_stock_item", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]ai
price_of({"item": "butter"})
tool price_of · 0.2ms · given: item=butter · returned: 3.10
args {"item": "butter"}
result {"value": "3.10"}
turn 3 · 0.3ms · responded with: Butter, at 3.10 -- there is only one left, so it is the lowest we hold.
model mock · 0.3ms · responded with: Butter, at 3.10 -- there is only one left, so it is the lowest we hold.
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
[2]ai
lowest_stock_item({})
[3]toolbutter
[4]ai
price_of({"item": "butter"})
[5]tool3.10
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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": ["lowest_stock_item", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 6, "roles": ["system", "human", "ai", "tool", "ai", "tool"]}
reply
rolecontent
[0]aiButter, at 3.10 -- there is only one left, so it is the lowest we hold.
ended {"reason": "answer_received (finish_reason = stop)"}
scenario within_token_limit · 3655.1ms · 3 turns · ended: answer_received (finish_reason = stop)
turn 1 · 1314.0ms · 381 in / 102 out · asked for: lowest_stock_item
model live · 1313.4ms (model provider 1129.1 · library 184.3) · 381 in / 102 out · asked for: lowest_stock_item
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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-length674
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": "Whatever we are lowest on -- what does one of them cost, and why is it low?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "lowest_stock_item",
        "description": "Which item there is least of in stock.",
        "parameters": {
          "properties": {},
          "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:51:27 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 6d3c3e0af3263a7b3c6878f2fa9bbff6.cloudfront.net (CloudFront)
x-amz-cf-idBzi2g55pyAk5rHWPEBtRSFLNPTA4zvibhmhAycZBWUc5uouRDKqePw==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id773b2cebf917ba9cfce891e8e1c7d804
{
  "id": "d6058860-1c0e-46b3-aea8-a01fa04b3685",
  "object": "chat.completion",
  "created": 1789336287,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user asks: whatever we're lowest on, what does one cost, and why is low?\n\nI need to call lowest_stock_item and then price_of the item. The \"why is it low\" \u2014 I have no tool for that. Let me do the calls.\n\nFirst call lowest_stock_item, then price_of with the result. These are dependent, so sequential.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_urC4Ze1lK1IjyE068xtA5669",
            "type": "function",
            "function": {
              "name": "lowest_stock_item",
              "arguments": "{}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 381,
    "completion_tokens": 102,
    "total_tokens": 483,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 77
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 253
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
lowest_stock_item({})
tool lowest_stock_item · 0.5ms · returned: butter
args {}
result {"value": "butter"}
turn 2 · 906.2ms · 497 in / 45 out · asked for: price_of
model live · 905.8ms (model provider 896.9 · library 8.9) · 497 in / 45 out · asked for: price_of
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
[2]ai
lowest_stock_item({})
[3]toolbutter
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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-length1262
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": "Whatever we are lowest on -- what does one of them cost, and why is it low?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_urC4Ze1lK1IjyE068xtA5669",
          "function": {
            "name": "lowest_stock_item",
            "arguments": "{}"
          }
        }
      ],
      "reasoning_content": "The user asks: whatever we're lowest on, what does one cost, and why is low?\n\nI need to call lowest_stock_item and then price_of the item. The \"why is it low\" \u2014 I have no tool for that. Let me do the calls.\n\nFirst call lowest_stock_item, then price_of with the result. These are dependent, so sequential."
    },
    {
      "content": "butter",
      "role": "tool",
      "tool_call_id": "call_00_urC4Ze1lK1IjyE068xtA5669"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "lowest_stock_item",
        "description": "Which item there is least of in stock.",
        "parameters": {
          "properties": {},
          "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:51:28 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 db28001b9bfb563d1bfcaccd38c4436a.cloudfront.net (CloudFront)
x-amz-cf-idE4s0qH5fXGE7WnfU6vFBUuVF4UYc5cfDFpio2XE9EfGyj4VMlxSXMg==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id1e25ae8cdafdd3662186681ca3061ff0
{
  "id": "bcebcf55-07e8-4d4b-aefd-14593d1605e2",
  "object": "chat.completion",
  "created": 1789336288,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "Now get price of butter.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_FLq9PpsP2BUAvtVSwNtl0374",
            "type": "function",
            "function": {
              "name": "price_of",
              "arguments": "{\"item\": \"butter\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 497,
    "completion_tokens": 45,
    "total_tokens": 542,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 6
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 241
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
price_of({"item": "butter"})
tool price_of · 0.4ms · given: item=butter · returned: 3.10
args {"item": "butter"}
result {"value": "3.10"}
turn 3 · 1434.7ms · 557 in / 95 out · responded with: We're lowest on **butter** — one costs **£3.10**. As for why it's low, I don't have any wa... (283 more characters)
model live · 1434.7ms (model provider 1426.3 · library 8.4) · 557 in / 95 out · responded with: We're lowest on **butter** — one costs **£3.10**. As for why it's low, I don't have any wa... (283 more characters)
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
[2]ai
lowest_stock_item({})
[3]toolbutter
[4]ai
price_of({"item": "butter"})
[5]tool3.10
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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-length1571
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": "Whatever we are lowest on -- what does one of them cost, and why is it low?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_urC4Ze1lK1IjyE068xtA5669",
          "function": {
            "name": "lowest_stock_item",
            "arguments": "{}"
          }
        }
      ],
      "reasoning_content": "The user asks: whatever we're lowest on, what does one cost, and why is low?\n\nI need to call lowest_stock_item and then price_of the item. The \"why is it low\" \u2014 I have no tool for that. Let me do the calls.\n\nFirst call lowest_stock_item, then price_of with the result. These are dependent, so sequential."
    },
    {
      "content": "butter",
      "role": "tool",
      "tool_call_id": "call_00_urC4Ze1lK1IjyE068xtA5669"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_FLq9PpsP2BUAvtVSwNtl0374",
          "function": {
            "name": "price_of",
            "arguments": "{\"item\": \"butter\"}"
          }
        }
      ],
      "reasoning_content": "Now get price of butter."
    },
    {
      "content": "3.10",
      "role": "tool",
      "tool_call_id": "call_00_FLq9PpsP2BUAvtVSwNtl0374"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "lowest_stock_item",
        "description": "Which item there is least of in stock.",
        "parameters": {
          "properties": {},
          "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:51:29 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 2a3bfb7cadc3003297b11ce744cb58fa.cloudfront.net (CloudFront)
x-amz-cf-idE5YZKU8zUeD19Ji_t294IT7kroTmn5lAE5AuU50QOHg5woI7AsJ4kQ==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id90c0c4f04d315c0e417be29f84246d0a
{
  "id": "93cb87d3-490c-46b9-8a78-dea9447d6138",
  "object": "chat.completion",
  "created": 1789336289,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "We're lowest on **butter** \u2014 one costs **\u00a33.10**.\n\nAs for why it's low, I don't have any way to tell you that. I only have tools that report the lowest-stock item and shelf prices; nothing about deliveries, sales rates, or ordering history. So I can't say whether it's selling fast, wasn't restocked, or something else \u2014 you'd need to check the stock/order records for that.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 557,
    "completion_tokens": 95,
    "total_tokens": 652,
    "prompt_tokens_details": {
      "cached_tokens": 384
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 384,
    "prompt_cache_miss_tokens": 173
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiWe're lowest on **butter** — one costs **£3.10**. As for why it's low, I don't have any way to tell you that. I only have tools that report the lowest-stock item and shelf prices; nothing about deliveries, sales rates, or ordering history. So I can't say whether it's selling fast, wasn't restocked, or something else — you'd need to check the stock/order records for that.
ended {"reason": "answer_received (finish_reason = stop)"}
scenario tokens_exhausted
scenario tokens_exhausted · max_tokens=24 · 0.3ms · 1 turn · ended: tokens_exhausted (finish_reason = length)
turn 1 · 0.3ms · responded with: nothing
model mock · 0.3ms · responded with: nothing
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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": ["lowest_stock_item", "price_of"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
ended {"reason": "tokens_exhausted (finish_reason = length)"}
scenario tokens_exhausted · max_tokens=24 · 689.8ms · 1 turn · ended: tokens_exhausted (finish_reason = length)
turn 1 · 689.7ms · 381 in / 24 out · responded with: nothing
model live · 689.7ms (model provider 680.5 · library 9.2) · 381 in / 24 out · responded with: nothing
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhatever we are lowest on -- what does one of them cost, and why is it low?
declared tools (2)
tooldescriptionschema
lowest_stock_itemWhich item there is least of in stock.{"description": "Which item there is least of in stock.", "properties": {}, "title": "lowest_stock_item", "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 (5)
temperature, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length690
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": "Whatever we are lowest on -- what does one of them cost, and why is it low?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "max_tokens": 24,
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "lowest_stock_item",
        "description": "Which item there is least of in stock.",
        "parameters": {
          "properties": {},
          "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:51:31 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 64848ec57c47075a07d474d58b9c719a.cloudfront.net (CloudFront)
x-amz-cf-id2KE9nxP9hKo1RP6--leMnEJqS4GFHrkiKza6yxr2ce-7kP2cuZCqhA==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id93e221787e00e64fd3b379ed890268bc
{
  "id": "c00edb49-56cc-4b70-ad15-7ea01fe35752",
  "object": "chat.completion",
  "created": 1789336291,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "We need to find lowest stock item, then price of it. Then explain why it's low \u2014 but we have no"
      },
      "logprobs": null,
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 381,
    "completion_tokens": 24,
    "total_tokens": 405,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 24
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 253
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
ended {"reason": "tokens_exhausted (finish_reason = length)"}