-
Notifications
You must be signed in to change notification settings - Fork 43
Fixed interrupt docs. #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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)
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)
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",
No description provided.