| LangChain Reference home page | https://reference.langchain.com/ |
| GitHub | https://github.com/langchain-ai |
| Main Docs | https://docs.langchain.com/ |
| Deep Agents | https://reference.langchain.com/python/deepagents |
| LangChain | https://reference.langchain.com/python/langchain/overview |
| LangGraph | https://reference.langchain.com/python/langgraph/overview |
| Integrations | https://reference.langchain.com/python/integrations/overview |
| LangSmith | https://reference.langchain.com/python/langsmith |
| Overview | https://reference.langchain.com/python/integrations/overview |
| Overview | https://reference.langchain.com/python/langchain-aws |
| Chat Models | https://reference.langchain.com/python/langchain-aws/chat-models |
| LLMs | https://reference.langchain.com/python/langchain-aws/llms |
| Embeddings | https://reference.langchain.com/python/langchain-aws/embeddings |
| Retrievers | https://reference.langchain.com/python/langchain-aws/retrievers |
| Google GenAI (Gemini) | https://reference.langchain.com/python/langchain-google-genai |
| Google Vertex AI | https://reference.langchain.com/python/langchain-google-vertexai |
| IBM | https://reference.langchain.com/python/langchain-ibm |
| https://chat.langchain.com/ |
| Overview | https://reference.langchain.com/python/langchain-aws |
| Chat Models | https://reference.langchain.com/python/langchain-aws/chat-models |
| LLMs | https://reference.langchain.com/python/langchain-aws/llms |
| Embeddings | https://reference.langchain.com/python/langchain-aws/embeddings |
| Retrievers | https://reference.langchain.com/python/langchain-aws/retrievers |
| Google GenAI (Gemini) | https://reference.langchain.com/python/langchain-google-genai |
| Google Vertex AI | https://reference.langchain.com/python/langchain-google-vertexai |
| IBM | https://reference.langchain.com/python/langchain-ibm |
| https://pypi.org/project/langchain-aws/#history |
| https://opensource.org/licenses/MIT |
| https://pypistats.org/packages/langchain-aws |
| the docs | https://docs.langchain.com/oss/python/integrations/providers/aws |
| ClassAnthropicTool | https://reference.langchain.com/python/langchain-aws/function_calling/AnthropicTool |
| ClassFunctionDescriptionRepresentation of a callable function to send to an LLM. | https://reference.langchain.com/python/langchain-aws/function_calling/FunctionDescription |
| ClassToolDescriptionRepresentation of a callable function to the OpenAI API. | https://reference.langchain.com/python/langchain-aws/function_calling/ToolDescription |
| ClassToolsOutputParser | https://reference.langchain.com/python/langchain-aws/function_calling/ToolsOutputParser |
| ClassAnthropicTool | https://reference.langchain.com/python/langchain-aws/llms/bedrock/AnthropicTool |
| ClassLLMInputOutputAdapterAdapter 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. | https://reference.langchain.com/python/langchain-aws/llms/bedrock/LLMInputOutputAdapter |
| ClassBedrockBaseBase class for Bedrock models. | https://reference.langchain.com/python/langchain-aws/llms/bedrock/BedrockBase |
| ClassBedrockLLMBedrock 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 | https://reference.langchain.com/python/langchain-aws/llms/bedrock/BedrockLLM |
| ClassLineIteratorA 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": [" | https://reference.langchain.com/python/langchain-aws/llms/sagemaker_endpoint/LineIterator |
| ClassContentHandlerBaseA 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 | https://reference.langchain.com/python/langchain-aws/llms/sagemaker_endpoint/ContentHandlerBase |
| ClassLLMContentHandlerContent handler for LLM class. | https://reference.langchain.com/python/langchain-aws/llms/sagemaker_endpoint/LLMContentHandler |
| ClassSagemakerEndpointSagemaker 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 | https://reference.langchain.com/python/langchain-aws/llms/sagemaker_endpoint/SagemakerEndpoint |
| ClassAmazonQAmazon 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 | https://reference.langchain.com/python/langchain-aws/runnables/q_business/AmazonQ |
| ClassInMemoryVectorStoreInMemoryVectorStore 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 | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/base/InMemoryVectorStore |
| ClassInMemoryVectorStoreRetrieverRetriever for InMemoryVectorStore. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/base/InMemoryVectorStoreRetriever |
| ClassInMemorySemanticCacheCache that uses MemoryDB as a vector-store backend. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/cache/InMemorySemanticCache |
| ClassInMemoryDBDistanceMetricDistance metrics for Redis vector fields. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/InMemoryDBDistanceMetric |
| ClassInMemoryDBFieldBase class for Redis fields. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/InMemoryDBField |
| ClassTextFieldSchemaSchema for text fields in Redis. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/TextFieldSchema |
| ClassTagFieldSchemaSchema for tag fields in Redis. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/TagFieldSchema |
| ClassNumericFieldSchemaSchema for numeric fields in Redis. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/NumericFieldSchema |
| ClassInMemoryDBVectorFieldBase class for Redis vector fields. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/InMemoryDBVectorField |
| ClassFlatVectorFieldSchema for flat vector fields in Redis. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/FlatVectorField |
| ClassHNSWVectorFieldSchema for HNSW vector fields in Redis. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/HNSWVectorField |
| ClassInMemoryDBModelSchema for MemoryDB index. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/InMemoryDBModel |
| ClassInMemoryDBFilterOperatorInMemoryDBFilterOperator enumerator is used to create
InMemoryDBFilterExpressions | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBFilterOperator |
| ClassInMemoryDBFilterCollection of InMemoryDBFilterFields. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBFilter |
| ClassInMemoryDBFilterFieldBase class for InMemoryDBFilterFields. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBFilterField |
| ClassInMemoryDBTagInMemoryDBFilterField representing a tag in a InMemoryDB index. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBTag |
| ClassInMemoryDBNumInMemoryDBFilterField representing a numeric field in a InMemoryDB index. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBNum |
| ClassInMemoryDBTextInMemoryDBFilterField representing a text field in a InMemoryDB index. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBText |
| ClassInMemoryDBFilterExpressionLogical expression of InMemoryDBFilterFields.
InMemoryDBFilterExpressions can be combined using the & and | operators to create
complex logical expressions that evaluate to the InMemoryDB Query langu | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/InMemoryDBFilterExpression |
| ClassBedrockRerankDocument compressor that uses AWS Bedrock Rerank API. | https://reference.langchain.com/python/langchain-aws/document_compressors/rerank/BedrockRerank |
| ClassChatPromptAdapterAdapter class to prepare the inputs from Langchain to prompt format
that Chat model expects. | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/ChatPromptAdapter |
| ClassChatBedrockA chat model that uses the Bedrock API. | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/ChatBedrock |
| ClassChatBedrockConverseBedrock 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 | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock_converse/ChatBedrockConverse |
| ClassNeptuneRdfGraphNeptune wrapper for RDF graph operations. | https://reference.langchain.com/python/langchain-aws/graphs/neptune_rdf_graph/NeptuneRdfGraph |
| ClassNeptuneQueryExceptionException for the Neptune queries. | https://reference.langchain.com/python/langchain-aws/graphs/neptune_graph/NeptuneQueryException |
| ClassBaseNeptuneGraph | https://reference.langchain.com/python/langchain-aws/graphs/neptune_graph/BaseNeptuneGraph |
| ClassNeptuneAnalyticsGraphNeptune Analytics wrapper for graph operations. | https://reference.langchain.com/python/langchain-aws/graphs/neptune_graph/NeptuneAnalyticsGraph |
| ClassNeptuneGraphNeptune wrapper for graph operations. | https://reference.langchain.com/python/langchain-aws/graphs/neptune_graph/NeptuneGraph |
| ClassBedrockAgentsRunnableInvoke a Bedrock Agent | https://reference.langchain.com/python/langchain-aws/agents/base/BedrockAgentsRunnable |
| ClassBedrockInlineAgentsRunnableInvoke Bedrock Inline Agent as a Runnable. | https://reference.langchain.com/python/langchain-aws/agents/base/BedrockInlineAgentsRunnable |
| ClassBedrockAgentFinishAgentFinish with session id information. | https://reference.langchain.com/python/langchain-aws/agents/types/BedrockAgentFinish |
| ClassBedrockAgentActionAgentAction with session id information. | https://reference.langchain.com/python/langchain-aws/agents/types/BedrockAgentAction |
| ClassGuardrailConfiguration | https://reference.langchain.com/python/langchain-aws/agents/types/GuardrailConfiguration |
| ClassKnowledgebaseConfiguration | https://reference.langchain.com/python/langchain-aws/agents/types/KnowledgebaseConfiguration |
| ClassInlineAgentConfigurationConfigurations for an Inline Agent. | https://reference.langchain.com/python/langchain-aws/agents/types/InlineAgentConfiguration |
| ClassBedrockEmbeddingsBedrock 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 | https://reference.langchain.com/python/langchain-aws/embeddings/bedrock/BedrockEmbeddings |
| ClassSearchFilterFilter configuration for retrieval. | https://reference.langchain.com/python/langchain-aws/retrievers/bedrock/SearchFilter |
| ClassVectorSearchConfigConfiguration for vector search. | https://reference.langchain.com/python/langchain-aws/retrievers/bedrock/VectorSearchConfig |
| ClassRetrievalConfigConfiguration for retrieval. | https://reference.langchain.com/python/langchain-aws/retrievers/bedrock/RetrievalConfig |
| ClassAmazonKnowledgeBasesRetrieverAmazon 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 | https://reference.langchain.com/python/langchain-aws/retrievers/bedrock/AmazonKnowledgeBasesRetriever |
| ClassHighlightInformation that highlights the keywords in the excerpt. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/Highlight |
| ClassTextWithHighLightsText with highlights. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/TextWithHighLights |
| ClassAdditionalResultAttributeValueValue of an additional result attribute. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/AdditionalResultAttributeValue |
| ClassAdditionalResultAttributeAdditional result attribute. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/AdditionalResultAttribute |
| ClassDocumentAttributeValueValue of a document attribute. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/DocumentAttributeValue |
| ClassDocumentAttributeDocument attribute. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/DocumentAttribute |
| ClassResultItemBase class of a result item. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/ResultItem |
| ClassQueryResultItemQuery API result item. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/QueryResultItem |
| ClassRetrieveResultItemRetrieve API result item. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/RetrieveResultItem |
| ClassQueryResultAmazon Kendra Query API search result. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/QueryResult |
| ClassRetrieveResultAmazon Kendra Retrieve API search result. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/RetrieveResult |
| ClassAmazonKendraRetrieverAmazon Kendra Index retriever. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/AmazonKendraRetriever |
| Functionsetup_logging | https://reference.langchain.com/python/langchain-aws/setup_logging |
| Functionget_system_message | https://reference.langchain.com/python/langchain-aws/function_calling/get_system_message |
| Functionconvert_to_anthropic_tool | https://reference.langchain.com/python/langchain-aws/function_calling/convert_to_anthropic_tool |
| Functionenforce_stop_tokensCut off the text as soon as any stop words occur. | https://reference.langchain.com/python/langchain-aws/utils/enforce_stop_tokens |
| Functionanthropic_tokens_supportedCheck if all requirements for Anthropic count_tokens() are met. | https://reference.langchain.com/python/langchain-aws/utils/anthropic_tokens_supported |
| Functionget_num_tokens_anthropicGet the number of tokens in a string of text. | https://reference.langchain.com/python/langchain-aws/utils/get_num_tokens_anthropic |
| Functionget_token_ids_anthropicGet the token ids for a string of text. | https://reference.langchain.com/python/langchain-aws/utils/get_token_ids_anthropic |
| Functionthinking_in_paramsCheck if the thinking parameter is enabled in the request. | https://reference.langchain.com/python/langchain-aws/utils/thinking_in_params |
| Functionextract_tool_calls | https://reference.langchain.com/python/langchain-aws/llms/bedrock/extract_tool_calls |
| Functionenforce_stop_tokensCut off the text as soon as any stop words occur. | https://reference.langchain.com/python/langchain-aws/llms/sagemaker_endpoint/enforce_stop_tokens |
| Functioncheck_index_existsCheck if MemoryDB index exists. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/base/check_index_exists |
| Functionread_schemaRead 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 | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema/read_schema |
| Functioncheck_operator_misuseDecorator to check for misuse of equality operators. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters/check_operator_misuse |
| Functionconvert_messages_to_prompt_llamaConvert a list of messages to a prompt for llama. | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/convert_messages_to_prompt_llama |
| Functionconvert_messages_to_prompt_llama3Convert a list of messages to a prompt for llama. | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/convert_messages_to_prompt_llama3 |
| Functionconvert_messages_to_prompt_anthropicFormat 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 | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/convert_messages_to_prompt_anthropic |
| Functionconvert_messages_to_prompt_mistralConvert a list of messages to a prompt for mistral. | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/convert_messages_to_prompt_mistral |
| Functionconvert_messages_to_prompt_deepseekConvert a list of messages to a prompt for DeepSeek-R1. | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock/convert_messages_to_prompt_deepseek |
| Functionget_boto_sessionConstruct the boto3 session | https://reference.langchain.com/python/langchain-aws/agents/utils/get_boto_session |
| Functionparse_agent_responseParses the raw response from Bedrock Agent | https://reference.langchain.com/python/langchain-aws/agents/utils/parse_agent_response |
| Functiontrim_queryTrim the query to only include Cypher keywords. | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_cypher/trim_query |
| Functionextract_cypherExtract Cypher code from text using Regex. | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_cypher/extract_cypher |
| Functionuse_simple_promptDecides whether to use the simple prompt | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_cypher/use_simple_prompt |
| Functionget_promptSelects the final prompt | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_cypher/get_prompt |
| Functioncreate_neptune_opencypher_qa_chainChain 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 | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_cypher/create_neptune_opencypher_qa_chain |
| Functionextract_sparqlExtract SPARQL code from a text. | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_sparql/extract_sparql |
| Functionget_promptSelects the final prompt. | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_sparql/get_prompt |
| Functioncreate_neptune_sparql_qa_chainChain 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 | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_sparql/create_neptune_sparql_qa_chain |
| Functionclean_excerptClean an excerpt from Kendra. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/clean_excerpt |
| Functioncombined_textCombine a ResultItem title and excerpt into a single string. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/combined_text |
| Modulelangchain_aws | https://reference.langchain.com/python/langchain-aws/langchain_aws |
| Modulefunction_callingMethods for creating function specs in the style of Bedrock Functions
for supported model providers | https://reference.langchain.com/python/langchain-aws/function_calling |
| Moduleutils | https://reference.langchain.com/python/langchain-aws/utils |
| Modulellms | https://reference.langchain.com/python/langchain-aws/llms |
| Modulebedrock | https://reference.langchain.com/python/langchain-aws/llms/bedrock |
| Modulesagemaker_endpointSagemaker InvokeEndpoint API. | https://reference.langchain.com/python/langchain-aws/llms/sagemaker_endpoint |
| Modulerunnables | https://reference.langchain.com/python/langchain-aws/runnables |
| Moduleq_business | https://reference.langchain.com/python/langchain-aws/runnables/q_business |
| Modulevectorstores | https://reference.langchain.com/python/langchain-aws/vectorstores |
| Moduleinmemorydb | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb |
| ModulebaseWrapper around MemoryDB vector database. | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/base |
| Modulecache | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/cache |
| Moduleschema | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/schema |
| Modulefilters | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/filters |
| Moduleconstants | https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/constants |
| Moduledocument_compressors | https://reference.langchain.com/python/langchain-aws/document_compressors |
| Modulererank | https://reference.langchain.com/python/langchain-aws/document_compressors/rerank |
| Modulechat_models | https://reference.langchain.com/python/langchain-aws/chat_models |
| Modulebedrock | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock |
| Modulebedrock_converse | https://reference.langchain.com/python/langchain-aws/chat_models/bedrock_converse |
| Modulegraphs | https://reference.langchain.com/python/langchain-aws/graphs |
| Moduleneptune_rdf_graph | https://reference.langchain.com/python/langchain-aws/graphs/neptune_rdf_graph |
| Moduleneptune_graph | https://reference.langchain.com/python/langchain-aws/graphs/neptune_graph |
| Moduleagents | https://reference.langchain.com/python/langchain-aws/agents |
| Modulebase | https://reference.langchain.com/python/langchain-aws/agents/base |
| Moduleutils | https://reference.langchain.com/python/langchain-aws/agents/utils |
| Moduletypes | https://reference.langchain.com/python/langchain-aws/agents/types |
| Moduleembeddings | https://reference.langchain.com/python/langchain-aws/embeddings |
| Modulebedrock | https://reference.langchain.com/python/langchain-aws/embeddings/bedrock |
| Modulechains | https://reference.langchain.com/python/langchain-aws/chains |
| Modulegraph_qa | https://reference.langchain.com/python/langchain-aws/chains/graph_qa |
| Moduleneptune_cypher | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_cypher |
| Moduleneptune_sparqlQuestion answering over an RDF or OWL graph using SPARQL. | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/neptune_sparql |
| Moduleprompts | https://reference.langchain.com/python/langchain-aws/chains/graph_qa/prompts |
| Moduleretrievers | https://reference.langchain.com/python/langchain-aws/retrievers |
| Modulebedrock | https://reference.langchain.com/python/langchain-aws/retrievers/bedrock |
| Modulekendra | https://reference.langchain.com/python/langchain-aws/retrievers/kendra |
| TypeOutputType | https://reference.langchain.com/python/langchain-aws/agents/types/OutputType |
| TypeFilterValue | https://reference.langchain.com/python/langchain-aws/retrievers/bedrock/FilterValue |
| TypeDocumentAttributeValueTypePossible types of a DocumentAttributeValue.
Dates are also represented as str. | https://reference.langchain.com/python/langchain-aws/retrievers/kendra/DocumentAttributeValueType |