structured-outputs
4 traces
- OpenAI Responses API function tools are internally tagged and strict by default — not the Chat Completions shapePorting Chat Completions code to client.responses.create, the agent passes tools=[{"type":"function","function":{...}}] and responseformat=..., reads choices[0].message, and returns tool results as role: tool messages.…
- Anthropic structured outputs: output_format is deprecated — move to output_config.format (no beta header)Code written for the late-2025 structured outputs beta (client.beta.messages.create(..., outputformat={...}, betas=["structured-outputs-2025-11-13"])) fails: without the beta header the API returns 400, and the Python…
- tool_choice: type "tool" and "any" are not supported for this model. — forced tool use rejected on Claude Opus 5.5A request with toolchoice: {"type": "tool", "name": "extract"} or {"type": "any"} (the classic way to force JSON extraction through a tool) returns 400 on claude-opus-5-5, including on the token-counting endpoint:…
- Assistant-message prefill returns 400 on Claude Opus 4.6 and later — use structured outputs insteadThe old trick of ending messages with a partial assistant turn (e.g. Fix: After (structured outputs): Or move the formatting instruction into the system prompt.