Disable document input for AlibabaProvider (Chat Completions API)#5727
Open
dsfaccini wants to merge 5 commits into
Open
Disable document input for AlibabaProvider (Chat Completions API)#5727dsfaccini wants to merge 5 commits into
AlibabaProvider (Chat Completions API)#5727dsfaccini wants to merge 5 commits into
Conversation
Alibaba's compatible-mode endpoint rejects OpenAI `type:file` parts, so document input now raises a clear UserError client-side, mirroring the Azure provider.
Collaborator
Author
|
hey @InfernalAzazel ! could you try this PR's branch's pydantic-ai installation to check whether it solves your issue(s)? I don't have an alibaba cloud setup to test with. |
Mirror the Azure `DocumentUrl` unsupported note in `docs/input.md` and add a note to the Alibaba section in `docs/models/openai.md`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Sending a document (
BinaryContent(media_type='application/pdf')orDocumentUrl) toAlibabaProvider+OpenAIChatModelfailed with an opaque HTTP 400, because Pydantic AI emits an OpenAItype:filecontent part that Alibaba's compatible-mode Chat Completions endpoint rejects.This sets
openai_chat_supports_document_input=Falseon the AlibabaOpenAIModelProfile, so document input now raises a clearUserErrorclient-side — mirroring the existingAzureProvidertreatment (#4048).Verification
The limitation is confirmed by the API's own 400 in #5724 (enumerates the supported content-part types —
fileis not among them):Checklist