refactor(js/ai): moved generate api into ai package to enable use with middleware#5042
Open
pavelgj wants to merge 4 commits intopj/gm-refactor-pluginsfrom
Open
refactor(js/ai): moved generate api into ai package to enable use with middleware#5042pavelgj wants to merge 4 commits intopj/gm-refactor-pluginsfrom
pavelgj wants to merge 4 commits intopj/gm-refactor-pluginsfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the GenkitAI class to encapsulate core AI functionalities such as embedding, generation, and operation management. The Genkit class has been refactored to extend GenkitAI, inheriting these methods and reducing code duplication across the codebase. Feedback was provided regarding a misleading parameter name in the generateStream method to improve consistency with the generate method and the underlying implementation.
| O extends z.ZodTypeAny = z.ZodTypeAny, | ||
| CustomOptions extends z.ZodTypeAny = typeof GenerationCommonConfigSchema, | ||
| >( | ||
| parts: |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GenkitAI APIs were refactored/moved unchanged into the ai package. This is necessary so that we can pass AI APIs into the middleware at runtime. Imagine usecases like context compression or request classification which require access to llms.
Checklist (if applicable):