Skip to content

Type Responses API input parts and thinking.budget_tokens - #16

Merged
theQuert merged 2 commits into
mainfrom
claude/responses-input-types
Oct 7, 2026
Merged

theQuert merged 2 commits into
mainfrom
claude/responses-input-types

Conversation

@theQuert

@theQuert theQuert commented Oct 7, 2026

Copy link
Copy Markdown
Member

Refs #13, #14.

  • ResponseInputItem.content now accepts the Responses API part types:
    • ResponseInputText (input_text)
    • ResponseInputImage (input_image, with image_url or file_id, and detail)
    • ResponseInputFile (input_file, with file_id, file_data, file_url and filename)
  • The old text / image TypedDicts stay in the union, so code written against 0.4.0 still type-checks.
  • ThinkingConfig gains budget_tokens.
  • Nothing changes at runtime: parts are sent as given.

Proof

  • pytest: 124 passed on Python 3.13, 3.9, and 3.9 with minimum dependencies.
  • mypy apertis: the same 12 errors as main, none new. The new test code has no mypy errors.
  • A deliberately misspelled input_text part is rejected by mypy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uy5vXsRpMhug7v3XwTMZHv

theQuert and others added 2 commits October 7, 2026 12:24
Add ResponseInputText, ResponseInputImage and ResponseInputFile (input_text,
input_image, input_file) to ResponseInputItem.content, keeping the old text/image
parts in the union so existing code still type-checks. Add budget_tokens to
ThinkingConfig, which the gateway reads for Claude models.

Refs #13
Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uy5vXsRpMhug7v3XwTMZHv
@theQuert
theQuert merged commit 6614582 into main Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant