Skip to main content

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?")

AmazonKnowledgeBasesRetriever class provides a retriever to connect with Amazon Knowledge 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


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.7.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

langchain_aws-0.1.7-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_aws-0.1.7.tar.gz.

File metadata

  • Download URL: langchain_aws-0.1.7.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for langchain_aws-0.1.7.tar.gz
Algorithm Hash digest
SHA256 aa0bbd3e530e21fdc1d0459e97ee14fa387ce9bb2d00d721cf526e9c3ecea78f
MD5 5ad06f97c654a72dfdaa15796f8f0321
BLAKE2b-256 85f4a414404082199531352a4c64a66bf3968a291441a48f83b280be74521fe4

See more details on using hashes here.

File details

Details for the file langchain_aws-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_aws-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 413f88cbb120cc1d6ca0e9f6d72b89c1d930b78ce071fef5b03e1595fc4d6029
MD5 19bb0258e1e9cf9ec14125196b53636c
BLAKE2b-256 0297b389c66bd4ff211b22be60e987070d6edc7f283e9a6f78819a8ba11a6b54

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page