Skip to content

Conversation

@yesudeep
Copy link
Contributor

This commit enhances the Genkit Python SDK by implementing several core
methods in the Genkit class and expanding registry capabilities to
better align with the canonical JavaScript implementation.

ISSUE: N/A

CHANGELOG:

  • Added Genkit.current_context(), Genkit.run(), Genkit.flush_tracing(),
    and Genkit.check_operation() to the Genkit class.
  • Implemented define_simple_retriever supporting flexible content and
    metadata mapping for easy integration of existing data sources.
  • Added Genkit.dynamic_tool() for creating unregistered tool actions
    passed directly to generation calls.
  • Updated GoogleAI and VertexAI plugins to support optional api_version
    and base_url configuration.
  • Enhanced registry management and action resolution logic within the
    Genkit instance.
  • Added comprehensive unit tests for the updated Genkit API, including
    retriever mapping and tracing flush logic.

@yesudeep yesudeep requested a review from MengqinShen January 26, 2026 08:12
@github-actions github-actions bot added feature New feature or request python Python labels Jan 26, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yesudeep, 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 significantly advances the Genkit Python SDK by bringing its core Genkit class and registry capabilities closer to feature parity with its JavaScript counterpart. It introduces several new methods for managing execution context, dynamic tool creation, tracing, and long-running operations, alongside a more flexible mechanism for defining data retrievers. These changes aim to improve the SDK's extensibility, observability, and ease of integration with various data sources and AI models.

Highlights

  • New Genkit Class Methods: Implemented Genkit.current_context(), Genkit.run(), Genkit.flush_tracing(), Genkit.check_operation(), and Genkit.dynamic_tool() to enhance core functionality and align with the JavaScript SDK.
  • Flexible Retriever Definition: Introduced define_simple_retriever supporting flexible content and metadata mapping, simplifying the integration of existing data sources into Genkit flows.
  • Plugin Configuration Enhancements: Updated GoogleAI and VertexAI plugins to support optional api_version and base_url configuration, providing more control over API endpoints.
  • Registry and Action Resolution: Enhanced internal registry management and action resolution logic within the Genkit instance for improved extensibility.
  • Comprehensive Unit Tests: Added extensive unit tests for the newly implemented Genkit API methods, including retriever mapping and tracing flush logic, ensuring reliability and correctness.

🧠 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.

@yesudeep yesudeep force-pushed the yesudeep/feat/past-sack branch from 534e76c to 3cab5b0 Compare January 26, 2026 08:13
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 introduces several core methods to the Genkit class and expands registry capabilities, bringing the Python SDK closer to feature parity with the JavaScript implementation. Key additions include Genkit.current_context(), Genkit.run(), Genkit.flush_tracing(), Genkit.check_operation(), and define_simple_retriever. The GoogleAI and VertexAI plugins have also been updated to support optional api_version and base_url configurations. The changes are well-tested with comprehensive unit tests for the new APIs. Overall, the changes are well-structured and enhance the SDK's functionality significantly.

@yesudeep yesudeep force-pushed the yesudeep/feat/past-sack branch from 3cab5b0 to 625e083 Compare January 26, 2026 08:43
@yesudeep
Copy link
Contributor Author

/gemini review

@github-actions github-actions bot added docs Improvements or additions to documentation config labels Jan 26, 2026
This commit enhances the Genkit Python SDK by implementing several core
methods in the Genkit class and expanding registry capabilities to
better align with the canonical JavaScript implementation.

ISSUE: N/A

CHANGELOG:

- Added Genkit.current_context(), Genkit.run(), Genkit.flush_tracing(),
  and Genkit.check_operation() to the Genkit class.
- Implemented define_simple_retriever supporting flexible content and
  metadata mapping for easy integration of existing data sources.
- Added Genkit.dynamic_tool() for creating unregistered tool actions
  passed directly to generation calls.
- Updated GoogleAI and VertexAI plugins to support optional api_version
  and base_url configuration.
- Enhanced registry management and action resolution logic within the
  Genkit instance.
- Added comprehensive unit tests for the updated Genkit API, including
  retriever mapping and tracing flush logic.
@yesudeep yesudeep force-pushed the yesudeep/feat/past-sack branch from 625e083 to 33e92ef Compare January 26, 2026 08:47
@yesudeep
Copy link
Contributor Author

/gemini review

@yesudeep yesudeep merged commit 590c104 into main Jan 26, 2026
22 checks passed
@yesudeep yesudeep deleted the yesudeep/feat/past-sack branch January 26, 2026 09:21
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 feature New feature or request python Python

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants