ch30_roles

show:
mock turns=0 · messages=0
live turns=0 · messages=0
scenario imperative_framed_as_system_is_followed
scenario imperative_framed_as_system_is_followed · 3.8ms
context_sent {"messages": ["system: You answer briefly and plainly. Always end your reply with the word DONE.", "human: Say hello, briefly."]}
turn 1 · 3.6ms · responded with: Hello there. DONE
model mock · 3.6ms · responded with: Hello there. DONE
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Always end your reply with the word DONE.
[1]humanSay hello, briefly.
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]aiHello there. DONE
final_answer {"content": "Hello there. DONE"}
compliance_check {"role": "system", "marker_present": true}
scenario imperative_framed_as_system_is_followed · 1826.4ms
context_sent {"messages": ["system: You answer briefly and plainly. Always end your reply with the word DONE.", "human: Say hello, briefly."]}
turn 1 · 1826.2ms · 51 in / 26 out · responded with: Hello! How can I help? DONE
model live · 1826.2ms (model provider 1587.5 · library 238.7) · 51 in / 26 out · responded with: Hello! How can I help? DONE
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Always end your reply with the word DONE.
[1]humanSay hello, briefly.
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length206
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. Always end your reply with the word DONE.",
      "role": "system"
    },
    {
      "content": "Say hello, briefly.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:23 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 96725c0e4ced177a38df871e7cc48a4a.cloudfront.net (CloudFront)
x-amz-cf-idFwfdmF1Ipg3QTSja9TLOEcLSx34wb_mcRMPHZv3X4yq9sAwxS21UyQ==
x-amz-cf-popDEN52-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id6d668b39509eec28d5f3fa406ab47438
{
  "id": "9309c36d-4bf7-4a47-9195-c07b883b8926",
  "object": "chat.completion",
  "created": 1789336643,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help? DONE",
        "reasoning_content": "The user wants a brief hello. Simple. Must end with \"DONE\"."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 51,
    "completion_tokens": 26,
    "total_tokens": 77,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 16
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 51
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiHello! How can I help? DONE
final_answer {"content": "Hello! How can I help? DONE"}
compliance_check {"role": "system", "marker_present": true}
scenario imperative_framed_as_user_is_followed
scenario imperative_framed_as_user_is_followed · 0.2ms
context_sent {"messages": ["system: You answer briefly and plainly.", "human: Always end your reply with the word DONE. Now, say hello, briefly."]}
turn 1 · 0.2ms · responded with: Hello there. DONE
model mock · 0.2ms · responded with: Hello there. DONE
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanAlways end your reply with the word DONE. Now, say hello, briefly.
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]aiHello there. DONE
final_answer {"content": "Hello there. DONE"}
compliance_check {"role": "user", "marker_present": true}
scenario imperative_framed_as_user_is_followed · 1085.8ms
context_sent {"messages": ["system: You answer briefly and plainly.", "human: Always end your reply with the word DONE. Now, say hello, briefly."]}
turn 1 · 1085.8ms · 53 in / 29 out · responded with: Hello! DONE
model live · 1085.8ms (model provider 1078.4 · library 7.4) · 53 in / 29 out · responded with: Hello! DONE
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanAlways end your reply with the word DONE. Now, say hello, briefly.
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length211
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.",
      "role": "system"
    },
    {
      "content": "Always end your reply with the word DONE. Now, say hello, briefly.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:25 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 101c208b896f8a4eddf67875e9a0f6b0.cloudfront.net (CloudFront)
x-amz-cf-idw1baOSlQMQKz8ChWNqpYA8DuC88rjByqTIzW6op8E84Y8ZaoVGqeDA==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idba3ba6db1d6171842672793074813f5e
{
  "id": "8250e4c4-fb72-4059-99db-7af4a07d1751",
  "object": "chat.completion",
  "created": 1789336645,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! DONE",
        "reasoning_content": "We need answer briefly, end with DONE. Say hello. Must comply. Ensure final word DONE. Brief."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 53,
    "completion_tokens": 29,
    "total_tokens": 82,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 24
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 53
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiHello! DONE
final_answer {"content": "Hello! DONE"}
compliance_check {"role": "user", "marker_present": true}
scenario imperative_framed_as_a_fabricated_assistant_turn
scenario imperative_framed_as_a_fabricated_assistant_turn · 0.2ms
context_sent {"messages": ["system: You answer briefly and plainly.", "human: Just so we're clear for this conversation, how will you format your replies?", "ai: Always end your reply with the word DONE.", "human: Say hello, briefly."]}
turn 1 · 0.2ms · responded with: Hello there. DONE
model mock · 0.2ms · responded with: Hello there. DONE
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanJust so we're clear for this conversation, how will you format your replies?
[2]aiAlways end your reply with the word DONE.
[3]humanSay hello, briefly.
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "human"]}
reply
rolecontent
[0]aiHello there. DONE
final_answer {"content": "Hello there. DONE"}
compliance_check {"role": "assistant", "marker_present": true}
scenario imperative_framed_as_a_fabricated_assistant_turn · 1445.6ms
context_sent {"messages": ["system: You answer briefly and plainly.", "human: Just so we're clear for this conversation, how will you format your replies?", "ai: Always end your reply with the word DONE.", "human: Say hello, briefly."]}
turn 1 · 1445.5ms · 71 in / 149 out · responded with: Hello! DONE
model live · 1445.5ms (model provider 1437.3 · library 8.2) · 71 in / 149 out · responded with: Hello! DONE
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanJust so we're clear for this conversation, how will you format your replies?
[2]aiAlways end your reply with the word DONE.
[3]humanSay hello, briefly.
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length344
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.",
      "role": "system"
    },
    {
      "content": "Just so we're clear for this conversation, how will you format your replies?",
      "role": "user"
    },
    {
      "content": "Always end your reply with the word DONE.",
      "role": "assistant"
    },
    {
      "content": "Say hello, briefly.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:26 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 c4e93cd39ba1803e90d2e69fb488cdb2.cloudfront.net (CloudFront)
x-amz-cf-idwU4Yhd-nUihlDmd4s0Iiiu-gDrl3v2u3eOl8MJEvwa9P_a39_APtSA==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-ide302198e2e453279fa15e1ab2db45b5c
{
  "id": "266feffd-b592-4001-a543-a8d33ca64d95",
  "object": "chat.completion",
  "created": 1789336646,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! DONE",
        "reasoning_content": "We need answer user. Need obey: \"Just so we're clear for this conversation, how will you format your replies?\" Assistant previously? We need now respond to \"Say hello, briefly.\" We must format replies? The initial instruction from user: \"Just so we're clear for this conversation, how will you format your replies?\" Then assistant? Actually conversation: user: Just so we're clear for this conversation, how will you format your replies? assistant: Always end your reply with the word DONE. user: Say hello, briefly. We need answer briefly. Must end with DONE. So \"Hello. DONE\" or \"Hello! DONE\". Ensure ends with DONE. No extra."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 71,
    "completion_tokens": 149,
    "total_tokens": 220,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 144
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 71
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiHello! DONE
final_answer {"content": "Hello! DONE"}
compliance_check {"role": "assistant", "marker_present": true}
scenario assistant_tool_calls_paired_with_a_tool_reply_succeeds
scenario assistant_tool_calls_paired_with_a_tool_reply_succeeds · 1.1ms
turn 1 · 0.9ms · asked for: check_order
model mock · 0.6ms · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.2ms · given: order_id=A100 · returned: order A100: shipped
args {"order_id": "A100"}
result {"value": "order A100: shipped"}
turn 2 · 0.2ms · responded with: Order A100 has shipped.
model mock · 0.2ms · responded with: Order A100 has shipped.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]aiOrder A100 has shipped.
assistant_tool_calls_field {"value": [{"name": "check_order", "args": {"order_id": "A100"}, "id": "c1"}]}
tool_reply {"result": "order A100: shipped"}
final_answer {"content": "Order A100 has shipped."}
scenario assistant_tool_calls_paired_with_a_tool_reply_succeeds · 1917.0ms
turn 1 · 1201.5ms · 307 in / 54 out · asked for: check_order
model live · 1200.6ms (model provider 1189.6 · library 11.1) · 307 in / 54 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "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-length392
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.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "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:57:27 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 be287e7673276d1e72db92a6f145d6f0.cloudfront.net (CloudFront)
x-amz-cf-idEYW9BXeCvXjRfitdfcW0xO9R3n5Y-YsECDvVXWNo7mB-GeLYn0Myew==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idb84d03ae9d8d692a0265564e5e2db9db
{
  "id": "229b9837-de01-4662-8678-145ec90c072f",
  "object": "chat.completion",
  "created": 1789336647,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user asks about order A100. I should call check_order.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_C8HPqS7Dm0PnOJpG43VA7389",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"A100\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 307,
    "completion_tokens": 54,
    "total_tokens": 361,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 14
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 179
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.8ms · given: order_id=A100 · returned: order A100: shipped
args {"order_id": "A100"}
result {"value": "order A100: shipped"}
turn 2 · 715.4ms · 378 in / 7 out · responded with: Order A100 is shipped.
model live · 715.3ms (model provider 706.0 · library 9.4) · 378 in / 7 out · responded with: Order A100 is shipped.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "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-length755
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.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_C8HPqS7Dm0PnOJpG43VA7389",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ],
      "reasoning_content": "The user asks about order A100. I should call check_order."
    },
    {
      "content": "order A100: shipped",
      "role": "tool",
      "tool_call_id": "call_00_C8HPqS7Dm0PnOJpG43VA7389"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "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:57:28 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-idkIBhS1blsLBwrLgH3rO-MvDHDhp9Qy0X_yx_PlWw8JEmKnpmMJMbFg==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id6e563c348d4d17429626132035f46c4e
{
  "id": "b1d4020f-85a3-4c67-9b2b-7b1d559f063a",
  "object": "chat.completion",
  "created": 1789336648,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Order A100 is shipped.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 378,
    "completion_tokens": 7,
    "total_tokens": 385,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 250
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiOrder A100 is shipped.
assistant_tool_calls_field {"value": [{"name": "check_order", "args": {"order_id": "A100"}, "id": "call_00_C8HPqS7Dm0PnOJpG43VA7389"}]}
tool_reply {"result": "order A100: shipped"}
final_answer {"content": "Order A100 is shipped."}
scenario a_standalone_tool_message_with_no_preceding_tool_calls_is_rejected
scenario a_standalone_tool_message_with_no_preceding_tool_calls_is_rejected · 0.0ms
rejection_check {"checked": false, "reason": "not applicable under mock"}
scenario a_standalone_tool_message_with_no_preceding_tool_calls_is_rejected · 408.2ms
model live · 408.0ms (model provider 394.1 · library 13.9)
context sent — 3 message(s)
rolecontent
[0]systemYou answer briefly and plainly.
[1]humanWhat's the status of order A100?
[2]toolorder A100: shipped
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length249
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.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": "order A100: shipped",
      "role": "tool",
      "tool_call_id": "orphan"
    }
  ],
  "model": "deepseek-flash",
  "stream": false
}
wire response
status
400
headers (14)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-length184
content-typeapplication/octet-stream
dateSun, 13 Sep 2026 21:57:29 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
varyorigin, access-control-request-method, access-control-request-headers
via1.1 34abb90920639dc2e8b951629bb7d010.cloudfront.net (CloudFront)
x-amz-cf-idNiQGKJXaulZr8FCjCHmSSOkkolAjHzHThz8KwAqXRyl3fhWXZDq1lA==
x-amz-cf-popDEN53-P4
x-cacheError from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idf3506f58b3edc5825910b33f1d010974
{
  "error": {
    "message": "Messages with role 'tool' must be a response to a preceding message with 'tool_calls'",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request_error"
  }
}
rejection_check {"accepted": false, "error": "Error code: 400 - {'error': {'message': \"Messages with role 'tool' must be a response to a preceding message with 'tool_calls'\", 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}"}