Repository navigation
Suggest common model providers in the pydanticai connection form - #76053
Merged
kaxil merged 3 commits intoNov 4, 2026
Merged
Conversation
The Default Model Provider field was a blank text box, so users had to know pydantic-ai's provider names (`openai-chat` vs `openai`) by heart. The field's schema now lists common ones as `examples`, which the connection form renders as suggestions on a text input: any other provider pydantic-ai recognizes can still be typed. An `enum` dropdown would reject providers pydantic-ai adds until a new release of this provider. A test keeps every suggestion resolvable.
The suggestions ship with the provider, but the installed pydantic-ai can recognize more. The field's help text and the connection docs now say the list is common choices, not every provider that works. A test also keeps each suggestion among the connection's declared external services, so the form never suggests a vendor the docs and registry don't list.
…test lookups The registry's connection builder shows a conn-field's description but not its examples, so the help text now says any provider the installed pydantic-ai recognizes works instead of describing suggestions. The docs paragraph no longer repeats part of the list by hand. The suggestion checks reuse one connection-type lookup and one prefix-to-module mapping, and the two pydantic-ai checks on this field are one test.
amoghrajesh
approved these changes
Nov 3, 2026
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.
The Default Model Provider field on a generic
pydanticaiconnection (added in #75909) was a blank text box, so setting it meant knowing pydantic-ai's provider ids by heart, including the easy-to-miss difference betweenopenai(Responses API) andopenai-chat(Chat Completions). The field now suggests common ids as you type:openai-chat,openai,anthropic,ollama,litellm,openrouter,groq,mistral,deepseek,togetherandfireworks. Any other provider the installed pydantic-ai recognizes can still be typed, and the field's help text and the connection docs say so, since a newer pydantic-ai can add providers the list doesn't show.The suggestions are JSON-schema
exampleson the conn-field. The connection form already rendersexampleson a string field as a text input with a<datalist>(FieldString.tsx), and the providers manager passes the field's schema through unchanged, so there is no UI or core change.Why not an
enumdropdown? An enum would reject providers a newer pydantic-ai adds until the next release of this provider, while the hook itself accepts anything pydantic-ai recognizes.Why a hand-picked list rather than every pydantic-ai provider?
provider.yamlis static metadata, and the point is to put the common choices for this connection first. Two tests keep the list honest: every suggestion must resolve withinfer_provider_class, and every suggestion must map to a vendor in the connection'sexternal-serviceslist (the one the registry's External Services card in #72940 shows), so the form never suggests a provider the docs and registry don't list or thattest_provider_metadata.pydeliberately excludes.Known gap: the registry's connection builder (
dev/registry/extract_connections.py) copies onlyenum,minimumandmaximumfrom a conn-field schema, so the registry shows this field's help text without the suggestions. Copyingexamplesthere would help every provider and fits better as its own registry change.