Skip to content
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

Freature #1005 - Add streaming API for Bedrock Anthropics #1006

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

michalkozminski
Copy link
Contributor

@michalkozminski michalkozminski commented Apr 23, 2024

Context

Feature adds Bedrock Antrhopics Streaming capability #1005

Previous PR #679

Change

Added new streaming model AbstractBedrockStreamingChatModel

Checklist

Before submitting this PR, please check the following points:

  • I have added unit and integration tests for my change
  • All unit and integration tests in the module I have added/changed are green
  • All unit and integration tests in the core and main modules are green
  • I have added/updated the documentation
  • I have added an example in the examples repo (only for "big" features)
  • I have added my new module in the BOM (only when a new module is added)

Checklist for adding new embedding store integration

  • I have added a {NameOfIntegration}EmbeddingStoreIT that extends from either EmbeddingStoreIT or EmbeddingStoreWithFilteringIT

@michalkozminski
Copy link
Contributor Author

@langchain4j Previous comments were addressed. Would be amazing if you could run CI I checked locally everything compiles and tests pass.

@langchain4j langchain4j added the P2 High priority label Apr 23, 2024
@michalkozminski
Copy link
Contributor Author

PR doesn't address token count as Bedrock doesn't expose such information as part of response. This will require token estimations which will be addressed in the next PR.

@michalkozminski
Copy link
Contributor Author

@langchain4j would be amazing if you could give a look on it.

@langchain4j
Copy link
Owner

@michalkozminski I will review it asap, in the order of priorities. Thanks for your patience!

Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalkozminski thanks a lot! Just a few minor comments

@SuperBuilder
public class BedrockAnthropicStreamingChatModel extends AbstractBedrockStreamingChatModel {
@Builder.Default
private final String model = BedrockAnthropicStreamingChatModel.Types.AnthropicClaudeV2.getValue();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: should it use one of v3 models (e.g. haiku) by default?

@@ -179,7 +179,7 @@ See example [here](https://github.com/langchain4j/langchain4j-examples/blob/main
| [OpenAI](https://docs.langchain4j.dev/integrations/language-models/open-ai) | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| [Azure OpenAI](https://docs.langchain4j.dev/integrations/language-models/azure-open-ai) | | ✅ | ✅ | ✅ | ✅ | | ✅ |
| [Hugging Face](https://docs.langchain4j.dev/integrations/language-models/hugging-face) | | ✅ | | ✅ | | | | |
| [Amazon Bedrock](https://docs.langchain4j.dev/integrations/language-models/amazon-bedrock) | | ✅ | | ✅ | ✅ | | |
| [Amazon Bedrock](https://docs.langchain4j.dev/integrations/language-models/amazon-bedrock) | | ✅ | | ✅ | ✅ | | |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants