Skip to content

fix(py)!: plugin, model and middleware settings share GenkitConfig - #6697

Merged
huangjeff5 merged 25 commits into
mainfrom
fix/py-plugin-config-kwargs
Oct 29, 2026
Merged

huangjeff5 merged 25 commits into
mainfrom
fix/py-plugin-config-kwargs

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Stack: 1/3 · next #6698

GenkitConfig (from genkit.plugin_api import GenkitConfig) is the base class for settings a user passes into a Genkit action. Model configs inherit it through ModelConfig; plugin and middleware authors subclass it directly. Every subclass enforces four rules:

  • Python takes snake_case: GeminiConfig(max_output_tokens=256, thinking_config=...) type-checks under pyright, pyrefly and ty, including nested values.
  • Genkit JSON is camelCase: dict configs from the Dev UI model runner and .prompt frontmatter validate with camelCase keys ({'maxOutputTokens': 256}), and the JSON schema the Dev UI renders lists maxOutputTokens.
  • Unknown keys raise: a typo, or both spellings of one key in the same input, raises ValidationError instead of silently dropping the setting.
  • model_dump() is stock Pydantic: field names by default, which is what provider SDKs take. by_alias=True returns Genkit JSON, and ModelRequest applies it to nested configs automatically.

GenkitConfig

GenkitConfig is the base for settings a user hands to a Genkit action: model config, middleware config, and the objects nested inside them (thinking, speech, safety settings). It is a plain pydantic.BaseModel with four ConfigDict flags and no method overrides:

  • alias_generator=to_camel: every field gets a camelCase wire name, and the JSON schema lists maxOutputTokens. Without it, the schema says max_output_tokens and camelCase input from the Dev UI or a .prompt file is rejected as an unknown key.
  • validate_by_name=True: the snake_case kwarg works. Without it, ModelConfig(max_output_tokens=5) raises at runtime and pyrefly rejects it.
  • validate_by_alias=True: camelCase input works. This is Pydantic's default; it is written out so the pair reads as one decision.
  • extra='forbid': an unknown key raises. Pydantic's default 'ignore' turns ModelConfig(max_ouput_tokens=5) into max_output_tokens=None with no error. It also rejects two spellings of one setting in the same input (maxOutputTokens and max_output_tokens), so neither silently wins.

What it leaves alone is the point: model_dump() is not overridden. The default returns field names, which is what provider SDKs take. by_alias=True returns Genkit JSON, and when a config is nested in a ModelRequest, the parent applies that automatically.

# 1. Python: snake_case kwargs, type-checked by pyright, pyrefly and ty
config = GeminiConfig(max_output_tokens=256, thinking_config={'thinking_budget': 512})

# 2. Provider SDKs get field names, like any Pydantic model
config.model_dump(exclude_none=True)
# => {'max_output_tokens': 256, 'thinking_config': {'thinking_budget': 512}}

# 3. Genkit tooling gets camelCase
config.model_dump(by_alias=True, exclude_none=True)
# => {'maxOutputTokens': 256, 'thinkingConfig': {'thinkingBudget': 512}}

# 4. Typos and duplicate spellings fail at the call site
GeminiConfig(max_ouput_tokens=256)
# => ValidationError: extra_forbidden

Which base class to use:

  • BaseModel: the app's own data, such as flow and tool input/output. Genkit does not rename it.
  • GenkitConfig: settings passed into Genkit that the Dev UI renders and that traces and .prompt files carry. Model configs get it through ModelConfig. Exported from genkit.plugin_api.
  • GenkitModel (internal): data Genkit emits on the wire. See below.

The problem: every plugin read config differently

