Skip to content

fix(py)!: ActionMetadata has one input-schema and one output-schema field - #6638

Closed
huangjeff5 wants to merge 2 commits into
mainfrom
fix/py-action-metadata-one-schema-key
Closed

huangjeff5 wants to merge 2 commits into
mainfrom
fix/py-action-metadata-one-schema-key

Conversation

@huangjeff5

Copy link
Copy Markdown
Contributor

ActionMetadata has one input-schema field and one output-schema field, input_schema and output_schema. input_json_schema= and output_json_schema= raise ValidationError.

# before
ActionMetadata(name='acme/m', input_schema={'title': 'A'}, input_json_schema={'title': 'B'})
# Dev UI shows A; B is dropped with no error

# after
ActionMetadata(name='acme/m', input_schema={'title': 'A'})
ActionMetadata(name='acme/m', input_json_schema={'title': 'B'})  # ValidationError

Decisions

  • One field per schema: Previously ActionMetadata had both input_schema and input_json_schema (and the same pair for output), and both reflection listings sent one and dropped the other. Now only input_schema and output_schema exist, and the old keyword raises ValidationError. Plugin code that passed input_json_schema= / output_json_schema= switches to input_schema= / output_schema=. We kept those names because they are the keys the Dev UI already receives (inputSchema / outputSchema), and in Python both old fields held a JSON schema dict.
  • The value is a JSON schema dict: Previously input_schema was untyped, so a Pydantic class could be stored and never become a form. Now a class raises ValidationError. Pass the dict from to_json_schema(...). We chose a dict over a class because the Dev UI form is a JSON schema.

@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 refactors ActionMetadata by removing the redundant input_json_schema and output_json_schema fields, standardizing on input_schema and output_schema typed as dict[str, Any] | None. This change is propagated across the genkit, genkit-google-genai, and genkit-ollama packages, including updates to reflection APIs, schema generation scripts, and corresponding unit tests. No review comments were provided, so there is no additional feedback to address.

@huangjeff5

Copy link
Copy Markdown
Contributor Author

Folded into #6689.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant