This package ref has not yet been fully migrated to v1.
This page contains reference documentation for AWS. See the docs for conceptual guides, tutorials, and examples on using AWS modules.
Representation of a callable function to send to an LLM.
Representation of a callable function to the OpenAI API.
Bedrock embedding models.
To authenticate, the AWS client uses the following methods to automatically load credentials: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html
Amazon Q Runnable wrapper.
To authenticate, the AWS client uses the following methods to automatically load credentials: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html
Filter configuration for retrieval.
Configuration for vector search.
Configuration for retrieval.
Amazon Bedrock Knowledge Bases retrieval.
See https://aws.amazon.com/bedrock/knowledge-bases for more info.
Args: knowledge_base_id: Knowledge Base ID. region_name: The aws
Information that highlights the keywords in the excerpt.
Text with highlights.
Value of an additional result attribute.
Additional result attribute.
Value of a document attribute.
Document attribute.
Base class of a result item.
Query API result item.
Retrieve API result item.
Amazon Kendra Query API search result.
Amazon Kendra Retrieve API search result.
Amazon Kendra Index retriever.
Distance metrics for Redis vector fields.
Base class for Redis fields.
Schema for text fields in Redis.
Schema for tag fields in Redis.
Schema for numeric fields in Redis.
Base class for Redis vector fields.
Schema for flat vector fields in Redis.
Schema for HNSW vector fields in Redis.
Schema for MemoryDB index.
InMemoryDBFilterOperator enumerator is used to create InMemoryDBFilterExpressions
Collection of InMemoryDBFilterFields.
Base class for InMemoryDBFilterFields.
InMemoryDBFilterField representing a tag in a InMemoryDB index.
InMemoryDBFilterField representing a numeric field in a InMemoryDB index.
InMemoryDBFilterField representing a text field in a InMemoryDB index.
Logical expression of InMemoryDBFilterFields.
InMemoryDBFilterExpressions can be combined using the & and | operators to create complex logical expressions that evaluate to the InMemoryDB Query langu
InMemoryVectorStore vector database.
To use, you should have the redis python package installed
for AWS MemoryDB
.. code-block:: bash
Once running, you can connect to the MemoryDB server with
Retriever for InMemoryVectorStore.
Cache that uses MemoryDB as a vector-store backend.
Document compressor that uses AWS Bedrock Rerank API.
AgentFinish with session id information.
AgentAction with session id information.
Configurations for an Inline Agent.
Invoke a Bedrock Agent
Invoke Bedrock Inline Agent as a Runnable.
Adapter class to prepare the inputs from Langchain to a format that LLM model expects.
It also provides helper function to extract the generated text from the model response.
Base class for Bedrock models.
Bedrock models.
To authenticate, the AWS client uses the following methods to automatically load credentials: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html
If a spec
A helper class for parsing the byte stream input.
The output of the model will be in the following format:
b'{"outputs": [" a"]}
' b'{"outputs": [" challenging"]} ' b'{"outputs": ["
A handler class to transform input from LLM to a format that SageMaker endpoint expects.
Similarly, the class handles transforming output from the SageMaker endpoint to a format that LLM class expect
Content handler for LLM class.
Sagemaker Inference Endpoint models.
To use, you must supply the endpoint name from your deployed Sagemaker model & the region where it is deployed.
To authenticate, the AWS client uses the followin
Neptune wrapper for RDF graph operations.
Exception for the Neptune queries.
Neptune Analytics wrapper for graph operations.
Neptune wrapper for graph operations.
Adapter class to prepare the inputs from Langchain to prompt format that Chat model expects.
A chat model that uses the Bedrock API.
Bedrock chat model integration built on the Bedrock converse API.
This implementation will eventually replace the existing ChatBedrock implementation once the Bedrock converse API has feature parity
Cut off the text as soon as any stop words occur.
Check if all requirements for Anthropic count_tokens() are met.
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 the query to only include Cypher keywords.
Extract Cypher code from text using Regex.
Decides whether to use the simple prompt
Selects the final prompt
Chain for question-answering against a Neptune graph by generating openCypher statements.
Security note: Make sure that the database connection uses credentials that are narrowly-scoped to only
Extract SPARQL code from a text.
Selects the final prompt.
Chain for question-answering against a Neptune graph by generating SPARQL statements.
Security note: Make sure that the database connection uses credentials that are narrowly-scoped to only inc
Clean an excerpt from Kendra.
Combine a ResultItem title and excerpt into a single string.
Read in the index schema from a dict or yaml file.
Check if it is a dict and return RedisModel otherwise, check if it's a path and read in the file assuming it's a yaml file and return a RedisModel
Decorator to check for misuse of equality operators.
Check if MemoryDB index exists.
Construct the boto3 session
Parses the raw response from Bedrock Agent
Cut off the text as soon as any stop words occur.
Convert a list of messages to a prompt for llama.
Convert a list of messages to a prompt for llama.
Format a list of messages into a full prompt for the Anthropic model Args: messages (List[BaseMessage]): List of BaseMessage to combine. human_prompt (str, optional): Human prompt
Convert a list of messages to a prompt for mistral.
Convert a list of messages to a prompt for DeepSeek-R1.