ModelConfig inherited from GenkitModel through the generated GenerationCommonConfig. GenkitModel overrides model_dump() to default to camelCase. Every plugin's config dumped {'maxOutputTokens': ...}, while Python provider SDKs take max_output_tokens. Each plugin patched that its own way:

  • Anthropic and the Gemini SDK path passed by_alias=False.
  • Ollama rewrote keys with {to_snake(k): v ...}.
  • OpenAI audio did neither. TTS and STT sent responseFormat and timestampGranularities, which the plugin never reads, so config={'response_format': 'wav'} was dropped without an error. Dict configs hit it too, because Genkit validates them into the typed class first.

Type checking was split as well. Configs declared camelCase wire names with per-field alias='responseModalities'. pyright reads alias= as the kwarg name, while ty and pyrefly read the field name, so no spelling passed all three. The Gemini nested classes also used a positional Field(None, ...) default, which pyright ignores, so every nested field looked required.

First pass: fix each class. Why that didn't hold

The rules above fix both problems. Applying them class by class meant removing 66 per-field alias= declarations and putting the same flags on 26 config classes in five packages, plus a dump patch at every SDK boundary. Where that had already been tried, it had drifted:

  • Gemini and Anthropic each had a private _NESTED_CONFIG, and the two differed.
  • Antigravity, Deep Research and the context-caching types ended up on extra='allow' or 'ignore'.
  • ModelConfig picked up camelCase dumps from a generated parent nobody looked at.

The contract needs a name that plugin authors subclass, so the next config gets it right without knowing any of this. That is GenkitConfig.

Why the JSON is camelCase

Each SDK owns its Python interface, but a config's JSON leaves Python. The Dev UI round-trips it three ways, and all three formats are shared with JS and Go:

  1. Schema to form: the model runner builds its config form from customOptions.properties, the config class's JSON schema.
  2. Trace to form: "Open in model runner" pre-fills that form from the trace's genkit:input.config, matching on exact keys (presetConfig[customOption.name] in genkit-ui).
  3. .prompt to form and back: the prompt runner pre-fills from frontmatter config, which has a shared schema (GenerationCommonConfigSchema.passthrough() in genkit-tools). The model runner can export a .prompt from the form.

Running the Dev UI's matching logic against what Python actually writes:

# 1. Trace genkit:input.config, written by Python
# => {'temperature': 0.2, 'maxOutputTokens': 256, 'thinkingConfig': {'thinkingBudget': 512}}

# 2. Pre-fill today: camelCase schema, camelCase trace
# => {'temperature': 0.2, 'maxOutputTokens': 256, 'thinkingConfig': {'thinkingBudget': 512}}

# 3. Pre-fill if the schema were snake_case
# => {'temperature': 0.2}
#    Every multi-word setting opens blank, and Run tests a different request than the trace.

The trace cannot switch to snake_case to match. A model span's input is GenerateActionOptions, a camelCase schema shared across SDKs (toolChoice, config). JS writes thinkingConfig: { thinkingBudget } natively, Go writes thinkingConfig from the genai JSON tags, and the Dev UI reads all three SDKs' traces with the same code. The common fields (temperature, maxOutputTokens, topK, topP, stopSequences) belong to the shared GenerationCommonConfig. The requirement is one spelling across schema, trace and .prompt, and camelCase wins because Python is the only SDK that would differ.

Why not GenkitModel

GenkitModel already has these four flags, so making it the public config base was the obvious alternative. It is the base for Genkit's wire types: 121 classes, 89 of them generated from the cross-SDK schema in genkit-tools/genkit-schema.json, including Part, Message, ModelRequest, GenerateActionOptions, ActionMetadata, SpanData and TraceData. Those are what Genkit serializes into span attributes, posts to the Dev UI's telemetry server, and returns from the reflection API. For that role, it overrides model_dump() to default to by_alias=True, exclude_none=True.

That override breaks the standard Pydantic contract, and it is the exact mechanism behind the plugin bugs above. Exporting it would hand every plugin author a model_dump() that does not do what Pydantic documents.

