ollama/openai
7. Sun 612f0a17d3
fix: improve error message for unknown input item type in responses API (#15424)
The default branch in unmarshalResponsesInputItem had two issues:
- It referenced typeField.Type instead of itemType; these differ when the
  shorthand role-based format promotes an empty type to "message", meaning
  an unhandled type would show the wrong value in the error string.
- It used %s formatting, so an empty type field produced the unhelpful
  message "unknown input item type: " with no indication what was missing.

Fix by using itemType (the resolved value) with %q quoting, and add a
dedicated message when itemType is empty (both type and role absent):
"input item missing required 'type' field".

Tests added for the empty-type and missing-type cases.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 17:41:12 -07:00
..
openai.go Add support for gemma4 (#15214) 2026-04-02 11:33:33 -07:00
openai_encoding_format_test.go embedding tests: added check against exact base64 string (#12790) 2025-10-28 10:37:20 -07:00
openai_test.go openai: split mixed thinking stream chunks via ToChunks (#14648) 2026-03-11 14:21:29 -07:00
responses.go fix: improve error message for unknown input item type in responses API (#15424) 2026-04-08 17:41:12 -07:00
responses_test.go fix: improve error message for unknown input item type in responses API (#15424) 2026-04-08 17:41:12 -07:00