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

Langchain::Assistant works with AWS Bedrock-hosted Anthropic models #849

Merged
merged 6 commits into from
Oct 29, 2024

Conversation

andreibondarev
Copy link
Collaborator

@andreibondarev andreibondarev commented Oct 19, 2024

Langchain::Assistant can now be used with Langchain::LLM::AwsBedrock models, initially only with Anthropic ones.

llm = Langchain::LLM::AwsBedrock.new(default_options: {chat_completion_model_name: "anthropic.claude-3-5-sonnet-20240620-v1:0"})

assistant = Langchain::Assistant.new(
  llm: llm,
  instructions: "You're a helpful AI assistant",
  tools: [Langchain::Tool::NewsRetriever.new(api_key: ENV["NEWS_API_KEY"])]
)

# Add a user message and run the assistant
assistant.add_message_and_run!(content: "What's the latest news about AI?")

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

Successfully merging this pull request may close these issues.

1 participant