GenkitModel itself needs cleanup. There are 191 explicit by_alias=True calls across 43 files, and many are on GenkitModel instances where the override already forces it, so the same intent is written two ways. That is internal-facing and can be done after 1.0 without touching the public surface. This PR makes sure user-facing configs do not depend on it.

Main changes

  • GenerationCommonConfig is generated as a GenkitConfig, and ModelConfig subclasses it. schema_to_typing.py emits it with no model_config of its own, so it inherits extra='forbid' and the stock dump even though the shared schema marks it open. ModelConfig only adds extra. All 13 model configs and the leaf configs (VeoConfig, SurfacesConfig, Anthropic ThinkingConfig, the Gemini nested classes) inherit the contract, and top-level configs no longer re-declare flags they inherit. Antigravity, Deep Research and both Lyria configs subclass GenkitConfig directly.
  • Google GenAI configs do not expose genai_types. SDK enums become Literals with the SDK values (prominent_people, safety method, Veo compression_quality/resize_mode, google_search.blocking_confidence); SDK models become GenkitConfig mirrors (ImageOutputOptions, ReplicatedVoiceConfig, GoogleSearchConfig, ...). A drift test pins each Literal to its SDK enum, and _NESTED_SDK_MIRRORS fails CI when the SDK adds a field.
  • Default dump is for SDKs, and by_alias=True is for the wire. The by_alias=False patches in Anthropic and the Gemini SDK path are gone. Ollama keeps to_snake, because the dicts it receives can be wire-shaped and undeclared extras keep the caller's spelling. The echo test model asks for the wire shape explicitly.
  • Wire names come from the alias generator, not alias=. Every alias= that equaled to_camel(field) is gone, so all three checkers see the field name as the kwarg.
  • Pydantic floor moves to 2.11 for validate_by_name. pyrefly ignores populate_by_name, so a field with an explicit alias never gets its own name as a constructor parameter. With extra='forbid', pyrefly rejects that kwarg (core OutputConfig.json_schema -> schema carried three suppressions); without it, any value passes unchecked. pyrefly reads validate_by_name (2.11+) and type-checks the kwarg. The swap covers config classes, wire types and the _typing.py generator, and removes those three suppressions. Internal models (errors, refs, Firestore docs, ClientOptions) keep populate_by_name; there it is runtime-identical churn.
  • SurfacesConfig.validation takes validation= in Python and keeps validate on the wire. JS and Go call the option validate, and a Python field with that name would shadow BaseModel.validate. validation uses validation_alias=AliasChoices('validate', 'validation') and serialization_alias='validate', so Python kwargs (validation='strict'), shared .prompt frontmatter (validate: strict), the Dev UI schema, and trace refs all work.
  • genkit-middleware configs are GenkitConfig; app middleware configs do not have to be. RetryConfig, FallbackConfig (and FallbackModelEntry), FilesystemConfig, SkillsConfig, ToolApprovalConfig and ArtifactsConfig exist in JS and Go under the same names, so a shared .prompt with config: {maxRetries: 0} works here. FilesystemConfig.root_dir goes on the wire as rootDirectory, the JS and Go key. Before, RetryConfig ignored maxRetries and ran with the default 3. A config class for an app's own middleware can stay a plain BaseModel; its keys are its field names everywhere (schema, .prompt, trace), and that middleware only runs in its own runtime.
  • Middleware refs dump by_alias=True. Inline use=[Retry(max_retries=0)] is written to the trace as {'maxRetries': 0}, matching the schema the Dev UI pre-fills from. No-op for a plain BaseModel.
  • Unknown middleware config keys raise regardless of base class. A plain BaseModel drops them, so middleware instantiation checks ref keys against the fields and aliases and raises INVALID_ARGUMENT naming the middleware and the accepted keys (in their wire spelling). Any other bad value from a .prompt, the Dev UI or a trace (wrong type, bound, missing required field) is also INVALID_ARGUMENT naming the middleware. A misspelled kwarg (AllergyGuard(max_warning=1)) raises the same extra_forbidden ValidationError a GenkitConfig does. A class that sets extra='allow' or 'ignore' explicitly keeps its extras.
  • Gemini metadata.cache takes true and JS's {ttlSeconds: N}. The TTL was read as cache.get('ttl_seconds') off the raw metadata, so a shared .prompt with ttlSeconds silently got the default 300s and cache: true raised AttributeError. ttl_seconds still works; any other type, or a TTL that isn't a positive number, is INVALID_ARGUMENT. The unused, unexported CacheConfigSchema is deleted.

