Skip to content

fix: #2797 accept raw image_url content parts on chat completions input#2799

Merged
seratch merged 1 commit into
mainfrom
fix/chat-completions-image-url-alias
Mar 28, 2026
Merged

fix: #2797 accept raw image_url content parts on chat completions input#2799
seratch merged 1 commit into
mainfrom
fix/chat-completions-image-url-alias

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Mar 28, 2026

This pull request fixes #2797 a Chat Completions input compatibility gap in the Python Agents SDK. When callers selected the chat_completions backend and passed raw Chat Completions-style content parts such as {"type": "text"} and {"type": "image_url"}, the SDK rejected the request before it reached the model even though the backend request shape itself was valid.

The change keeps input_image as the canonical SDK input shape, but adds alias handling in the Chat Completions conversion path so raw text and image_url parts are accepted and normalized consistently. It also aligns the official-OpenAI preflight validation path with the converter, which removes the backend-specific preflight failure for image inputs.

@seratch seratch added this to the 0.13.x milestone Mar 28, 2026
@github-actions github-actions Bot added bug Something isn't working feature:chat-completions labels Mar 28, 2026
@seratch seratch merged commit a7b4851 into main Mar 28, 2026
9 checks passed
@seratch seratch deleted the fix/chat-completions-image-url-alias branch March 28, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:chat-completions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when sending base64 image with type: image_url to Chat Completions API

1 participant