langchain_aws 0.1.7

langchain_aws.chat_models

Classes

chat_models.bedrock.BedrockChat

[Deprecated]

chat_models.bedrock.ChatBedrock

A chat model that uses the Bedrock API.

chat_models.bedrock.ChatPromptAdapter()

Adapter class to prepare the inputs from Langchain to prompt format that Chat model expects.

chat_models.bedrock_converse.ChatBedrockConverse

[Beta] Bedrock chat model integration built on the converse api.

Functions

chat_models.bedrock.convert_messages_to_prompt_anthropic(...)

Format a list of messages into a full prompt for the Anthropic model

chat_models.bedrock.convert_messages_to_prompt_llama(...)

Convert a list of messages to a prompt for llama.

chat_models.bedrock.convert_messages_to_prompt_llama3(...)

Convert a list of messages to a prompt for llama.

chat_models.bedrock.convert_messages_to_prompt_mistral(...)

Convert a list of messages to a prompt for mistral.

langchain_aws.embeddings

Classes

embeddings.bedrock.BedrockEmbeddings

Bedrock embedding models.

langchain_aws.function_calling

Methods for creating function specs in the style of Bedrock Functions for supported model providers

Classes

function_calling.AnthropicTool

function_calling.FunctionDescription

Representation of a callable function to send to an LLM.

function_calling.ToolDescription

Representation of a callable function to the OpenAI API.

function_calling.ToolsOutputParser

Create a new model by parsing and validating input data from keyword arguments.

Functions

function_calling.convert_to_anthropic_tool(tool)

function_calling.get_system_message(tools)

langchain_aws.graphs

Classes

graphs.neptune_graph.BaseNeptuneGraph()

graphs.neptune_graph.NeptuneAnalyticsGraph(...)

Neptune Analytics wrapper for graph operations.

graphs.neptune_graph.NeptuneGraph(host[, ...])

Neptune wrapper for graph operations.

graphs.neptune_graph.NeptuneQueryException(...)

Exception for the Neptune queries.

graphs.neptune_rdf_graph.NeptuneRdfGraph(host)

Neptune wrapper for RDF graph operations.

langchain_aws.llms

Classes

llms.bedrock.AnthropicTool

llms.bedrock.Bedrock

[Deprecated]

llms.bedrock.BedrockBase

Base class for Bedrock models.

llms.bedrock.BedrockLLM

Bedrock models.

llms.bedrock.LLMInputOutputAdapter()

Adapter class to prepare the inputs from Langchain to a format that LLM model expects.

llms.sagemaker_endpoint.ContentHandlerBase()

A handler class to transform input from LLM to a format that SageMaker endpoint expects.

llms.sagemaker_endpoint.LLMContentHandler()

Content handler for LLM class.

llms.sagemaker_endpoint.LineIterator(stream)

A helper class for parsing the byte stream input.

llms.sagemaker_endpoint.SagemakerEndpoint

Sagemaker Inference Endpoint models.

Functions

llms.bedrock.extract_tool_calls(content)

llms.sagemaker_endpoint.enforce_stop_tokens(...)

Cut off the text as soon as any stop words occur.

langchain_aws.retrievers

Classes

retrievers.bedrock.AmazonKnowledgeBasesRetriever

Amazon Bedrock Knowledge Bases retrieval.

retrievers.bedrock.RetrievalConfig

Configuration for retrieval.

retrievers.bedrock.VectorSearchConfig

Configuration for vector search.

retrievers.kendra.AdditionalResultAttribute

Additional result attribute.

retrievers.kendra.AdditionalResultAttributeValue

Value of an additional result attribute.

retrievers.kendra.AmazonKendraRetriever

Amazon Kendra Index retriever.

retrievers.kendra.DocumentAttribute

Document attribute.

retrievers.kendra.DocumentAttributeValue

Value of a document attribute.

retrievers.kendra.Highlight

Information that highlights the keywords in the excerpt.

retrievers.kendra.QueryResult

Amazon Kendra Query API search result.

retrievers.kendra.QueryResultItem

Query API result item.

retrievers.kendra.ResultItem

Base class of a result item.

retrievers.kendra.RetrieveResult

Amazon Kendra Retrieve API search result.

retrievers.kendra.RetrieveResultItem

Retrieve API result item.

retrievers.kendra.TextWithHighLights

Text with highlights.

Functions

retrievers.kendra.clean_excerpt(excerpt)

Clean an excerpt from Kendra.

retrievers.kendra.combined_text(item)

Combine a ResultItem title and excerpt into a single string.

langchain_aws.utils

Functions

utils.enforce_stop_tokens(text, stop)

Cut off the text as soon as any stop words occur.

utils.get_num_tokens_anthropic(text)

Get the number of tokens in a string of text.

utils.get_token_ids_anthropic(text)

Get the token ids for a string of text.