feat(py): fallback to BACKGROUND_MODEL in resolve_model - #6129
feat(py): fallback to BACKGROUND_MODEL in resolve_model#6129huangjeff5 wants to merge 3 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces robust support for ModelRef and pure model resolution helpers in the Genkit Python SDK, allowing model names, versions, and configurations to be resolved, normalized, and merged cleanly. It updates core APIs like generate, generate_stream, generate_operation, define_prompt, and define_agent to accept ModelRef and handle configuration aliases (camelCase to snake_case). Additionally, it updates reflection endpoints and registry lookups, and adds comprehensive unit tests. Feedback is provided regarding a potential misleading error in resolve_model_arg when the default model is configured as an empty string.
8bfcbe3 to
cad3728
Compare
9a93ca6 to
3b8412e
Compare
Summary
resolve_modellooks upMODEL, thenBACKGROUND_MODEL. A name registered only withdefine_background_modelis findable under the same string callers already pass.None(NOT_FOUNDat the veneer).resolve(MODEL)isNonestill yields theBACKGROUND_MODELstart action for a slashed name (plug/veo-…).This PR is lookup only.
generate()/generate_operation()boxing is #6130. Pluginresolve(MODEL, veo)already returnsNoneon this stack, so the fallback can see Veo once that name is asked for.