Skip to content

Conversation

@MengqinShen
Copy link
Contributor

@MengqinShen MengqinShen commented Jan 9, 2026

CHANGELOG:

  • Updated py/plugins/google-genai/src/genkit/plugins/google_genai/models/utils.py file to align with JS SDK regarding Tool Name Parity, Updated the vision part conversion to prioritize provided content types and fall back to data URL extraction,Switched the metadata key from thought_signature to thoughtSignature (camelCase)
  • Updated the menu sample.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @MengqinShen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request brings the Python Genkit library and its Google GenAI plugin into closer alignment with the JavaScript SDK, focusing on API consistency and robustness. It introduces more sophisticated handling for prompt and tool schemas, refines interactions with the Gemini API for system messages and tool calls, and adds support for richer model reasoning outputs. A substantial portion of the changes involves updating the menu sample application to demonstrate these new capabilities and reflect the updated API patterns, including new RAG features and improved media processing.

Highlights

  • Standardized Schema Handling: The input_schema for prompts and output_schema for tools are now consistently converted to JSON schema using to_json_schema or _convert_schema_property, allowing for None values and aligning with the JS SDK's approach.
  • Improved Gemini API Integration: System messages are now explicitly handled via system_instruction in the Gemini API, preventing them from being included in regular message history. Tool names are sanitized (replacing '/' with '__') before being sent to Gemini and restored on response to avoid API conflicts. Additionally, empty request content is now gracefully handled by adding a default user message.
  • Introduction of ReasoningPart: A new ReasoningPart type has been added to support more detailed model outputs, including thought and thought_signature metadata, enhancing the ability to capture and process model reasoning steps.
  • Enhanced Media Handling: The conversion of MediaPart to Gemini's Blob now explicitly extracts and includes the mime_type from data URLs, ensuring correct media interpretation by the model.
  • Menu Sample Application Refactor: The menu sample application has undergone a significant refactor to align with the latest Genkit Python API. This includes renaming google_genai_name to googleai_name, transitioning from system to prompt fields in define_prompt calls, updating model versions, standardizing schema field names (e.g., menu_text to menuText), and introducing new RAG (Retrieval Augmented Generation) flows for advanced menu querying.
  • Updated Genkit Plugin Configuration: The menu_ai.py configuration now uses the GoogleAI plugin instead of VertexAI and updates the DevLocalVectorStore to use name instead of index_name and googleai_name(GeminiEmbeddingModels.TEXT_EMBEDDING_004) for the embedder.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 Python menu sample to align with the JS SDK, introducing several fixes and improvements across the genkit library and the google-genai plugin. The changes are largely beneficial, enhancing consistency and fixing bugs. I've identified a few areas for improvement, including opportunities to refactor duplicated code, a potential bug in tool handling, and some deviations from Python's standard style guide (PEP 8) that could be addressed to improve maintainability.

@MengqinShen MengqinShen marked this pull request as ready for review January 9, 2026 05:07
@MengqinShen MengqinShen requested a review from yesudeep January 9, 2026 05:07
@MengqinShen MengqinShen enabled auto-merge (squash) January 9, 2026 05:41
@MengqinShen MengqinShen merged commit 12da3d1 into main Jan 9, 2026
10 checks passed
@MengqinShen MengqinShen deleted the elisa/fix(py)/update-menu-sample branch January 9, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants