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

Uploaded Source

Built Distribution

langchain_aws-0.1.4-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_aws-0.1.4.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for langchain_aws-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8b800eb6b0ec40e05b1bb38dc75fa581e65d4f9b9537d04772e3eb7cdd3c1c3e
MD5 12a32d2e18175497f10b862b045f948c
BLAKE2b-256 0816867ca0c8d1b226d73bdd57bebc0be92b682d6375206f42702aef9c6a30d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_aws-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 24d921fb72b5595f2a709cd18ab0417344a4134c0f1c1eb9ada17c81b31f5322
MD5 5e31dc201cc653b6b68118196f97e31f
BLAKE2b-256 a6c94bf8eb8017e2f3ba31da7950ecfd5fbf8de43c2d87916bea03e734f27ca1

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