kaxil opened a new pull request, #76053: URL: https://github.com/apache/airflow/pull/76053
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. 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
