mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-14 21:59:33 +03:00
Replace this comment with: - Description: Add Bedrock implementation of Anthropic Claude for Chat - Tag maintainer: @hwchase17, @baskaryan - Twitter handle: @bwmatson --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
3.3 KiB
3.3 KiB
In [ ]:
%pip install boto3In [1]:
from langchain.chat_models import BedrockChat
from langchain.schema import HumanMessageIn [2]:
chat = BedrockChat(model_id="anthropic.claude-v2", model_kwargs={"temperature":0.1})In [3]:
messages = [
HumanMessage(
content="Translate this sentence from English to French. I love programming."
)
]
chat(messages)Out [3]:
AIMessage(content=" Voici la traduction en français : J'adore programmer.", additional_kwargs={}, example=False)In [ ]: