Skip to content

refactor(js/ai): moved generate api into ai package to enable use with middleware#5042

Merged
pavelgj merged 9 commits intopj/gm-refactor-pluginsfrom
pj/gm-refactor-generate-api-into-ai
Apr 10, 2026
Merged

refactor(js/ai): moved generate api into ai package to enable use with middleware#5042
pavelgj merged 9 commits intopj/gm-refactor-pluginsfrom
pj/gm-refactor-generate-api-into-ai

Conversation

@pavelgj
Copy link
Copy Markdown
Member

@pavelgj pavelgj commented Apr 1, 2026

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):

Copy link
Copy Markdown
Contributor

@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 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.

@github-actions github-actions bot added docs Improvements or additions to documentation go tooling python Python config labels Apr 10, 2026
@pavelgj pavelgj merged commit fb874e3 into pj/gm-refactor-plugins Apr 10, 2026
17 checks passed
@pavelgj pavelgj deleted the pj/gm-refactor-generate-api-into-ai branch April 10, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation go js python Python refactor tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants