langchain-aws: 0.2.35#
agents#
Classes
Invoke a Bedrock Agent | |
Invoke Bedrock Inline Agent as a Runnable. | |
AgentAction with session id information. | |
AgentFinish with session id information. | |
Configurations for an Inline Agent. | |
Functions
Construct the boto3 session | |
| Parses the raw response from Bedrock Agent |
chains#
Functions
| Chain for question-answering against a Neptune graph by generating openCypher statements. |
Extract Cypher code from text using Regex. | |
Selects the final prompt | |
Trim the query to only include Cypher keywords. | |
Decides whether to use the simple prompt | |
| Chain for question-answering against a Neptune graph by generating SPARQL statements. |
Extract SPARQL code from a text. | |
Selects the final prompt. |
chat_models#
Classes
A chat model that uses the Bedrock API. | |
Adapter class to prepare the inputs from Langchain to prompt format that Chat model expects. | |
Bedrock chat model integration built on the Bedrock converse API. | |
A helper class for parsing the byte stream input. | |
Content handler for ChatSagemakerEndpoint class. | |
A chat model that uses a HuggingFace TGI compatible SageMaker Endpoint. |
Functions
| Format a list of messages into a full prompt for the Anthropic model |
| Convert a list of messages to a prompt for DeepSeek-R1. |
Convert a list of messages to a prompt for llama. | |
Convert a list of messages to a prompt for Llama 3. | |
Convert a list of messages to a prompt for Llama 4. | |
Convert a list of messages to a prompt for mistral. | |
Convert a list of messages to a Harmony format prompt for OpenAI Responses API. | |
Convert a list of messages to a prompt for Writer. |
document_compressors#
Classes
Document compressor that uses AWS Bedrock Rerank API. |
embeddings#
Classes
Bedrock embedding models. |
function_calling#
Classes
Representation of a callable function to send to an LLM. | |
Representation of a callable function to the OpenAI API. | |
Functions
graphs#
Classes
Neptune Analytics wrapper for graph operations. | |
| Neptune wrapper for graph operations. |
Exception for the Neptune queries. | |
Neptune wrapper for RDF graph operations. |
llms#
Classes
Base class for Bedrock models. | |
Bedrock models. | |
Adapter class to prepare the inputs from Langchain to a format that LLM model expects. | |
Content handler for LLM class. | |
A helper class for parsing the byte stream input. | |
Sagemaker Inference Endpoint models. |
Functions
| |
Cut off the text as soon as any stop words occur. |
retrievers#
Classes
Amazon Bedrock Knowledge Bases retrieval. | |
Configuration for retrieval. | |
Filter configuration for retrieval. | |
Configuration for vector search. | |
Additional result attribute. | |
Value of an additional result attribute. | |
Amazon Kendra Index retriever. | |
Document attribute. | |
Value of a document attribute. | |
Information that highlights the keywords in the excerpt. | |
Amazon Kendra Query API search result. | |
Query API result item. | |
Base class of a result item. | |
Amazon Kendra Retrieve API search result. | |
Retrieve API result item. | |
Text with highlights. | |
AmazonS3VectorsRetriever is a retriever for Amazon S3 Vectors. |
Functions
| Clean an excerpt from Kendra. |
Combine a ResultItem title and excerpt into a single string. |
runnables#
Classes
|
utilities#
Classes
| Escape punctuation within an input string. |
Enumerator of the Distance strategies for calculating distances between vectors. |
Functions
Row-wise cosine similarity between two equal-width matrices. | |
Row-wise cosine similarity with optional top-k and score threshold filtering. | |
| Get a redis client from the connection url given. |
Filter out metadata types that are not supported for a vector store. | |
Calculate maximal marginal relevance. |
utils#
Classes
A handler class to transform input from LLM and BaseChatModel to a |
Functions
Check if all requirements for Anthropic count_tokens() are met. | |
| Helper function to validate AWS credentials and create an AWS client. |
| Cut off the text as soon as any stop words occur. |
Get the number of tokens in a string of text. | |
Get the token ids for a string of text. | |
| Check if the thinking parameter is enabled in the request. |
| Trim trailing whitespace from final AIMessage content. |
vectorstores#
Classes
InMemoryVectorStore vector database. | |
Retriever for InMemoryVectorStore. | |
Cache that uses MemoryDB as a vector-store backend. | |
Collection of InMemoryDBFilterFields. | |
| Logical expression of InMemoryDBFilterFields. |
| Base class for InMemoryDBFilterFields. |
| InMemoryDBFilterOperator enumerator is used to create InMemoryDBFilterExpressions |
InMemoryDBFilterField representing a numeric field in a InMemoryDB index. | |
InMemoryDBFilterField representing a tag in a InMemoryDB index. | |
InMemoryDBFilterField representing a text field in a InMemoryDB index. | |
Schema for flat vector fields in Redis. | |
Schema for HNSW vector fields in Redis. | |
| Distance metrics for Redis vector fields. |
Base class for Redis fields. | |
Schema for MemoryDB index. | |
Base class for Redis vector fields. | |
Schema for numeric fields in Redis. | |
Schema for tag fields in Redis. | |
Schema for text fields in Redis. | |
S3Vectors is Amazon S3 Vectors database. |
Functions
Check if MemoryDB index exists. | |
Decorator to check for misuse of equality operators. | |
Read in the index schema from a dict or yaml file. |