feat(anthropic): add support for Genkit v2 streaming API#342
Merged
xavidop merged 2 commits intoSep 8, 2025
Conversation
Collaborator
|
Builds are failing |
longfin
force-pushed
the
feat/genkit-v2-api-support
branch
from
September 5, 2025 18:36
71f90b9 to
e775baa
Compare
longfin
marked this pull request as draft
September 5, 2025 18:54
- Update streaming callback interface to use v2 API format with streamingRequested, sendChunk, and abortSignal - Add apiVersion: 'v2' to model definition for compatibility - Pass AbortSignal to Anthropic SDK client calls for proper request cancellation - Update tests to reflect the new API changes - Fix code indentation for better consistency BREAKING CHANGE: This updates the plugin to work with Genkit v2 API which changes the streaming callback interface
longfin
force-pushed
the
feat/genkit-v2-api-support
branch
from
September 5, 2025 19:11
e775baa to
d68c288
Compare
longfin
marked this pull request as ready for review
September 5, 2025 19:11
Contributor
Author
|
@xavidop PTAL 🙏 |
Collaborator
|
it is still failing |
longfin
marked this pull request as draft
September 8, 2025 01:26
longfin
force-pushed
the
feat/genkit-v2-api-support
branch
from
September 8, 2025 02:16
e37ea1c to
f831182
Compare
Contributor
Author
|
Fixed build error (f831182). it seems that there is no |
longfin
marked this pull request as ready for review
September 8, 2025 02:19
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.
Add Support for Genkit v2 Streaming API
Summary
This PR updates the Anthropic plugin to support the new Genkit v2 streaming API, which introduces a more structured approach to handling streaming requests and abort signals.
Changes
API Updates
streamingRequested,sendChunk, andabortSignalparametersapiVersion: 'v2': Specified the API version in the model definition for compatibility with Genkit v2AbortSignalto Anthropic SDK client calls to enable request cancellationCode Improvements
toAnthropicToolResponseContentandfromAnthropicContentBlockChunkfunctions for better code readabilityBreaking Changes
Migration Guide
Before (v1 API):
After (v2 API):
Testing
Checklist
Related Issues
This change is part of the broader ecosystem update to support Genkit v2 API across all plugins.
Additional Context
This update ensures the Anthropic plugin remains compatible with the latest Genkit framework version while providing better support for request cancellation through AbortSignal integration.