-
Notifications
You must be signed in to change notification settings - Fork 638
RFC: BidiAction, BidiFlow, and Agent in Go
#4184
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 introduces a detailed design document for enhancing Genkit Go with robust bidirectional streaming capabilities. It proposes three new core primitives: 'BidiAction' for fundamental streaming operations, 'BidiFlow' for observable streaming, and 'SessionFlow' for managing stateful, multi-turn interactions with automatic persistence. The document comprehensively covers the API surface, integration with existing tracing and session management infrastructure, and provides concrete examples to guide implementation and usage, aiming to facilitate the development of advanced conversational agents and streaming applications. 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. 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 introduces a comprehensive design document for new bidirectional streaming features in Genkit Go, including BidiAction, BidiFlow, and SessionFlow. The document is well-structured and detailed. My review focuses on ensuring the clarity and consistency of the proposed design. I've identified a significant contradiction in the description of the Stream() method's behavior which could lead to implementation errors. I've also suggested a clarification in one of the code examples to improve understanding of the multi-turn flow. Overall, this is a solid design that will be even stronger with these clarifications.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
BidiAction, BidiFlow, and SessionFlowBidiAction, BidiFlow, and SessionFlow
BidiAction, BidiFlow, and SessionFlowBidiAction, BidiFlow, and SessionFlow
docs/go-bidi-design.md
Outdated
| } | ||
|
|
||
| // SessionFlowOutput wraps the output with session info for persistence. | ||
| type SessionFlowOutput[State, Out any] struct { |
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.
Let's define these as common schemas (in genkit-tools/common/src/types) standardized across runtimes.
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.
I tend to agree but we haven't been doing the core concepts (action, etc) as generated types because they have type parameters and they're just "core" to the runtime and sometimes implemented differently. But Artifact I agree.
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.
In Go, we only generate types for the ai package. Not for any technical reason but that's just been the use case since they tend to be POD structs.
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.
I mean, we literally must define these types in genkit-tools/common/src/types because we will be building Dev UI agent playground. So, not only we need zod types for the Dev UI, we also need those types to be the same across languages (which generation ensures). So, I guess I don't have a strong opinion if you want to maintain these types by hand in Go, up to you, but they need to be treated as "source of truth is in genkit-tools/common".
BidiAction, BidiFlow, and SessionFlowBidiAction, BidiFlow, and Agent in Go
No description provided.