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 introduces the Genkit Go v2 API, representing a significant overhaul focused on improving idiomatic Go usage, simplifying type structures, and enhancing overall API consistency and type safety. Key changes include transitioning to channels for streaming, replacing custom contexts with standard Go contexts and helpers, and moving from interfaces to concrete types for core components. The update also standardizes function signatures and streamlines output and format handling, aiming to provide a more robust and developer-friendly experience. Highlights
🧠 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. Changelog
Activity
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.
Code Review
This RFC document for Genkit Go v2 presents a well-thought-out set of API changes that improve consistency, simplicity, and idiomatic Go usage. The move to concrete types, channel-based streaming, and unified reference types are all excellent improvements. I've added a few comments to point out some minor inconsistencies in the documentation to ensure the final API is as clear and robust as possible.
| isToolArg() | ||
| } | ||
|
|
||
| // ToolNamed returns a ToolArg that matches registered tools by exact name |
There was a problem hiding this comment.
The comment for ToolNamed says it "returns a ToolArg", which is a bit confusing since ToolNamed is a type, not a function. To improve clarity, I suggest rephrasing it to describe what the type represents.
| // ToolNamed returns a ToolArg that matches registered tools by exact name | |
| // ToolNamed is a ToolArg that matches registered tools by exact name |
|
|
||
| func WithResponseMetadata[Out any](meta map[string]any) RespondWithOption[Out] // unchanged | ||
| func WithNewInput[In any](input In) RestartWithOption[In] // unchanged | ||
| func WithResumedMetadata[In any](meta any) RestartWithOption[In] // unchanged |
There was a problem hiding this comment.
The function WithResumedMetadata is marked as // unchanged, but its signature appears to have changed from func WithResumedMetadata[In any](meta map[string]any) RestartWithOption[In] in v1 to func WithResumedMetadata[In any](meta any) RestartWithOption[In] here.
Additionally, the motivation section states "Resume metadata is always strongly typed — no map[string]any", but this function still accepts meta any. This seems to contradict the goal of strong typing for resume metadata.
To align with the design goal of strong typing, perhaps this function should be generic over the metadata type as well, similar to how RestartOptions is now RestartOptions[In, Meta any]. For example: func WithResumedMetadata[In any, Meta any](meta Meta) RestartWithOption[In].
| | `EvaluatorArg`, `EvaluatorRef` | `Named`, `ActionRef` | | ||
| | `Prompt` interface | `*Prompt` struct | | ||
| | `Register()` on public types | Unexported; `Define*` handles it | | ||
| | `RunRawMultipart` | Consolidated into `RunRaw` (always returns `*MultipartToolResponse`) | |
There was a problem hiding this comment.
The table indicates that RunRawMultipart is consolidated into RunRaw, and that RunRaw now "always returns *MultipartToolResponse". However, the Tool API surface defined earlier shows RunRaw's signature as func (t *Tool[In, Out]) RunRaw(ctx context.Context, input any) (any, error). This seems to be a contradiction. Please clarify the new behavior of RunRaw and update the documentation accordingly.
No description provided.