Typing contracts gate all three checkers

packages/*/tests/typecheck/ holds files that construct configs with snake_case kwargs and typed nested values, with no suppressions. They also run under pytest and assert the wire dump. pyproject.toml owns the scope, so adding a file there is enough:

  • pyright: include = ["packages/**/src", "packages/**/tests/typecheck"]. CI (.github/workflows/python.yml) runs plain pyright instead of pyright packages/*/src, since CLI paths override include. packages/*/src silently matched zero files as an include root, so it uses **.
  • pyrefly: project_includes adds packages/*/tests/typecheck/**/*.py. Before this, pyrefly never opened these files.
  • ty: the **/tests/** override mutes invalid-argument-type and no-matching-overload, the two rules a contract exists to catch. A later override turns them back on for tests/typecheck/.

A canary with a wrong-typed value and a camelCase kwarg fails all three checkers. pyright checks the same 192 files as the old explicit command.

Breaking changes

  • pydantic >= 2.11.
  • ModelConfig(...).model_dump() returns field names and keeps None. Pass by_alias=True, exclude_none=True for the old output.
  • GenerationCommonConfig rejects unknown keys.
  • AntigravityConfig, DeepResearchConfig and LyriaConfig reject unknown keys; they used to pass through to the create body.
  • Google GenAI config enums are case-sensitive Literals: 'BLOCK_PROMINENT_PEOPLE', not 'block_prominent_people'. SDK model instances (google_search=genai_types.GoogleSearch(...)) no longer validate; pass a dict or the Genkit class.
  • genkit_a2ui: Python kwarg validate= raises ({'validate': ...} in dict configs and .prompt files continues to work); pass validation= in Python.
  • Middleware config: an unknown key raises (INVALID_ARGUMENT from a ref, ValidationError from a kwarg) instead of being dropped. genkit-middleware Dev UI schemas and trace refs are camelCase (maxRetries).

Follow-ups

  • Internal GenkitModel cleanup and rename (after 1.0): drop the model_dump() override and the redundant by_alias=True calls.

Verification

  • Snapshot of all 13 ModelConfig subclasses before and after: JSON schema (validation and serialization), Dev UI customOptions, and the config nested in ModelRequest / GenerateActionOptions (dict and JSON) are byte-identical, except the Gemini family, where SDK $defs are replaced by the Genkit mirrors and enums are inlined with the same values. Only a direct model_dump() changed.
  • Dev UI pre-fill simulated against a real Python trace, using the matching logic from genkit-ui main.
  • New regressions: OpenAI TTS/STT and DALL-E/GPT-Image typed configs reach the SDK as response_format, timestamp_granularities, output_format and output_compression; ModelConfig subclasses GenerationCommonConfig; both spellings of one key raise; the nested-in-request dump stays camelCase.
  • ruff format and check, pyright, pyrefly, ty, generate_schema_typing --ci, license headers, and pytest pass.

Gemini, Veo, Lyria, Anthropic ThinkingConfig and a2ui SurfacesConfig
declared camelCase wire names with per-field alias= and, in the Gemini
nested classes, a positional Field(None, ...) default. pyright ignores a
positional default, so every field looked required, and with alias= no
single spelling passes pyright, ty and pyrefly.

Drop alias= where it equals to_camel(field) and take the wire name from
alias_generator=to_camel, the pattern core GenerationCommonConfig uses.
Defaults are keyword. SurfacesConfig.validation keeps the 'validate'
wire name via validation_alias/serialization_alias because a field named
validate would shadow BaseModel.validate.

Wire JSON, model_json_schema and Dev UI customOptions are byte-identical
before and after. Field names are unchanged, so SDK request bodies
(dumped with by_alias=False) are unchanged.
populate_by_name lets pydantic accept a field's own name, but pyrefly
doesn't read it: a class with an explicit alias (core OutputConfig's
json_schema -> 'schema') rejects the field name as a constructor kwarg,
which is why three call sites carried ignore[unexpected-keyword].
validate_by_name=True, validate_by_alias=True is the 2.11 spelling of
the same runtime behavior, and pyrefly honors it.

- Raise the pydantic floor to >=2.11 in every pyproject that pins it.
- Swap populate_by_name for validate_by_name + validate_by_alias in all
  package sources, the agents sample, and the _typing.py generator
  (scripts/schema_to_typing.py); _typing.py is regenerated.
- Drop the three pyrefly suppressions in _prompt.py and _generate.py.

model_json_schema (validation and serialization) for all 208 pydantic
models in the Genkit packages, config dumps, Dev UI customOptions and
outgoing Gemini/Anthropic HTTP bodies are byte-identical before and
after. uv.lock changes only the pydantic specifiers.
SurfacesConfig.validation now uses validation_alias='validate' and
serialization_alias='validate', and drops the AliasChoices. The JSON key
stays validate, to match js/plugins/a2ui/src/middleware.ts. The field
can't be named validate because that would shadow BaseModel.validate.
- model_json_schema and model_dump(by_alias=True) are byte-identical to
  main.
- Runtime still accepts validation=, validate= and {'validate': ...}.

BREAKING (typing only): SurfacesConfig(validate=...) used to type-check
under pyright. Now pyright, pyrefly and ty all reject it; use
validation=. Before, no spelling passed all three checkers: pyright read
alias=, ty and pyrefly read the field name.

Surfaces(...) forwards **kwargs: Any from BaseMiddleware, so checkers
accept any kwarg there. Tests and the docstring now use validation=.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Pydantic dependency across all packages to >=2.11 and refactors model configurations. Specifically, it replaces populate_by_name=True with validate_by_name=True and validate_by_alias=True in ConfigDict, and removes explicit alias arguments on fields where alias_generator=to_camel is used. This ensures that type checkers correctly accept snake_case keyword arguments during model construction while the runtime continues to support both snake_case and camelCase wire formats. Additionally, new configuration typing tests have been added to verify these behaviors, and obsolete type-checker ignore comments have been cleaned up. I have no further feedback to provide as the changes are clean and well-tested.

Add PluginConfig to genkit.plugin_api as the base model for plugin and middleware options. Inherits from BaseModel with extra='forbid', alias_generator=to_camel, validate_by_name=True, and validate_by_alias=True, without overriding model_dump().

- Adopt PluginConfig across plugin options: SurfacesConfig (genkit-a2ui), ThinkingConfig (genkit-anthropic), VeoConfig (genkit-google-genai), and strict nested Gemini configs (SafetySettingsSchema, PrebuiltVoiceConfig, FunctionCallingConfig, ThinkingConfig, FileSearchConfig, ImageConfig, VoiceConfig, SpeakerVoiceConfig, MultiSpeakerVoiceConfig, SpeechConfig).
- Pin Surfaces(validate='strict') in genkit-a2ui config typing test.
- Include packages/*/tests/config_typing_test.py in pyright CI workflow.
@huangjeff5
huangjeff5 requested a review from a team as a code owner October 9, 2026 22:42
…ames

