An integration package connecting AWS and LangChain
Project description
langchain-aws
This package contains the LangChain integrations with AWS.
Installation
pip install -U langchain-aws
All integrations in this package assume that you have the credentials setup to connect with AWS services.
Chat Models
ChatBedrock
class exposes chat models from Bedrock.
from langchain_aws import ChatBedrock
llm = ChatBedrock()
llm.invoke("Sing a ballad of LangChain.")
Embeddings
BedrockEmbeddings
class exposes embeddings from Bedrock.
from langchain_aws import BedrockEmbeddings
embeddings = BedrockEmbeddings()
embeddings.embed_query("What is the meaning of life?")
LLMs
BedrockLLM
class exposes LLMs from Bedrock.
from langchain_aws import BedrockLLM
llm = BedrockLLM()
llm.invoke("The meaning of life is")
Retrievers
AmazonKendraRetriever
class provides a retriever to connect with Amazon Kendra.
from langchain_aws import AmazonKendraRetriever
retriever = AmazonKendraRetriever(
index_id="561be2b6d-9804c7e7-f6a0fbb8-5ccd350"
)
retriever.get_relevant_documents(query="What is the meaning of life?")
AmazonKnowlegeBasesRetriever
class provides a retriever to connect with Amazon Knowlege Bases.
from langchain_aws import AmazonKnowledgeBasesRetriever
retriever = AmazonKnowledgeBasesRetriever(
knowledge_base_id="IAPJ4QPUEU",
retrieval_config={"vectorSearchConfiguration": {"numberOfResults": 4}},
)
retriever.get_relevant_documents(query="What is the meaning of life?")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
langchain_aws-0.1.0.tar.gz
(25.1 kB
view hashes)
Built Distribution
Close
Hashes for langchain_aws-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be63fdc3c6b5ef7698ba526a67f134ecf82f72ed4cf6f3690a5793a770ab1772 |
|
MD5 | 9c6acc056085c200569b088290ff9e43 |
|
BLAKE2b-256 | ee2deac88c149aabc398dd00c6b0663da30929feb8b25b2048a65f71a3753e86 |