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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_aws-0.1.2.tar.gz.
File metadata
- Download URL: langchain_aws-0.1.2.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f796c557fd155ea980b3c9794dd913cde644eea637a710ab53ad07f58b43f562
|
|
| MD5 |
8f62575ebaf042685a27ac880bfc9b55
|
|
| BLAKE2b-256 |
fac18fca6ab0fea983c964a28b70746603a5c4e6715272bbf40f6e834e759bed
|
File details
Details for the file langchain_aws-0.1.2-py3-none-any.whl.
File metadata
- Download URL: langchain_aws-0.1.2-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce90aee673dd631131b16afc55753b6041d98dd2a20cb1b31b1f9ce7dc11c7b0
|
|
| MD5 |
374d0476d1154232a3487495a025b0ae
|
|
| BLAKE2b-256 |
7fab1dc694ffed8d08083754d8a89073cbf14b6a0c6188086f93f7f824ba1220
|