ModelConfig inherited GenkitModel through the generated
GenerationCommonConfig, so every plugin config's model_dump() returned
camelCase. Provider SDKs take snake_case, so each plugin patched the dump
its own way (by_alias=False, to_snake), and one that didn't silently
dropped settings: OpenAI TTS/STT sent responseFormat and
timestampGranularities, which _audio.py never read.

- PluginConfig moves to _core/_base.py beside GenkitModel (re-exported
  from genkit.plugin_api) so _model.py can use it without an import cycle.
- ModelConfig subclasses PluginConfig and declares the common fields. A
  test pins them to the generated GenerationCommonConfig.
- Drop the workarounds: by_alias=False in Anthropic and the Gemini SDK
  dump, to_snake on Ollama's ModelConfig path. Generic boundaries that
  take any BaseModel keep the explicit flag.
- The echo test model asks for the wire shape explicitly.

JSON schema, Dev UI customOptions and configs nested in ModelRequest /
GenerateActionOptions are byte-identical for all 13 ModelConfig
subclasses. Only a direct config.model_dump() changes.

BREAKING: ModelConfig(...).model_dump() returns field names and keeps
None values, like any pydantic model. Pass by_alias=True, exclude_none=True
for the old output. ModelConfig is no longer a GenerationCommonConfig.
@huangjeff5 huangjeff5 changed the title fix(py/plugins)!: config classes type-check with snake_case kwargs fix(py)!: plugin and model configs share PluginConfig; model_dump() returns field names Oct 9, 2026
…ass extras

Undeclared extras on a ModelConfig subclass with extra='allow' keep the caller's spelling (keepAlive), so build_request_kwargs still snake-cases them. The dumped-dict test asks for the wire shape explicitly now that the default dump returns field names.
…checkers

pyproject.toml now owns the scope: pyright include, pyrefly project_includes, and a ty override that re-enables invalid-argument-type and no-matching-overload under **/tests/typecheck/** (the tests/** override muted the two rules a contract exists to catch). CI runs plain pyright.

Before, only pyright gated these files, through a CLI glob; pyrefly never opened them. A canary with a wrong type and a camelCase kwarg now fails all three. pyright checks the same 192 files as the old explicit command.
The alias existed only to mirror JS's option name. SurfacesConfig is in-process middleware config, not a cross-SDK wire format, and the split validation_alias/serialization_alias was the last special case on a PluginConfig. The field is now plain validation everywhere: kwarg, wire key and Dev UI schema.

BREAKING: validate= and {'validate': ...} now raise; use validation.
The base covers model, middleware and nested settings, not just plugins: ModelConfig(PluginConfig) read as "a model config is a plugin config". GenkitConfig names the role, settings handed to Genkit whose JSON is Genkit's shared camelCase shape, and pairs with the internal GenkitModel wire base. BaseConfig was out because pydantic still exports a deprecated pydantic.BaseConfig.

- Exported from genkit.plugin_api and genkit.middleware.
- Docstring records why the JSON is camelCase: the Dev UI builds its form from the schema and pre-fills it from traces and .prompt files by exact key.
- Test: two spellings of one key in one input raise (extra='forbid').
@huangjeff5 huangjeff5 changed the title fix(py)!: plugin and model configs share PluginConfig; model_dump() returns field names fix(py)!: plugin, model and middleware settings share GenkitConfig Oct 10, 2026
…ubclasses it again

schema_to_typing emits GenerationCommonConfig on GenkitConfig with no
model_config of its own, so it inherits extra='forbid' and the stock dump.
ModelConfig drops its copied common fields and only adds extra. Top-level
plugin configs stop re-declaring flags they inherit; their JSON schemas are
unchanged.
The swap to validate_by_name is runtime-identical and only matters for
pyrefly on classes with explicit aliases. Internal models (errors, action
responses, embedder/evaluator refs, Firestore docs, ClientOptions, cache
metadata) aren't config or wire types, so they stay as on main.
…re GenkitConfig

Unknown keys now raise instead of passing through to the create body.
Enum fields become Literals with the SDK values; SDK model fields become
GenkitConfig mirrors (ImageOutputOptions, ReplicatedVoiceConfig,
GoogleSearchConfig, ...). A drift test pins each Literal to its SDK enum and
_NESTED_SDK_MIRRORS fails CI when the SDK adds a field.
…own middleware config keys raise

Shipped middleware configs share keys with JS and Go, so a .prompt with
maxRetries: 0 configures Retry instead of being dropped. App middleware
configs can stay plain BaseModel. Middleware refs dump by_alias so trace keys
match the Dev UI schema, and GenerateMiddleware.instantiate rejects keys the
config class doesn't declare.
The TTL was read as cache.get('ttl_seconds') off the raw message metadata, so
JS's ttlSeconds silently used the default and cache: true raised
AttributeError. Drop the unused CacheConfigSchema.
@huangjeff5
huangjeff5 requested a review from apascal07 October 11, 2026 04:47

@cabljac cabljac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

Comment thread py/packages/genkit-a2ui/pyproject.toml Resolved
…kwargs

# Conflicts:
#	py/packages/genkit-google-genai/src/genkit_google_genai/_models/_gemini.py
#	py/packages/genkit-google-genai/src/genkit_google_genai/_models/_lyria.py
#	py/packages/genkit-google-genai/tests/models/googlegenai_gemini_test.py
- instantiate turns any config ValidationError into INVALID_ARGUMENT naming the middleware
- accepted keys list the serialization alias (validate, not validation)
- key spellings reuse config_field_names, the walk model config folding uses
- prompt use metadata dumps inline config with _dump_middleware_ref_config
- FilesystemConfig wire key is rootDirectory, as in JS and Go
- metadata.cache ttlSeconds: bad values are INVALID_ARGUMENT; a null camel key no longer hides ttl_seconds
- drop always-empty passthrough splat in Antigravity, Deep Research and Lyria
Resolves import conflicts across genkit-google-genai (_antigravity,
_deep_research, _interactions_lyria, _veo) using ModelContext and GenkitConfig.
@huangjeff5
huangjeff5 merged commit e682093 into main Oct 29, 2026
26 checks passed
@huangjeff5
huangjeff5 deleted the fix/py-plugin-config-kwargs branch October 29, 2026 21:08
huangjeff5 added a commit that referenced this pull request Oct 30, 2026
The stack under this PR (#6697, #6698, #6699) landed on main as squash
commits, so this merge takes main and reapplies only this PR's changes
(e4e07ed..260e048) on top. Adapts to #6757/#6766/#6777: Veo uses
_create_veo_background_model and ModelContext, _runtime_client is a
@loop_local_client method built from per-loop client kwargs, and
GENKIT_CLIENT_HEADER is now GENKIT_USER_AGENT.
huangjeff5 added a commit that referenced this pull request Oct 30, 2026
…onfig-strict

Main landed #6697 (GenkitConfig, extra='forbid'), #6698 (flat Deep Research
config, McpServerConfig TypedDict), #6757/#6766/#6777 (Model/BackgroundModel
classes, ModelContext). Conflicts were only in this PR's files.

Resolution: take main's version of _antigravity.py, _deep_research.py and
_interactions_lyria.py, then re-apply this PR's net change on top: the
`extra` field (EXTRA_DESCRIPTION), the class docstrings, and
deep_merge(create_kwargs, extra) at create_interaction. The model() /
background_model() builder and persist() removal from the PR are superseded
by main's Model/BackgroundModel.

Tests: keep main's test_lyria_rejects_unknown_config_fields; drop the PR's
nested-key typo test (main's McpServerConfig deliberately passes unknown
keys through, and nested file_search is now rejected by main's
reject_nested_file_search with its own tests) and the PR's top-level
`extra={'temperature': ...}` Lyria test (covered by the generation_config one).
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.

3 participants