Skip to content

Conversation

@apascal07
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @apascal07, 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 refines the documentation for Genkit's interrupt handling, shifting from generic metadata maps to a more robust, strongly-typed approach. The changes provide clearer examples and introduce new helper functions that streamline the process of defining, responding to, and restarting tools that utilize interrupts, ultimately enhancing the developer experience and code maintainability.

Highlights

  • Strongly-Typed Interrupts: The documentation has been updated to emphasize and demonstrate the use of strongly-typed metadata for interrupts, replacing generic map-based metadata with custom Go structs.
  • New Interrupt Helper Functions: Introduced and documented new helper functions such as ai.InterruptWith() for defining interrupts, ai.InterruptAs() for type-safe metadata extraction, and tool.RespondWith() for providing direct responses to interrupts.
  • Enhanced Restartable Interrupts: The examples for restartable interrupts have been significantly revised to use ctx.IsResumed() for checking tool resumption status, tool.RestartWith() for re-executing interrupted tools, and ai.WithNewInput() for modifying tool input during a restart.
  • Original Input Access: A new section has been added to explain how to access the original tool input after it has been replaced during a restart using ai.OriginalInputAs().
  • Code Example Refinements: Go code examples throughout the document have been updated for consistency, clarity, and to reflect the new API patterns, including changing ai.WithSystemPrompt to ai.WithSystem and standardizing variable names.
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.

@apascal07 apascal07 enabled auto-merge (squash) January 15, 2026 22:23
Copy link

@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 does a great job of updating the Go documentation for interrupts to reflect the new, more type-safe API. The changes are a significant improvement, replacing generic maps with strongly-typed structs for interrupt metadata and providing clearer, more robust examples for both manual-response and restartable interrupts. My review includes a couple of suggestions to make the code snippets self-contained by defining missing variables and types, which will improve clarity and allow readers to run the examples directly.

I am having trouble creating individual review comments. Click here to see my feedback.

src/content/docs/docs/interrupts.mdx (75)

medium

The QuestionInput struct is used in the askQuestion tool, but its definition is missing from this code snippet. This makes the example incomplete and could confuse readers. Please add the definition for QuestionInput to make the example self-contained and easier to understand.

type QuestionInput struct {
	Choices []string `json:"choices"`
}

// InterruptMetadata carries information about why the tool was interrupted.

src/content/docs/docs/interrupts.mdx (189)

medium

The accountBalance variable is used within the transferMoney tool to check for sufficient funds and to update the balance after a transfer, but it's not defined anywhere in the snippet. This makes the example incomplete. Please define and initialize accountBalance to make the code runnable and easier to understand.

var accountBalance = 250.0 // Example starting balance

transferMoney := genkit.DefineTool(g, "transferMoney",

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants