Skip to content

docs(py): upgrade plugin docstrings to landing-page hero style with inline return shapes#5650

Open
huangjeff5 wants to merge 9 commits into
reorg/py-pluginsfrom
reorg/py-plugins-docstrings
Open

docs(py): upgrade plugin docstrings to landing-page hero style with inline return shapes#5650
huangjeff5 wants to merge 9 commits into
reorg/py-pluginsfrom
reorg/py-plugins-docstrings

Conversation

@huangjeff5

Copy link
Copy Markdown
Contributor

Description

As part of PR stack #3 (branched off PR #2 reorg/py-plugins), this pull request audits all Genkit Python plugin and core packages to replace verbose ELI5 explanations and ASCII data-flow diagrams with professional, product-oriented landing-page hero snippets.

Key highlights:

  • Calibrated Style Guide: Introduced genkit-docstring-style skill defining required code block formatting.
  • Numbered Action Steps: Code snippets use # 1. ..., # 2. ..., # 3. ... comments guiding developers through initialization and execution.
  • Inline Return Shapes (# =>): Illustrates expected response shapes directly inline without requiring execution.
  • Clean Multi-Line Formatting: Formatted multi-line outputs cleanly across indented # lines without escape codes like \n.
  • Strict Scope: Code examples are kept strictly on modules, classes, or functions that originally contained code examples.
  • Model Standard: Recommends googleai/gemini-flash-latest, googleai/gemini-pro-latest, or vertexai/... equivalents across generation snippets.

Base Branch

Branches off of and targets reorg/py-plugins (#5644).

@github-actions github-actions Bot added docs Improvements or additions to documentation python Python labels Jun 29, 2026

@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 introduces a new docstring style guide (SKILL.md) for Genkit Python packages, mandating the "Landing Page Hero Snippet" pattern. This pattern focuses on clean, product-oriented code examples with numbered steps and inline return shape annotations (# =>), while removing verbose ELI5 explanations and ASCII diagrams. Accordingly, docstrings across multiple packages (including genkit-anthropic, genkit-django, genkit-fastapi, genkit-flask, genkit-googleai, genkit-googlecloud, genkit-middleware, genkit-ollama, genkit-openai, and genkit-vertexai) have been refactored to align with this style. The review feedback correctly identifies several bugs in the newly introduced code examples, such as incorrect attribute access on evaluation results, long-running operations, and media parts, which would lead to AttributeErrors at runtime.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread py/packages/genkit-googleai/src/genkit_googleai/evaluators/__init__.py Outdated
Comment thread py/packages/genkit-googleai/src/genkit_googleai/models/veo.py Outdated
Comment thread py/packages/genkit-googleai/src/genkit_googleai/models/lyria.py Outdated
@huangjeff5

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 streamlines and simplifies the module-level docstrings across multiple Genkit Python packages by removing large ASCII diagrams, ELI5 explanations, and complex architecture overviews. These are replaced with concise descriptions, updated requirements, and cleaner, more practical code examples. The feedback points out a missing asyncio import in the veo.py example code block, which is necessary to make the snippet fully functional and copy-pasteable.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread py/packages/genkit-googleai/src/genkit_googleai/models/veo.py
@huangjeff5 huangjeff5 requested a review from a team as a code owner June 29, 2026 17:15
@huangjeff5 huangjeff5 force-pushed the reorg/py-plugins-docstrings branch from eb013e2 to a7c93ba Compare June 29, 2026 17:43
@huangjeff5 huangjeff5 force-pushed the reorg/py-plugins-docstrings branch from a7c93ba to 8580b26 Compare June 29, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation python Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant