Skip to content

Suggest common model providers in the pydanticai connection form - #76053

Merged
kaxil merged 3 commits into
apache:mainfrom
astronomer:common-ai-model-provider-suggestions
Nov 4, 2026
Merged

kaxil merged 3 commits into
apache:mainfrom
astronomer:common-ai-model-provider-suggestions

Conversation

@kaxil

@kaxil kaxil commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

The Default Model Provider field on a generic pydanticai connection (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 between openai (Responses API) and openai-chat (Chat Completions). The field now suggests common ids as you type: openai-chat, openai, anthropic, ollama, litellm, openrouter, groq, mistral, deepseek, together and fireworks. 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.

Default Model Provider suggestions narrowing as you type

The suggestions are JSON-schema examples on the conn-field. The connection form already renders examples on 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 enum dropdown? 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.yaml is 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 with infer_provider_class, and every suggestion must map to a vendor in the connection's external-services list (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 that test_provider_metadata.py deliberately excludes.

Known gap: the registry's connection builder (dev/registry/extract_connections.py) copies only enum, minimum and maximum from a conn-field schema, so the registry shows this field's help text without the suggestions. Copying examples there would help every provider and fits better as its own registry change.

kaxil added 3 commits October 29, 2026 00:46
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.
Comment thread providers/common/ai/provider.yaml Resolved
Comment thread providers/common/ai/provider.yaml Resolved
@kaxil
kaxil merged commit f34cae8 into apache:main Nov 4, 2026
79 checks passed
@kaxil
kaxil deleted the common-ai-model-provider-suggestions branch November 4, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants