load_file() (langchain.document_loaders.DirectoryLoader method)
load_fn_kwargs (langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
load_guide() (langchain.document_loaders.IFixitLoader method)
load_huggingface_tool() (in module langchain.agents)
load_local() (langchain.vectorstores.Annoy class method)
(langchain.vectorstores.FAISS class method)
load_max_docs (langchain.utilities.ArxivAPIWrapper attribute)
load_memory_variables() (langchain.experimental.GenerativeAgentMemory method)
(langchain.memory.CombinedMemory method)
(langchain.memory.ConversationBufferMemory method)
(langchain.memory.ConversationBufferWindowMemory method)
(langchain.memory.ConversationEntityMemory method)
(langchain.memory.ConversationKGMemory method)
(langchain.memory.ConversationStringBufferMemory method)
(langchain.memory.ConversationSummaryBufferMemory method)
(langchain.memory.ConversationSummaryMemory method)
(langchain.memory.ConversationTokenBufferMemory method)
(langchain.memory.ReadOnlySharedMemory method)
(langchain.memory.SimpleMemory method)
(langchain.memory.VectorStoreRetrieverMemory method)
load_messages() (langchain.memory.CosmosDBChatMessageHistory method)
load_page() (langchain.document_loaders.NotionDBLoader method)
load_prompt() (in module langchain.prompts)
load_questions_and_answers() (langchain.document_loaders.IFixitLoader method)
load_results() (langchain.document_loaders.HNLoader method)
load_suggestions() (langchain.document_loaders.IFixitLoader static method)
load_tools() (in module langchain.agents)
load_trashed_files (langchain.document_loaders.GoogleDriveLoader attribute)


load_trashed_files (langchain.document_loaders.GoogleDriveLoader attribute)
locals (langchain.python.PythonREPL attribute)
(langchain.utilities.PythonREPL attribute)
location (langchain.llms.VertexAI attribute)
log_probs (langchain.llms.AlephAlpha attribute)
logit_bias (langchain.llms.AlephAlpha attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
logitBias (langchain.llms.AI21 attribute)
logits_all (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
logprobs (langchain.llms.LlamaCpp attribute)
(langchain.llms.Writer attribute)
lookup_tool() (langchain.agents.AgentExecutor method)
lora_base (langchain.llms.LlamaCpp attribute)
lora_path (langchain.llms.LlamaCpp attribute)
M
MarkdownTextSplitter (class in langchain.text_splitter)
MastodonTootsLoader (class in langchain.document_loaders)
MathpixPDFLoader (class in langchain.document_loaders)
max_checks (langchain.chains.LLMSummarizationCheckerChain attribute)
max_execution_time (langchain.agents.AgentExecutor attribute)
max_iter (langchain.chains.FlareChain attribute)
max_iterations (langchain.agents.agent_toolkits.PowerBIToolkit attribute)
(langchain.agents.AgentExecutor attribute)
(langchain.tools.QueryPowerBITool attribute)
max_length (langchain.llms.NLPCloud attribute)
(langchain.llms.Petals attribute)
(langchain.prompts.example_selector.LengthBasedExampleSelector attribute)


(langchain.prompts.example_selector.LengthBasedExampleSelector attribute)
max_marginal_relevance_search() (langchain.vectorstores.Annoy method)
(langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.Milvus method)
(langchain.vectorstores.Qdrant method)
(langchain.vectorstores.SupabaseVectorStore method)
(langchain.vectorstores.VectorStore method)
(langchain.vectorstores.Weaviate method)
max_marginal_relevance_search_by_vector() (langchain.vectorstores.Annoy method)
(langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.Milvus method)
(langchain.vectorstores.SupabaseVectorStore method)
(langchain.vectorstores.VectorStore method)
(langchain.vectorstores.Weaviate method)
max_new_tokens (langchain.llms.Petals attribute)
max_output_tokens (langchain.llms.GooglePalm attribute)
(langchain.llms.VertexAI attribute)
max_results (langchain.utilities.DuckDuckGoSearchAPIWrapper attribute)
max_retries (langchain.chat_models.ChatOpenAI attribute)
(langchain.embeddings.OpenAIEmbeddings attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenAIChat attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.PromptLayerOpenAIChat attribute)
max_token_limit (langchain.memory.ConversationSummaryBufferMemory attribute)
(langchain.memory.ConversationTokenBufferMemory attribute)
max_tokens (langchain.chat_models.ChatOpenAI attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Cohere attribute)


(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Cohere attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.PredictionGuard attribute)
(langchain.llms.Writer attribute)
max_tokens_for_prompt() (langchain.llms.AzureOpenAI method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenLM method)
(langchain.llms.PromptLayerOpenAI method)
max_tokens_limit (langchain.chains.ConversationalRetrievalChain attribute)
(langchain.chains.RetrievalQAWithSourcesChain attribute)
(langchain.chains.VectorDBQAWithSourcesChain attribute)
max_tokens_per_generation (langchain.llms.RWKV attribute)
max_tokens_to_sample (langchain.llms.Anthropic attribute)
maximum_tokens (langchain.llms.AlephAlpha attribute)
maxTokens (langchain.llms.AI21 attribute)
memories (langchain.memory.CombinedMemory attribute)
(langchain.memory.SimpleMemory attribute)
memory (langchain.chains.ConversationChain attribute)
(langchain.experimental.GenerativeAgent attribute)
(langchain.memory.ReadOnlySharedMemory attribute)
memory_key (langchain.memory.ConversationSummaryBufferMemory attribute)
(langchain.memory.ConversationTokenBufferMemory attribute)
(langchain.memory.VectorStoreRetrieverMemory attribute)
memory_retriever (langchain.experimental.GenerativeAgentMemory attribute)
memory_stream (langchain.retrievers.TimeWeightedVectorStoreRetriever attribute)
memory_variables (langchain.experimental.GenerativeAgentMemory property)
(langchain.memory.CombinedMemory property)
(langchain.memory.ConversationStringBufferMemory property)
(langchain.memory.ReadOnlySharedMemory property)
(langchain.memory.SimpleMemory property)


(langchain.memory.ReadOnlySharedMemory property)
(langchain.memory.SimpleMemory property)
(langchain.memory.VectorStoreRetrieverMemory property)
merge_from() (langchain.vectorstores.FAISS method)
messages (langchain.memory.CassandraChatMessageHistory property)
(langchain.memory.ChatMessageHistory attribute)
(langchain.memory.DynamoDBChatMessageHistory property)
(langchain.memory.FileChatMessageHistory property)
(langchain.memory.MomentoChatMessageHistory property)
(langchain.memory.MongoDBChatMessageHistory property)
(langchain.memory.PostgresChatMessageHistory property)
(langchain.memory.RedisChatMessageHistory property)
metadata_column (langchain.vectorstores.MyScale property)
metadata_key (langchain.retrievers.RemoteLangChainRetriever attribute)
METADATA_KEY (langchain.vectorstores.Qdrant attribute)
MetalRetriever (class in langchain.retrievers)
metaphor_api_key (langchain.utilities.MetaphorSearchAPIWrapper attribute)
method (langchain.tools.APIOperation attribute)
metric (langchain.vectorstores.MyScaleSettings attribute)
Milvus (class in langchain.vectorstores)
min_chunk_size (langchain.document_loaders.DocugamiLoader attribute)
min_length (langchain.llms.NLPCloud attribute)
min_prob (langchain.chains.FlareChain attribute)
min_token_gap (langchain.chains.FlareChain attribute)
min_tokens (langchain.llms.GooseAI attribute)
(langchain.llms.Writer attribute)
minimax_api_key (langchain.embeddings.MiniMaxEmbeddings attribute)
minimax_group_id (langchain.embeddings.MiniMaxEmbeddings attribute)
minimum_tokens (langchain.llms.AlephAlpha attribute)
minTokens (langchain.llms.AI21 attribute)
model (langchain.embeddings.AlephAlphaAsymmetricSemanticEmbedding attribute)


model (langchain.embeddings.AlephAlphaAsymmetricSemanticEmbedding attribute)
(langchain.embeddings.CohereEmbeddings attribute)
(langchain.embeddings.MiniMaxEmbeddings attribute)
(langchain.llms.AI21 attribute)
(langchain.llms.AlephAlpha attribute)
(langchain.llms.Anthropic attribute)
(langchain.llms.Cohere attribute)
(langchain.llms.CTransformers attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.RWKV attribute)
(langchain.retrievers.document_compressors.CohereRerank attribute)
model_file (langchain.llms.CTransformers attribute)
model_id (langchain.embeddings.ModelScopeEmbeddings attribute)
(langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.embeddings.SelfHostedHuggingFaceInstructEmbeddings attribute)
(langchain.llms.HuggingFacePipeline attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.Writer attribute)
model_key (langchain.llms.Banana attribute)
model_kwargs (langchain.chat_models.ChatOpenAI attribute)
(langchain.embeddings.HuggingFaceEmbeddings attribute)
(langchain.embeddings.HuggingFaceHubEmbeddings attribute)
(langchain.embeddings.HuggingFaceInstructEmbeddings attribute)
(langchain.embeddings.SagemakerEndpointEmbeddings attribute)
(langchain.llms.Anyscale attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Banana attribute)
(langchain.llms.Beam attribute)
(langchain.llms.CerebriumAI attribute)
(langchain.llms.Databricks attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.HuggingFaceEndpoint attribute)
(langchain.llms.HuggingFaceHub attribute)


(langchain.llms.HuggingFaceHub attribute)
(langchain.llms.HuggingFacePipeline attribute)
(langchain.llms.Modal attribute)
(langchain.llms.MosaicML attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenAIChat attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Petals attribute)
(langchain.llms.PromptLayerOpenAIChat attribute)
(langchain.llms.SagemakerEndpoint attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.StochasticAI attribute)
model_load_fn (langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
model_name (langchain.chains.OpenAIModerationChain attribute)
(langchain.chat_models.ChatGooglePalm attribute)
(langchain.chat_models.ChatOpenAI attribute)
(langchain.chat_models.ChatVertexAI attribute)
(langchain.embeddings.HuggingFaceEmbeddings attribute)
(langchain.embeddings.HuggingFaceInstructEmbeddings attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.GooglePalm attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenAIChat attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Petals attribute)
(langchain.llms.PromptLayerOpenAIChat attribute)
(langchain.tools.SteamshipImageGenerationTool attribute)
model_path (langchain.llms.LlamaCpp attribute)
model_reqs (langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)


model_reqs (langchain.embeddings.SelfHostedHuggingFaceEmbeddings attribute)
(langchain.embeddings.SelfHostedHuggingFaceInstructEmbeddings attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
model_type (langchain.llms.CTransformers attribute)
model_url (langchain.embeddings.TensorflowHubEmbeddings attribute)
modelname_to_contextsize() (langchain.llms.AzureOpenAI method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenLM method)
(langchain.llms.PromptLayerOpenAI method)
ModernTreasuryLoader (class in langchain.document_loaders)
    module

langchain.agents
langchain.agents.agent_toolkits
langchain.chains
langchain.chat_models
langchain.docstore
langchain.document_loaders
langchain.document_transformers
langchain.embeddings
langchain.llms
langchain.memory
langchain.output_parsers
langchain.prompts
langchain.prompts.example_selector
langchain.python
langchain.retrievers
langchain.retrievers.document_compressors
langchain.serpapi
langchain.text_splitter
langchain.tools
langchain.utilities
langchain.utilities.searx_search
langchain.vectorstores
MomentoChatMessageHistory (class in langchain.memory)
MongoDBChatMessageHistory (class in langchain.memory)
moving_summary_buffer (langchain.memory.ConversationSummaryBufferMemory attribute)
MWDumpLoader (class in langchain.document_loaders)
MyScale (class in langchain.vectorstores)
N
n (langchain.chat_models.ChatGooglePalm attribute)
(langchain.chat_models.ChatOpenAI attribute)
(langchain.llms.AlephAlpha attribute)
(langchain.llms.AzureOpenAI attribute)


(langchain.llms.AlephAlpha attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.GooglePalm attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Writer attribute)
n_batch (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
n_ctx (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
n_gpu_layers (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.LlamaCpp attribute)
n_parts (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
n_predict (langchain.llms.GPT4All attribute)
n_threads (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
name (langchain.agents.agent_toolkits.VectorStoreInfo attribute)
(langchain.experimental.GenerativeAgent attribute)
(langchain.llms.PredictionGuard attribute)
(langchain.output_parsers.ResponseSchema attribute)
(langchain.tools.BaseTool attribute)
(langchain.tools.ClickTool attribute)
(langchain.tools.CopyFileTool attribute)
(langchain.tools.CurrentWebPageTool attribute)
(langchain.tools.DeleteFileTool attribute)
(langchain.tools.ExtractHyperlinksTool attribute)
(langchain.tools.ExtractTextTool attribute)
(langchain.tools.FileSearchTool attribute)
(langchain.tools.GetElementsTool attribute)
(langchain.tools.GmailCreateDraft attribute)
(langchain.tools.GmailGetMessage attribute)


(langchain.tools.GmailCreateDraft attribute)
(langchain.tools.GmailGetMessage attribute)
(langchain.tools.GmailGetThread attribute)
(langchain.tools.GmailSearch attribute)
(langchain.tools.GmailSendMessage attribute)
(langchain.tools.ListDirectoryTool attribute)
(langchain.tools.MoveFileTool attribute)
(langchain.tools.NavigateBackTool attribute)
(langchain.tools.NavigateTool attribute)
(langchain.tools.ReadFileTool attribute)
(langchain.tools.ShellTool attribute)
(langchain.tools.Tool attribute)
(langchain.tools.WriteFileTool attribute)
nla_tools (langchain.agents.agent_toolkits.NLAToolkit attribute)
NLTKTextSplitter (class in langchain.text_splitter)
no_update_value (langchain.output_parsers.RegexDictParser attribute)
normalize (langchain.embeddings.AlephAlphaAsymmetricSemanticEmbedding attribute)
NotebookLoader (class in langchain.document_loaders)
NotionDBLoader (class in langchain.document_loaders)
NotionDirectoryLoader (class in langchain.document_loaders)
num_beams (langchain.llms.NLPCloud attribute)
num_pad_tokens (langchain.chains.FlareChain attribute)
num_results (langchain.tools.BingSearchResults attribute)
(langchain.tools.DuckDuckGoSearchResults attribute)
(langchain.tools.GoogleSearchResults attribute)
num_return_sequences (langchain.llms.NLPCloud attribute)
numResults (langchain.llms.AI21 attribute)
O
object_ids (langchain.document_loaders.OneDriveLoader attribute)
observation_prefix (langchain.agents.Agent property)
(langchain.agents.ConversationalAgent property)
(langchain.agents.ConversationalChatAgent property)
(langchain.agents.StructuredChatAgent property)
(langchain.agents.ZeroShotAgent property)
ObsidianLoader (class in langchain.document_loaders)


ObsidianLoader (class in langchain.document_loaders)
OnlinePDFLoader (class in langchain.document_loaders)
openai_api_base (langchain.chat_models.AzureChatOpenAI attribute)
(langchain.chat_models.ChatOpenAI attribute)
openai_api_key (langchain.chains.OpenAIModerationChain attribute)
(langchain.chat_models.AzureChatOpenAI attribute)
(langchain.chat_models.ChatOpenAI attribute)
openai_api_type (langchain.chat_models.AzureChatOpenAI attribute)
openai_api_version (langchain.chat_models.AzureChatOpenAI attribute)
openai_organization (langchain.chains.OpenAIModerationChain attribute)
(langchain.chat_models.AzureChatOpenAI attribute)
(langchain.chat_models.ChatOpenAI attribute)
openai_proxy (langchain.chat_models.AzureChatOpenAI attribute)
(langchain.chat_models.ChatOpenAI attribute)
OpenSearchVectorSearch (class in langchain.vectorstores)
openweathermap_api_key (langchain.utilities.OpenWeatherMapAPIWrapper attribute)
operation_id (langchain.tools.APIOperation attribute)
other_score_keys (langchain.retrievers.TimeWeightedVectorStoreRetriever attribute)
OutlookMessageLoader (class in langchain.document_loaders)
output_key (langchain.chains.QAGenerationChain attribute)
(langchain.memory.ConversationStringBufferMemory attribute)
output_key_to_format (langchain.output_parsers.RegexDictParser attribute)
output_keys (langchain.chains.ConstitutionalChain property)
(langchain.chains.FlareChain property)
(langchain.chains.HypotheticalDocumentEmbedder property)
(langchain.chains.QAGenerationChain property)
(langchain.experimental.BabyAGI property)
(langchain.output_parsers.RegexParser attribute)
output_parser (langchain.agents.Agent attribute)
(langchain.agents.ConversationalAgent attribute)


(langchain.agents.ConversationalAgent attribute)
(langchain.agents.ConversationalChatAgent attribute)
(langchain.agents.LLMSingleActionAgent attribute)
(langchain.agents.StructuredChatAgent attribute)
(langchain.agents.ZeroShotAgent attribute)
(langchain.chains.FlareChain attribute)
(langchain.prompts.BasePromptTemplate attribute)
output_variables (langchain.chains.TransformChain attribute)
owm (langchain.utilities.OpenWeatherMapAPIWrapper attribute)
P
p (langchain.llms.Cohere attribute)
page_content_key (langchain.retrievers.RemoteLangChainRetriever attribute)
PagedPDFSplitter (in module langchain.document_loaders)
paginate_request() (langchain.document_loaders.ConfluenceLoader method)
param_mapping (langchain.chains.OpenAPIEndpointChain attribute)
params (langchain.serpapi.SerpAPIWrapper attribute)
(langchain.tools.ZapierNLARunAction attribute)
(langchain.utilities.searx_search.SearxSearchWrapper attribute)
(langchain.utilities.SearxSearchWrapper attribute)
(langchain.utilities.SerpAPIWrapper attribute)
params_schema (langchain.tools.ZapierNLARunAction attribute)
parse() (langchain.agents.AgentOutputParser method)
(langchain.output_parsers.CommaSeparatedListOutputParser method)
(langchain.output_parsers.GuardrailsOutputParser method)
(langchain.output_parsers.ListOutputParser method)
(langchain.output_parsers.OutputFixingParser method)
(langchain.output_parsers.PydanticOutputParser method)
(langchain.output_parsers.RegexDictParser method)
(langchain.output_parsers.RegexParser method)
(langchain.output_parsers.RetryOutputParser method)
(langchain.output_parsers.RetryWithErrorOutputParser method)
(langchain.output_parsers.StructuredOutputParser method)


(langchain.output_parsers.StructuredOutputParser method)
parse_filename() (langchain.document_loaders.BlackboardLoader method)
parse_obj() (langchain.tools.OpenAPISpec class method)
parse_sitemap() (langchain.document_loaders.SitemapLoader method)
parse_with_prompt() (langchain.output_parsers.RetryOutputParser method)
(langchain.output_parsers.RetryWithErrorOutputParser method)
parser (langchain.output_parsers.OutputFixingParser attribute)
(langchain.output_parsers.RetryOutputParser attribute)
(langchain.output_parsers.RetryWithErrorOutputParser attribute)
partial() (langchain.prompts.BasePromptTemplate method)
(langchain.prompts.ChatPromptTemplate method)
password (langchain.vectorstores.MyScaleSettings attribute)
patch() (langchain.utilities.TextRequestsWrapper method)
path (langchain.tools.APIOperation attribute)
path_params (langchain.tools.APIOperation property)
pause_to_reflect() (langchain.experimental.GenerativeAgentMemory method)
PDFMinerLoader (class in langchain.document_loaders)
PDFMinerPDFasHTMLLoader (class in langchain.document_loaders)
PDFPlumberLoader (class in langchain.document_loaders)
penalty_alpha_frequency (langchain.llms.RWKV attribute)
penalty_alpha_presence (langchain.llms.RWKV attribute)
penalty_bias (langchain.llms.AlephAlpha attribute)
penalty_exceptions (langchain.llms.AlephAlpha attribute)
penalty_exceptions_include_stop_sequences (langchain.llms.AlephAlpha attribute)
persist() (langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
Pinecone (class in langchain.vectorstores)
pipeline_key (langchain.llms.PipelineAI attribute)
pipeline_kwargs (langchain.llms.HuggingFacePipeline attribute)


pipeline_kwargs (langchain.llms.HuggingFacePipeline attribute)
(langchain.llms.PipelineAI attribute)
pl_tags (langchain.chat_models.PromptLayerChatOpenAI attribute)
plan() (langchain.agents.Agent method)
(langchain.agents.BaseMultiActionAgent method)
(langchain.agents.BaseSingleActionAgent method)
(langchain.agents.LLMSingleActionAgent method)
playwright_strict (langchain.tools.ClickTool attribute)
playwright_timeout (langchain.tools.ClickTool attribute)
PlaywrightURLLoader (class in langchain.document_loaders)
plugin (langchain.tools.AIPluginTool attribute)
port (langchain.vectorstores.MyScaleSettings attribute)
post() (langchain.utilities.TextRequestsWrapper method)
PostgresChatMessageHistory (class in langchain.memory)
powerbi (langchain.agents.agent_toolkits.PowerBIToolkit attribute)
(langchain.tools.InfoPowerBITool attribute)
(langchain.tools.ListPowerBITool attribute)
(langchain.tools.QueryPowerBITool attribute)
predict() (langchain.chains.LLMChain method)
(langchain.llms.AI21 method)
(langchain.llms.AlephAlpha method)
(langchain.llms.Anthropic method)
(langchain.llms.Anyscale method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.Banana method)
(langchain.llms.Beam method)
(langchain.llms.CerebriumAI method)
(langchain.llms.Cohere method)
(langchain.llms.CTransformers method)
(langchain.llms.Databricks method)
(langchain.llms.DeepInfra method)
(langchain.llms.FakeListLLM method)
(langchain.llms.ForefrontAI method)
(langchain.llms.GooglePalm method)
(langchain.llms.GooseAI method)


(langchain.llms.GooglePalm method)
(langchain.llms.GooseAI method)
(langchain.llms.GPT4All method)
(langchain.llms.HuggingFaceEndpoint method)
(langchain.llms.HuggingFaceHub method)
(langchain.llms.HuggingFacePipeline method)
(langchain.llms.HuggingFaceTextGenInference method)
(langchain.llms.HumanInputLLM method)
(langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.MosaicML method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenAIChat method)
(langchain.llms.OpenLM method)
(langchain.llms.Petals method)
(langchain.llms.PipelineAI method)
(langchain.llms.PredictionGuard method)
(langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(langchain.llms.RWKV method)
(langchain.llms.SagemakerEndpoint method)
(langchain.llms.SelfHostedHuggingFaceLLM method)
(langchain.llms.SelfHostedPipeline method)
(langchain.llms.StochasticAI method)
(langchain.llms.VertexAI method)
(langchain.llms.Writer method)
predict_and_parse() (langchain.chains.LLMChain method)
predict_messages() (langchain.llms.AI21 method)
(langchain.llms.AlephAlpha method)
(langchain.llms.Anthropic method)
(langchain.llms.Anyscale method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.Banana method)
(langchain.llms.Beam method)
(langchain.llms.CerebriumAI method)


(langchain.llms.Beam method)
(langchain.llms.CerebriumAI method)
(langchain.llms.Cohere method)
(langchain.llms.CTransformers method)
(langchain.llms.Databricks method)
(langchain.llms.DeepInfra method)
(langchain.llms.FakeListLLM method)
(langchain.llms.ForefrontAI method)
(langchain.llms.GooglePalm method)
(langchain.llms.GooseAI method)
(langchain.llms.GPT4All method)
(langchain.llms.HuggingFaceEndpoint method)
(langchain.llms.HuggingFaceHub method)
(langchain.llms.HuggingFacePipeline method)
(langchain.llms.HuggingFaceTextGenInference method)
(langchain.llms.HumanInputLLM method)
(langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.MosaicML method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenAIChat method)
(langchain.llms.OpenLM method)
(langchain.llms.Petals method)
(langchain.llms.PipelineAI method)
(langchain.llms.PredictionGuard method)
(langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(langchain.llms.RWKV method)
(langchain.llms.SagemakerEndpoint method)
(langchain.llms.SelfHostedHuggingFaceLLM method)
(langchain.llms.SelfHostedPipeline method)
(langchain.llms.StochasticAI method)
(langchain.llms.VertexAI method)
(langchain.llms.Writer method)
prefix (langchain.prompts.FewShotPromptTemplate attribute)


prefix (langchain.prompts.FewShotPromptTemplate attribute)
(langchain.prompts.FewShotPromptWithTemplates attribute)
prefix_messages (langchain.llms.OpenAIChat attribute)
(langchain.llms.PromptLayerOpenAIChat attribute)
prep_prompts() (langchain.chains.LLMChain method)
prep_streaming_params() (langchain.llms.AzureOpenAI method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenLM method)
(langchain.llms.PromptLayerOpenAI method)
prepare_cosmos() (langchain.memory.CosmosDBChatMessageHistory method)
presence_penalty (langchain.llms.AlephAlpha attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Cohere attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Writer attribute)
presencePenalty (langchain.llms.AI21 attribute)
prioritize_tasks() (langchain.experimental.BabyAGI method)
process (langchain.tools.ShellTool attribute)
process_attachment() (langchain.document_loaders.ConfluenceLoader method)
process_doc() (langchain.document_loaders.ConfluenceLoader method)
process_image() (langchain.document_loaders.ConfluenceLoader method)
process_index_results() (langchain.vectorstores.Annoy method)
process_output() (langchain.utilities.BashProcess method)
process_page() (langchain.document_loaders.ConfluenceLoader method)
process_pages() (langchain.document_loaders.ConfluenceLoader method)
process_pdf() (langchain.document_loaders.ConfluenceLoader method)
process_svg() (langchain.document_loaders.ConfluenceLoader method)
process_xls() (langchain.document_loaders.ConfluenceLoader method)
project (langchain.llms.VertexAI attribute)


project (langchain.llms.VertexAI attribute)
Prompt (in module langchain.prompts)
prompt (langchain.chains.ConversationChain attribute)
(langchain.chains.LLMBashChain attribute)
(langchain.chains.LLMChain attribute)
(langchain.chains.LLMMathChain attribute)
(langchain.chains.PALChain attribute)
(langchain.chains.SQLDatabaseChain attribute)
prompt_func (langchain.tools.HumanInputRun attribute)
properties (langchain.tools.APIOperation attribute)
prune() (langchain.memory.ConversationSummaryBufferMemory method)
PsychicLoader (class in langchain.document_loaders)
put() (langchain.utilities.TextRequestsWrapper method)
pydantic_object (langchain.output_parsers.PydanticOutputParser attribute)
PyMuPDFLoader (class in langchain.document_loaders)
PyPDFDirectoryLoader (class in langchain.document_loaders)
PyPDFium2Loader (class in langchain.document_loaders)
PyPDFLoader (class in langchain.document_loaders)
python_globals (langchain.chains.PALChain attribute)
python_locals (langchain.chains.PALChain attribute)
PythonCodeTextSplitter (class in langchain.text_splitter)
PythonLoader (class in langchain.document_loaders)
Q
qa_chain (langchain.chains.GraphCypherQAChain attribute)
(langchain.chains.GraphQAChain attribute)
Qdrant (class in langchain.vectorstores)
query_checker_prompt (langchain.chains.SQLDatabaseChain attribute)
query_instruction (langchain.embeddings.HuggingFaceInstructEmbeddings attribute)
(langchain.embeddings.MosaicMLInstructorEmbeddings attribute)
(langchain.embeddings.SelfHostedHuggingFaceInstructEmbeddings attribute)
query_name (langchain.vectorstores.SupabaseVectorStore attribute)


query_name (langchain.vectorstores.SupabaseVectorStore attribute)
query_params (langchain.tools.APIOperation property)
query_suffix (langchain.utilities.searx_search.SearxSearchWrapper attribute)
(langchain.utilities.SearxSearchWrapper attribute)
question_generator_chain (langchain.chains.FlareChain attribute)
question_to_checked_assertions_chain (langchain.chains.LLMCheckerChain attribute)
R
raw_completion (langchain.llms.AlephAlpha attribute)
REACT_DOCSTORE (langchain.agents.AgentType attribute)
ReadTheDocsLoader (class in langchain.document_loaders)
recall_ttl (langchain.memory.RedisEntityStore attribute)
recursive (langchain.document_loaders.GoogleDriveLoader attribute)
RecursiveCharacterTextSplitter (class in langchain.text_splitter)
RedditPostsLoader (class in langchain.document_loaders)
Redis (class in langchain.vectorstores)
redis_client (langchain.memory.RedisEntityStore attribute)
RedisChatMessageHistory (class in langchain.memory)
RedisEntityStore (class in langchain.memory)
reduce_k_below_max_tokens (langchain.chains.RetrievalQAWithSourcesChain attribute)
(langchain.chains.VectorDBQAWithSourcesChain attribute)
reflection_threshold (langchain.experimental.GenerativeAgentMemory attribute)
regex (langchain.output_parsers.RegexParser attribute)
regex_pattern (langchain.output_parsers.RegexDictParser attribute)
region (langchain.utilities.DuckDuckGoSearchAPIWrapper attribute)
region_name (langchain.embeddings.SagemakerEndpointEmbeddings attribute)
(langchain.llms.SagemakerEndpoint attribute)
relevancy_threshold (langchain.retrievers.KNNRetriever attribute)
(langchain.retrievers.SVMRetriever attribute)
remove_end_sequence (langchain.llms.NLPCloud attribute)


remove_end_sequence (langchain.llms.NLPCloud attribute)
remove_input (langchain.llms.NLPCloud attribute)
repeat_last_n (langchain.llms.GPT4All attribute)
repeat_penalty (langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
repetition_penalties_include_completion (langchain.llms.AlephAlpha attribute)
repetition_penalties_include_prompt (langchain.llms.AlephAlpha attribute)
repetition_penalty (langchain.llms.ForefrontAI attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.Writer attribute)
repo_id (langchain.embeddings.HuggingFaceHubEmbeddings attribute)
(langchain.llms.HuggingFaceHub attribute)
request_body (langchain.tools.APIOperation attribute)
request_timeout (langchain.chat_models.ChatOpenAI attribute)
(langchain.embeddings.OpenAIEmbeddings attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
request_url (langchain.utilities.PowerBIDataset property)
requests (langchain.chains.OpenAPIEndpointChain attribute)
(langchain.utilities.TextRequestsWrapper property)
requests_per_second (langchain.document_loaders.WebBaseLoader attribute)
requests_wrapper (langchain.agents.agent_toolkits.OpenAPIToolkit attribute)
(langchain.chains.APIChain attribute)
(langchain.chains.LLMRequestsChain attribute)
response_chain (langchain.chains.FlareChain attribute)
response_key (langchain.retrievers.RemoteLangChainRetriever attribute)
response_schemas (langchain.output_parsers.StructuredOutputParser attribute)
results() (langchain.serpapi.SerpAPIWrapper method)
(langchain.utilities.BingSearchAPIWrapper method)
(langchain.utilities.DuckDuckGoSearchAPIWrapper method)


(langchain.utilities.DuckDuckGoSearchAPIWrapper method)
(langchain.utilities.GoogleSearchAPIWrapper method)
(langchain.utilities.GoogleSerperAPIWrapper method)
(langchain.utilities.MetaphorSearchAPIWrapper method)
(langchain.utilities.searx_search.SearxSearchWrapper method)
(langchain.utilities.SearxSearchWrapper method)
(langchain.utilities.SerpAPIWrapper method)
results_async() (langchain.utilities.MetaphorSearchAPIWrapper method)
retriever (langchain.chains.ConversationalRetrievalChain attribute)
(langchain.chains.FlareChain attribute)
(langchain.chains.RetrievalQA attribute)
(langchain.chains.RetrievalQAWithSourcesChain attribute)
(langchain.memory.VectorStoreRetrieverMemory attribute)
retry_chain (langchain.output_parsers.OutputFixingParser attribute)
(langchain.output_parsers.RetryOutputParser attribute)
(langchain.output_parsers.RetryWithErrorOutputParser attribute)
retry_sleep (langchain.embeddings.MosaicMLInstructorEmbeddings attribute)
(langchain.llms.MosaicML attribute)
return_all (langchain.chains.SequentialChain attribute)
return_direct (langchain.chains.SQLDatabaseChain attribute)
(langchain.tools.BaseTool attribute)
(langchain.tools.Tool attribute)
return_docs (langchain.memory.VectorStoreRetrieverMemory attribute)
return_intermediate_steps (langchain.agents.AgentExecutor attribute)
(langchain.chains.ConstitutionalChain attribute)
(langchain.chains.OpenAPIEndpointChain attribute)
(langchain.chains.PALChain attribute)
(langchain.chains.SQLDatabaseChain attribute)
(langchain.chains.SQLDatabaseSequentialChain attribute)
return_pl_id (langchain.chat_models.PromptLayerChatOpenAI attribute)
return_stopped_response() (langchain.agents.Agent method)
(langchain.agents.BaseMultiActionAgent method)


(langchain.agents.BaseMultiActionAgent method)
(langchain.agents.BaseSingleActionAgent method)
return_urls (langchain.tools.SteamshipImageGenerationTool attribute)
return_values (langchain.agents.Agent property)
(langchain.agents.BaseMultiActionAgent property)
(langchain.agents.BaseSingleActionAgent property)
revised_answer_prompt (langchain.chains.LLMCheckerChain attribute)
revised_summary_prompt (langchain.chains.LLMSummarizationCheckerChain attribute)
revision_chain (langchain.chains.ConstitutionalChain attribute)
RoamLoader (class in langchain.document_loaders)
root_dir (langchain.agents.agent_toolkits.FileManagementToolkit attribute)
run() (langchain.python.PythonREPL method)
(langchain.serpapi.SerpAPIWrapper method)
(langchain.tools.BaseTool method)
(langchain.utilities.ArxivAPIWrapper method)
(langchain.utilities.BashProcess method)
(langchain.utilities.BingSearchAPIWrapper method)
(langchain.utilities.DuckDuckGoSearchAPIWrapper method)
(langchain.utilities.GooglePlacesAPIWrapper method)
(langchain.utilities.GoogleSearchAPIWrapper method)
(langchain.utilities.GoogleSerperAPIWrapper method)
(langchain.utilities.GraphQLAPIWrapper method)
(langchain.utilities.LambdaWrapper method)
(langchain.utilities.OpenWeatherMapAPIWrapper method)
(langchain.utilities.PowerBIDataset method)
(langchain.utilities.PythonREPL method)
(langchain.utilities.searx_search.SearxSearchWrapper method)
(langchain.utilities.SearxSearchWrapper method)
(langchain.utilities.SerpAPIWrapper method)
(langchain.utilities.SparkSQL method)
(langchain.utilities.TwilioAPIWrapper method)
(langchain.utilities.WikipediaAPIWrapper method)
(langchain.utilities.WolframAlphaAPIWrapper method)
run_creation() (langchain.llms.Beam method)


run_creation() (langchain.llms.Beam method)
run_no_throw() (langchain.utilities.SparkSQL method)
rwkv_verbose (langchain.llms.RWKV attribute)
S
S3DirectoryLoader (class in langchain.document_loaders)
S3FileLoader (class in langchain.document_loaders)
safesearch (langchain.utilities.DuckDuckGoSearchAPIWrapper attribute)
sample_rows_in_table_info (langchain.utilities.PowerBIDataset attribute)
save() (langchain.agents.AgentExecutor method)
(langchain.agents.BaseMultiActionAgent method)
(langchain.agents.BaseSingleActionAgent method)
(langchain.llms.AI21 method)
(langchain.llms.AlephAlpha method)
(langchain.llms.Anthropic method)
(langchain.llms.Anyscale method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.Banana method)
(langchain.llms.Beam method)
(langchain.llms.CerebriumAI method)
(langchain.llms.Cohere method)
(langchain.llms.CTransformers method)
(langchain.llms.Databricks method)
(langchain.llms.DeepInfra method)
(langchain.llms.FakeListLLM method)
(langchain.llms.ForefrontAI method)
(langchain.llms.GooglePalm method)
(langchain.llms.GooseAI method)
(langchain.llms.GPT4All method)
(langchain.llms.HuggingFaceEndpoint method)
(langchain.llms.HuggingFaceHub method)
(langchain.llms.HuggingFacePipeline method)
(langchain.llms.HuggingFaceTextGenInference method)
(langchain.llms.HumanInputLLM method)
(langchain.llms.LlamaCpp method)
(langchain.llms.Modal method)
(langchain.llms.MosaicML method)


(langchain.llms.Modal method)
(langchain.llms.MosaicML method)
(langchain.llms.NLPCloud method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenAIChat method)
(langchain.llms.OpenLM method)
(langchain.llms.Petals method)
(langchain.llms.PipelineAI method)
(langchain.llms.PredictionGuard method)
(langchain.llms.PromptLayerOpenAI method)
(langchain.llms.PromptLayerOpenAIChat method)
(langchain.llms.Replicate method)
(langchain.llms.RWKV method)
(langchain.llms.SagemakerEndpoint method)
(langchain.llms.SelfHostedHuggingFaceLLM method)
(langchain.llms.SelfHostedPipeline method)
(langchain.llms.StochasticAI method)
(langchain.llms.VertexAI method)
(langchain.llms.Writer method)
(langchain.prompts.BasePromptTemplate method)
(langchain.prompts.ChatPromptTemplate method)
save_agent() (langchain.agents.AgentExecutor method)
save_context() (langchain.experimental.GenerativeAgentMemory method)
(langchain.memory.CombinedMemory method)
(langchain.memory.ConversationEntityMemory method)
(langchain.memory.ConversationKGMemory method)
(langchain.memory.ConversationStringBufferMemory method)
(langchain.memory.ConversationSummaryBufferMemory method)
(langchain.memory.ConversationSummaryMemory method)
(langchain.memory.ConversationTokenBufferMemory method)
(langchain.memory.ReadOnlySharedMemory method)
(langchain.memory.SimpleMemory method)
(langchain.memory.VectorStoreRetrieverMemory method)
save_local() (langchain.vectorstores.Annoy method)
(langchain.vectorstores.FAISS method)
schemas (langchain.utilities.PowerBIDataset attribute)
scrape() (langchain.document_loaders.WebBaseLoader method)


scrape() (langchain.document_loaders.WebBaseLoader method)
scrape_all() (langchain.document_loaders.WebBaseLoader method)
scrape_page() (langchain.tools.ExtractHyperlinksTool static method)
search() (langchain.docstore.InMemoryDocstore method)
(langchain.docstore.Wikipedia method)
(langchain.vectorstores.VectorStore method)
search_kwargs (langchain.chains.ChatVectorDBChain attribute)
(langchain.chains.VectorDBQA attribute)
(langchain.chains.VectorDBQAWithSourcesChain attribute)
(langchain.retrievers.SelfQueryRetriever attribute)
(langchain.retrievers.TimeWeightedVectorStoreRetriever attribute)
search_type (langchain.chains.VectorDBQA attribute)
(langchain.retrievers.SelfQueryRetriever attribute)
searx_host (langchain.utilities.searx_search.SearxSearchWrapper attribute)
(langchain.utilities.SearxSearchWrapper attribute)
SearxResults (class in langchain.utilities.searx_search)
seed (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
select_examples() (langchain.prompts.example_selector.LengthBasedExampleSelector method)
(langchain.prompts.example_selector.MaxMarginalRelevanceExampleSelector method)
(langchain.prompts.example_selector.SemanticSimilarityExampleSelector method)
selected_tools (langchain.agents.agent_toolkits.FileManagementToolkit attribute)
SeleniumURLLoader (class in langchain.document_loaders)
SELF_ASK_WITH_SEARCH (langchain.agents.AgentType attribute)
send_pdf() (langchain.document_loaders.MathpixPDFLoader method)
SentenceTransformerEmbeddings (in module langchain.embeddings)
sequential_chain (langchain.chains.LLMSummarizationCheckerChain attribute)


sequential_chain (langchain.chains.LLMSummarizationCheckerChain attribute)
serpapi_api_key (langchain.serpapi.SerpAPIWrapper attribute)
(langchain.utilities.SerpAPIWrapper attribute)
serper_api_key (langchain.utilities.GoogleSerperAPIWrapper attribute)
service_account_key (langchain.document_loaders.GoogleDriveLoader attribute)
service_account_path (langchain.document_loaders.GoogleApiClient attribute)
service_name (langchain.retrievers.AzureCognitiveSearchRetriever attribute)
session_cache (langchain.tools.QueryPowerBITool attribute)
session_id (langchain.memory.RedisEntityStore attribute)
set() (langchain.memory.InMemoryEntityStore method)
(langchain.memory.RedisEntityStore method)
settings (langchain.document_loaders.OneDriveLoader attribute)
similarity_fn (langchain.document_transformers.EmbeddingsRedundantFilter attribute)
(langchain.retrievers.document_compressors.EmbeddingsFilter attribute)
similarity_search() (langchain.vectorstores.AnalyticDB method)
(langchain.vectorstores.Annoy method)
(langchain.vectorstores.AtlasDB method)
(langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
(langchain.vectorstores.ElasticVectorSearch method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.LanceDB method)
(langchain.vectorstores.Milvus method)
(langchain.vectorstores.MyScale method)
(langchain.vectorstores.OpenSearchVectorSearch method)
(langchain.vectorstores.Pinecone method)
(langchain.vectorstores.Qdrant method)
(langchain.vectorstores.Redis method)
(langchain.vectorstores.SupabaseVectorStore method)
(langchain.vectorstores.Tair method)
(langchain.vectorstores.Typesense method)
(langchain.vectorstores.Vectara method)
(langchain.vectorstores.VectorStore method)


(langchain.vectorstores.Vectara method)
(langchain.vectorstores.VectorStore method)
(langchain.vectorstores.Weaviate method)
similarity_search_by_index() (langchain.vectorstores.Annoy method)
similarity_search_by_text() (langchain.vectorstores.Weaviate method)
similarity_search_by_vector() (langchain.vectorstores.AnalyticDB method)
(langchain.vectorstores.Annoy method)
(langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.Milvus method)
(langchain.vectorstores.MyScale method)
(langchain.vectorstores.SupabaseVectorStore method)
(langchain.vectorstores.VectorStore method)
(langchain.vectorstores.Weaviate method)
similarity_search_by_vector_returning_embeddings() (langchain.vectorstores.SupabaseVectorStore method)
similarity_search_by_vector_with_relevance_scores() (langchain.vectorstores.SupabaseVectorStore method)
similarity_search_limit_score() (langchain.vectorstores.Redis method)
similarity_search_with_relevance_scores() (langchain.vectorstores.MyScale method)
(langchain.vectorstores.SupabaseVectorStore method)
(langchain.vectorstores.VectorStore method)
similarity_search_with_score() (langchain.vectorstores.AnalyticDB method)
(langchain.vectorstores.Annoy method)
(langchain.vectorstores.Chroma method)
(langchain.vectorstores.DeepLake method)
(langchain.vectorstores.ElasticVectorSearch method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.Milvus method)
(langchain.vectorstores.OpenSearchVectorSearch method)
(langchain.vectorstores.Pinecone method)
(langchain.vectorstores.Qdrant method)
(langchain.vectorstores.Redis method)
(langchain.vectorstores.Typesense method)


(langchain.vectorstores.Redis method)
(langchain.vectorstores.Typesense method)
(langchain.vectorstores.Vectara method)
(langchain.vectorstores.Weaviate method)
similarity_search_with_score_by_index() (langchain.vectorstores.Annoy method)
similarity_search_with_score_by_vector() (langchain.vectorstores.AnalyticDB method)
(langchain.vectorstores.Annoy method)
(langchain.vectorstores.FAISS method)
(langchain.vectorstores.Milvus method)
similarity_threshold (langchain.document_transformers.EmbeddingsRedundantFilter attribute)
(langchain.retrievers.document_compressors.EmbeddingsFilter attribute)
SitemapLoader (class in langchain.document_loaders)
siterestrict (langchain.utilities.GoogleSearchAPIWrapper attribute)
size (langchain.tools.SteamshipImageGenerationTool attribute)
SlackDirectoryLoader (class in langchain.document_loaders)
SpacyTextSplitter (class in langchain.text_splitter)
SparkSQL (class in langchain.utilities)
sparse_encoder (langchain.retrievers.PineconeHybridSearchRetriever attribute)
spec (langchain.agents.agent_toolkits.JsonToolkit attribute)
split_documents() (langchain.text_splitter.TextSplitter method)
split_text() (langchain.text_splitter.CharacterTextSplitter method)
(langchain.text_splitter.NLTKTextSplitter method)
(langchain.text_splitter.RecursiveCharacterTextSplitter method)
(langchain.text_splitter.SpacyTextSplitter method)
(langchain.text_splitter.TextSplitter method)
(langchain.text_splitter.TokenTextSplitter method)
SpreedlyLoader (class in langchain.document_loaders)
sql_chain (langchain.chains.SQLDatabaseSequentialChain attribute)
SRTLoader (class in langchain.document_loaders)


SRTLoader (class in langchain.document_loaders)
start_with_retrieval (langchain.chains.FlareChain attribute)
status (langchain.experimental.GenerativeAgent attribute)
steamship (langchain.tools.SteamshipImageGenerationTool attribute)
stop (langchain.agents.LLMSingleActionAgent attribute)
(langchain.chains.PALChain attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.Writer attribute)
stop_sequences (langchain.llms.AlephAlpha attribute)
store (langchain.memory.InMemoryEntityStore attribute)
strategy (langchain.llms.RWKV attribute)
stream() (langchain.llms.Anthropic method)
(langchain.llms.AzureOpenAI method)
(langchain.llms.LlamaCpp method)
(langchain.llms.OpenAI method)
(langchain.llms.OpenLM method)
(langchain.llms.PromptLayerOpenAI method)
streaming (langchain.chat_models.ChatOpenAI attribute)
(langchain.llms.Anthropic attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenAIChat attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.PromptLayerOpenAIChat attribute)
strip_outputs (langchain.chains.SimpleSequentialChain attribute)
StripeLoader (class in langchain.document_loaders)
STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION (langchain.agents.AgentType attribute)
structured_query_translator (langchain.retrievers.SelfQueryRetriever attribute)
suffix (langchain.llms.LlamaCpp attribute)
(langchain.prompts.FewShotPromptTemplate attribute)


(langchain.prompts.FewShotPromptTemplate attribute)
(langchain.prompts.FewShotPromptWithTemplates attribute)
summarize_related_memories() (langchain.experimental.GenerativeAgent method)
summary (langchain.experimental.GenerativeAgent attribute)
summary_message_cls (langchain.memory.ConversationKGMemory attribute)
summary_refresh_seconds (langchain.experimental.GenerativeAgent attribute)
SupabaseVectorStore (class in langchain.vectorstores)
sync_browser (langchain.agents.agent_toolkits.PlayWrightBrowserToolkit attribute)
T
table (langchain.vectorstores.MyScaleSettings attribute)
table_info (langchain.utilities.PowerBIDataset property)
table_name (langchain.vectorstores.SupabaseVectorStore attribute)
table_names (langchain.utilities.PowerBIDataset attribute)
Tair (class in langchain.vectorstores)
task (langchain.embeddings.HuggingFaceHubEmbeddings attribute)
(langchain.llms.HuggingFaceEndpoint attribute)
(langchain.llms.HuggingFaceHub attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
tbs (langchain.utilities.GoogleSerperAPIWrapper attribute)
TelegramChatApiLoader (class in langchain.document_loaders)
TelegramChatFileLoader (class in langchain.document_loaders)
TelegramChatLoader (in module langchain.document_loaders)
temp (langchain.llms.GPT4All attribute)
temperature (langchain.chat_models.ChatGooglePalm attribute)
(langchain.chat_models.ChatOpenAI attribute)
(langchain.llms.AI21 attribute)
(langchain.llms.AlephAlpha attribute)
(langchain.llms.Anthropic attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Cohere attribute)
(langchain.llms.ForefrontAI attribute)
(langchain.llms.GooglePalm attribute)


(langchain.llms.ForefrontAI attribute)
(langchain.llms.GooglePalm attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Petals attribute)
(langchain.llms.PredictionGuard attribute)
(langchain.llms.RWKV attribute)
(langchain.llms.VertexAI attribute)
(langchain.llms.Writer attribute)
template (langchain.prompts.PromptTemplate attribute)
(langchain.tools.QueryPowerBITool attribute)
template_format (langchain.prompts.FewShotPromptTemplate attribute)
(langchain.prompts.FewShotPromptWithTemplates attribute)
(langchain.prompts.PromptTemplate attribute)
template_tool_response (langchain.agents.ConversationalChatAgent attribute)
text_length (langchain.chains.LLMRequestsChain attribute)
text_splitter (langchain.chains.AnalyzeDocumentChain attribute)
(langchain.chains.MapReduceChain attribute)
(langchain.chains.QAGenerationChain attribute)
TextLoader (class in langchain.document_loaders)
texts (langchain.retrievers.KNNRetriever attribute)
(langchain.retrievers.SVMRetriever attribute)
TextSplitter (class in langchain.text_splitter)
tfidf_array (langchain.retrievers.TFIDFRetriever attribute)
time (langchain.utilities.DuckDuckGoSearchAPIWrapper attribute)
to_typescript() (langchain.tools.APIOperation method)
token (langchain.utilities.PowerBIDataset attribute)
token_path (langchain.document_loaders.GoogleApiClient attribute)
(langchain.document_loaders.GoogleDriveLoader attribute)
tokenizer (langchain.llms.Petals attribute)


tokenizer (langchain.llms.Petals attribute)
tokens (langchain.llms.AlephAlpha attribute)
tokens_path (langchain.llms.RWKV attribute)
TokenTextSplitter (class in langchain.text_splitter)
ToMarkdownLoader (class in langchain.document_loaders)
TomlLoader (class in langchain.document_loaders)
tool() (in module langchain.agents)
(in module langchain.tools)
tool_run_logging_kwargs() (langchain.agents.Agent method)
(langchain.agents.BaseMultiActionAgent method)
(langchain.agents.BaseSingleActionAgent method)
(langchain.agents.LLMSingleActionAgent method)
tools (langchain.agents.agent_toolkits.JiraToolkit attribute)
(langchain.agents.agent_toolkits.ZapierToolkit attribute)
(langchain.agents.AgentExecutor attribute)
top_k (langchain.chains.SQLDatabaseChain attribute)
(langchain.chat_models.ChatGooglePalm attribute)
(langchain.llms.AlephAlpha attribute)
(langchain.llms.Anthropic attribute)
(langchain.llms.ForefrontAI attribute)
(langchain.llms.GooglePalm attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.Petals attribute)
(langchain.llms.VertexAI attribute)
(langchain.retrievers.ChatGPTPluginRetriever attribute)
(langchain.retrievers.DataberryRetriever attribute)
(langchain.retrievers.PineconeHybridSearchRetriever attribute)
top_k_docs_for_context (langchain.chains.ChatVectorDBChain attribute)
top_k_results (langchain.utilities.ArxivAPIWrapper attribute)
(langchain.utilities.GooglePlacesAPIWrapper attribute)
(langchain.utilities.WikipediaAPIWrapper attribute)


(langchain.utilities.GooglePlacesAPIWrapper attribute)
(langchain.utilities.WikipediaAPIWrapper attribute)
top_n (langchain.retrievers.document_compressors.CohereRerank attribute)
top_p (langchain.chat_models.ChatGooglePalm attribute)
(langchain.llms.AlephAlpha attribute)
(langchain.llms.Anthropic attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.ForefrontAI attribute)
(langchain.llms.GooglePalm attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Petals attribute)
(langchain.llms.RWKV attribute)
(langchain.llms.VertexAI attribute)
(langchain.llms.Writer attribute)
topP (langchain.llms.AI21 attribute)
traits (langchain.experimental.GenerativeAgent attribute)
transform (langchain.chains.TransformChain attribute)
transform_documents() (langchain.document_transformers.EmbeddingsRedundantFilter method)
(langchain.text_splitter.TextSplitter method)
transform_input_fn (langchain.llms.Databricks attribute)
transform_output_fn (langchain.llms.Databricks attribute)
transformers (langchain.retrievers.document_compressors.DocumentCompressorPipeline attribute)
truncate (langchain.embeddings.CohereEmbeddings attribute)
(langchain.llms.Cohere attribute)
ts_type_from_python() (langchain.tools.APIOperation static method)
ttl (langchain.memory.RedisEntityStore attribute)
tuned_model_name (langchain.llms.VertexAI attribute)
TwitterTweetLoader (class in langchain.document_loaders)
type (langchain.utilities.GoogleSerperAPIWrapper attribute)


type (langchain.utilities.GoogleSerperAPIWrapper attribute)
Typesense (class in langchain.vectorstores)
U
unsecure (langchain.utilities.searx_search.SearxSearchWrapper attribute)
(langchain.utilities.SearxSearchWrapper attribute)
UnstructuredAPIFileIOLoader (class in langchain.document_loaders)
UnstructuredAPIFileLoader (class in langchain.document_loaders)
UnstructuredEmailLoader (class in langchain.document_loaders)
UnstructuredEPubLoader (class in langchain.document_loaders)
UnstructuredFileIOLoader (class in langchain.document_loaders)
UnstructuredFileLoader (class in langchain.document_loaders)
UnstructuredHTMLLoader (class in langchain.document_loaders)
UnstructuredImageLoader (class in langchain.document_loaders)
UnstructuredMarkdownLoader (class in langchain.document_loaders)
UnstructuredODTLoader (class in langchain.document_loaders)
UnstructuredPDFLoader (class in langchain.document_loaders)
UnstructuredPowerPointLoader (class in langchain.document_loaders)
UnstructuredRTFLoader (class in langchain.document_loaders)
UnstructuredURLLoader (class in langchain.document_loaders)
UnstructuredWordDocumentLoader (class in langchain.document_loaders)
update_document() (langchain.vectorstores.Chroma method)
update_forward_refs() (langchain.llms.AI21 class method)
(langchain.llms.AlephAlpha class method)
(langchain.llms.Anthropic class method)
(langchain.llms.Anyscale class method)
(langchain.llms.AzureOpenAI class method)
(langchain.llms.Banana class method)
(langchain.llms.Beam class method)
(langchain.llms.CerebriumAI class method)
(langchain.llms.Cohere class method)


(langchain.llms.Cohere class method)
(langchain.llms.CTransformers class method)
(langchain.llms.Databricks class method)
(langchain.llms.DeepInfra class method)
(langchain.llms.FakeListLLM class method)
(langchain.llms.ForefrontAI class method)
(langchain.llms.GooglePalm class method)
(langchain.llms.GooseAI class method)
(langchain.llms.GPT4All class method)
(langchain.llms.HuggingFaceEndpoint class method)
(langchain.llms.HuggingFaceHub class method)
(langchain.llms.HuggingFacePipeline class method)
(langchain.llms.HuggingFaceTextGenInference class method)
(langchain.llms.HumanInputLLM class method)
(langchain.llms.LlamaCpp class method)
(langchain.llms.Modal class method)
(langchain.llms.MosaicML class method)
(langchain.llms.NLPCloud class method)
(langchain.llms.OpenAI class method)
(langchain.llms.OpenAIChat class method)
(langchain.llms.OpenLM class method)
(langchain.llms.Petals class method)
(langchain.llms.PipelineAI class method)
(langchain.llms.PredictionGuard class method)
(langchain.llms.PromptLayerOpenAI class method)
(langchain.llms.PromptLayerOpenAIChat class method)
(langchain.llms.Replicate class method)
(langchain.llms.RWKV class method)
(langchain.llms.SagemakerEndpoint class method)
(langchain.llms.SelfHostedHuggingFaceLLM class method)
(langchain.llms.SelfHostedPipeline class method)
(langchain.llms.StochasticAI class method)
(langchain.llms.VertexAI class method)
(langchain.llms.Writer class method)


(langchain.llms.VertexAI class method)
(langchain.llms.Writer class method)
upsert_messages() (langchain.memory.CosmosDBChatMessageHistory method)
url (langchain.document_loaders.MathpixPDFLoader property)
(langchain.llms.Beam attribute)
(langchain.retrievers.ChatGPTPluginRetriever attribute)
(langchain.retrievers.RemoteLangChainRetriever attribute)
(langchain.tools.IFTTTWebhook attribute)
urls (langchain.document_loaders.PlaywrightURLLoader attribute)
(langchain.document_loaders.SeleniumURLLoader attribute)
use_mlock (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
use_mmap (langchain.llms.LlamaCpp attribute)
use_multiplicative_presence_penalty (langchain.llms.AlephAlpha attribute)
use_query_checker (langchain.chains.SQLDatabaseChain attribute)
username (langchain.vectorstores.MyScaleSettings attribute)
V
validate_channel_or_videoIds_is_set() (langchain.document_loaders.GoogleApiClient class method)
(langchain.document_loaders.GoogleApiYoutubeLoader class method)
validate_init_args() (langchain.document_loaders.ConfluenceLoader static method)
validate_template (langchain.prompts.FewShotPromptTemplate attribute)
(langchain.prompts.FewShotPromptWithTemplates attribute)
(langchain.prompts.PromptTemplate attribute)
Vectara (class in langchain.vectorstores)
vectorizer (langchain.retrievers.TFIDFRetriever attribute)
VectorStore (class in langchain.vectorstores)
vectorstore (langchain.agents.agent_toolkits.VectorStoreInfo attribute)
(langchain.chains.ChatVectorDBChain attribute)
(langchain.chains.VectorDBQA attribute)
(langchain.chains.VectorDBQAWithSourcesChain attribute)


(langchain.chains.VectorDBQAWithSourcesChain attribute)
(langchain.prompts.example_selector.SemanticSimilarityExampleSelector attribute)
(langchain.retrievers.SelfQueryRetriever attribute)
(langchain.retrievers.TimeWeightedVectorStoreRetriever attribute)
vectorstore_info (langchain.agents.agent_toolkits.VectorStoreToolkit attribute)
vectorstores (langchain.agents.agent_toolkits.VectorStoreRouterToolkit attribute)
verbose (langchain.llms.AI21 attribute)
(langchain.llms.AlephAlpha attribute)
(langchain.llms.Anthropic attribute)
(langchain.llms.Anyscale attribute)
(langchain.llms.AzureOpenAI attribute)
(langchain.llms.Banana attribute)
(langchain.llms.Beam attribute)
(langchain.llms.CerebriumAI attribute)
(langchain.llms.Cohere attribute)
(langchain.llms.CTransformers attribute)
(langchain.llms.Databricks attribute)
(langchain.llms.DeepInfra attribute)
(langchain.llms.FakeListLLM attribute)
(langchain.llms.ForefrontAI attribute)
(langchain.llms.GooglePalm attribute)
(langchain.llms.GooseAI attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.HuggingFaceEndpoint attribute)
(langchain.llms.HuggingFaceHub attribute)
(langchain.llms.HuggingFacePipeline attribute)
(langchain.llms.HuggingFaceTextGenInference attribute)
(langchain.llms.HumanInputLLM attribute)
(langchain.llms.LlamaCpp attribute)
(langchain.llms.Modal attribute)
(langchain.llms.MosaicML attribute)
(langchain.llms.NLPCloud attribute)
(langchain.llms.OpenAI attribute)
(langchain.llms.OpenAIChat attribute)
(langchain.llms.OpenLM attribute)


(langchain.llms.OpenAIChat attribute)
(langchain.llms.OpenLM attribute)
(langchain.llms.Petals attribute)
(langchain.llms.PipelineAI attribute)
(langchain.llms.PredictionGuard attribute)
(langchain.llms.Replicate attribute)
(langchain.llms.RWKV attribute)
(langchain.llms.SagemakerEndpoint attribute)
(langchain.llms.SelfHostedHuggingFaceLLM attribute)
(langchain.llms.SelfHostedPipeline attribute)
(langchain.llms.StochasticAI attribute)
(langchain.llms.VertexAI attribute)
(langchain.llms.Writer attribute)
(langchain.retrievers.SelfQueryRetriever attribute)
(langchain.tools.BaseTool attribute)
(langchain.tools.Tool attribute)
VespaRetriever (class in langchain.retrievers)
video_ids (langchain.document_loaders.GoogleApiYoutubeLoader attribute)
visible_only (langchain.tools.ClickTool attribute)
vocab_only (langchain.embeddings.LlamaCppEmbeddings attribute)
(langchain.llms.GPT4All attribute)
(langchain.llms.LlamaCpp attribute)
W
wait_for_processing() (langchain.document_loaders.MathpixPDFLoader method)
WeatherDataLoader (class in langchain.document_loaders)
Weaviate (class in langchain.vectorstores)
WeaviateHybridSearchRetriever (class in langchain.retrievers)
WeaviateHybridSearchRetriever.Config (class in langchain.retrievers)
web_path (langchain.document_loaders.WebBaseLoader property)
web_paths (langchain.document_loaders.WebBaseLoader attribute)
WebBaseLoader (class in langchain.document_loaders)
WhatsAppChatLoader (class in langchain.document_loaders)
Wikipedia (class in langchain.docstore)


Wikipedia (class in langchain.docstore)
WikipediaLoader (class in langchain.document_loaders)
wolfram_alpha_appid (langchain.utilities.WolframAlphaAPIWrapper attribute)
writer_api_key (langchain.llms.Writer attribute)
writer_org_id (langchain.llms.Writer attribute)
Y
YoutubeLoader (class in langchain.document_loaders)
Z
zapier_description (langchain.tools.ZapierNLARunAction attribute)
ZepRetriever (class in langchain.retrievers)
ZERO_SHOT_REACT_DESCRIPTION (langchain.agents.AgentType attribute)
Zilliz (class in langchain.vectorstores)
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


Search
Error
Please activate JavaScript to enable the search functionality.
Ctrl+K
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
API References
API References#
Full documentation on all methods, classes, and APIs in LangChain.
Models
Prompts
Indexes
Memory
Chains
Agents
Utilities
Experimental Modules
previous
Installation
next
Models
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Integrations
 Contents
Integrations by Module
All Integrations
Integrations#
LangChain integrates with many LLMs, systems, and products.
Integrations by Module#
Integrations grouped by the core LangChain module they map to:
LLM Providers
Chat Model Providers
Text Embedding Model Providers
Document Loader Integrations
Text Splitter Integrations
Vectorstore Providers
Retriever Providers
Tool Providers
Toolkit Integrations
All Integrations#
A comprehensive list of LLMs, systems, and products integrated with LangChain:
AI21 Labs
Aim
AnalyticDB
Anyscale
Apify
AtlasDB
Banana
Beam
CerebriumAI
Chroma
ClearML Integration
Cohere
Comet
C Transformers
Databerry
Databricks
DeepInfra
Deep Lake
Docugami
Advantages vs Other Chunking Techniques
ForefrontAI
Google Search
Google Serper
GooseAI
GPT4All
Graphsignal
Hazy Research
Helicone
Hugging Face
Jina
LanceDB
Llama.cpp
Metal
Milvus
MLflow
Modal
Momento
MyScale
NLPCloud
OpenAI
OpenSearch
OpenWeatherMap API
Petals
PGVector
Pinecone
PipelineAI
Prediction Guard
PromptLayer
Psychic
Advantages vs Other Document Loaders
Qdrant
Rebuff: Prompt Injection Detection with LangChain
Redis
Replicate
Runhouse
RWKV-4
SearxNG Search API
SerpAPI
StochasticAI
Tair
Unstructured
Vectara
Weights & Biases
Weaviate
WhyLabs Integration
Wolfram Alpha Wrapper
Writer
Yeager.ai
Zilliz
previous
Experimental Modules
next


Writer
Yeager.ai
Zilliz
previous
Experimental Modules
next
AI21 Labs
 Contents

Integrations by Module
All Integrations
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Prompts
 Contents
Getting Started
Go Deeper
Prompts#
Note
Conceptual Guide
The new way of programming models is through prompts.
A “prompt” refers to the input to the model.
This input is rarely hard coded, but rather is often constructed from multiple components.
A PromptTemplate is responsible for the construction of this input.
LangChain provides several classes and functions to make constructing and working with prompts easy.
This section of documentation is split into four sections:
LLM Prompt Templates
How to use PromptTemplates to prompt Language Models.
Chat Prompt Templates
How to use PromptTemplates to prompt Chat Models.
Example Selectors
Often times it is useful to include examples in prompts.
These examples can be hardcoded, but it is often more powerful if they are dynamically selected.
This section goes over example selection.
Output Parsers
Language models (and Chat Models) output text.
But many times you may want to get more structured information than just text back.
This is where output parsers come in.
Output Parsers are responsible for (1) instructing the model how output should be formatted,
(2) parsing output into the desired formatting (including retrying if necessary).
Getting Started#
Getting Started
Go Deeper#
Prompt Templates
Chat Prompt Template
Example Selectors
Output Parsers
previous
TensorflowHub
next
Getting Started
 Contents

Getting Started
Go Deeper
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Models
 Contents
Getting Started
Go Deeper
Models#
Note
Conceptual Guide
This section of the documentation deals with different types of models that are used in LangChain.
On this page we will go over the model types at a high level,
but we have individual pages for each model type.
The pages contain more detailed “how-to” guides for working with that model,
as well as a list of different model providers.
LLMs
Large Language Models (LLMs) are the first type of models we cover.
These models take a text string as input, and return a text string as output.
Chat Models
Chat Models are the second type of models we cover.
These models are usually backed by a language model, but their APIs are more structured.
Specifically, these models take a list of Chat Messages as input, and return a Chat Message.
Text Embedding Models
The third type of models we cover are text embedding models.
These models take text as input and return a list of floats.
Getting Started#
Getting Started
Go Deeper#
LLMs
Chat Models
Text Embedding Models
previous
Tutorials
next
Getting Started
 Contents

Getting Started
Go Deeper
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Memory
Memory#
Note
Conceptual Guide
By default, Chains and Agents are stateless,
meaning that they treat each incoming query independently (as are the underlying LLMs and chat models).
In some applications (chatbots being a GREAT example) it is highly important
to remember previous interactions, both at a short term but also at a long term level.
The concept of “Memory” exists to do exactly that.
LangChain provides memory components in two forms.
First, LangChain provides helper utilities for managing and manipulating previous chat messages.
These are designed to be modular and useful regardless of how they are used.
Secondly, LangChain provides easy ways to incorporate these utilities into chains.
The following sections of documentation are provided:
Getting Started: An overview of how to get started with different types of memory.
How-To Guides: A collection of how-to guides. These highlight different types of memory, as well as how to use memory in chains.
Memory
Getting Started
How-To Guides
previous
Structured Output Parser
next
Getting Started
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Chains
Chains#
Note
Conceptual Guide
Using an LLM in isolation is fine for some simple applications,
but many more complex ones require chaining LLMs - either with each other or with other experts.
LangChain provides a standard interface for Chains, as well as some common implementations of chains for ease of use.
The following sections of documentation are provided:
Getting Started: A getting started guide for chains, to get you up and running quickly.
How-To Guides: A collection of how-to guides. These highlight how to use various types of chains.
Reference: API reference documentation for all Chain classes.
previous
Zep Memory
next
Getting Started
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Agents
 Contents
Action Agents
Plan-and-Execute Agents
Agents#
Note
Conceptual Guide
Some applications will require not just a predetermined chain of calls to LLMs/other tools,
but potentially an unknown chain that depends on the user’s input.
In these types of chains, there is a “agent” which has access to a suite of tools.
Depending on the user input, the agent can then decide which, if any, of these tools to call.
At the moment, there are two main types of agents:
“Action Agents”: these agents decide an action to take and take that action one step at a time
“Plan-and-Execute Agents”: these agents first decide a plan of actions to take, and then execute those actions one at a time.
When should you use each one? Action Agents are more conventional, and good for small tasks.
For more complex or long running tasks, the initial planning step helps to maintain long term objectives and focus. However, that comes at the expense of generally more calls and higher latency.
These two agents are also not mutually exclusive - in fact, it is often best to have an Action Agent be in charge of the execution for the Plan and Execute agent.
Action Agents#
High level pseudocode of agents looks something like:
Some user input is received
The agent decides which tool - if any - to use, and what the input to that tool should be
That tool is then called with that tool input, and an observation is recorded (this is just the output of calling that tool with that tool input)
That history of tool, tool input, and observation is passed back into the agent, and it decides what step to take next
This is repeated until the agent decides it no longer needs to use a tool, and then it responds directly to the user.
The different abstractions involved in agents are as follows:


The different abstractions involved in agents are as follows:
Agent: this is where the logic of the application lives. Agents expose an interface that takes in user input along with a list of previous steps the agent has taken, and returns either an AgentAction or AgentFinish
AgentAction corresponds to the tool to use and the input to that tool
AgentFinish means the agent is done, and has information around what to return to the user
Tools: these are the actions an agent can take. What tools you give an agent highly depend on what you want the agent to do
Toolkits: these are groups of tools designed for a specific use case. For example, in order for an agent to interact with a SQL database in the best way it may need access to one tool to execute queries and another tool to inspect tables.
Agent Executor: this wraps an agent and a list of tools. This is responsible for the loop of running the agent iteratively until the stopping criteria is met.
The most important abstraction of the four above to understand is that of the agent.
Although an agent can be defined in whatever way one chooses, the typical way to construct an agent is with:
PromptTemplate: this is responsible for taking the user input and previous steps and constructing a prompt to send to the language model
Language Model: this takes the prompt constructed by the PromptTemplate and returns some output
Output Parser: this takes the output of the Language Model and parses it into an AgentAction or AgentFinish object.
In this section of documentation, we first start with a Getting Started notebook to cover how to use all things related to agents in an end-to-end manner.
We then split the documentation into the following sections:
Tools
In this section we cover the different types of tools LangChain supports natively.
We then cover how to add your own tools.
Agents
In this section we cover the different types of agents LangChain supports natively.


Agents
In this section we cover the different types of agents LangChain supports natively.
We then cover how to modify and create your own agents.
Toolkits
In this section we go over the various toolkits that LangChain supports out of the box,
and how to create an agent from them.
Agent Executor
In this section we go over the Agent Executor class, which is responsible for calling
the agent and tools in a loop. We go over different ways to customize this, and options you
can use for more control.
Go Deeper
Tools
Agents
Toolkits
Agent Executors
Plan-and-Execute Agents#
High level pseudocode of agents looks something like:
Some user input is received
The planner lists out the steps to take
The executor goes through the list of steps, executing them
The most typical implementation is to have the planner be a language model,
and the executor be an action agent.
Go Deeper
Plan and Execute
Imports
Tools
Planner, Executor, and Agent
Run Example
previous
Chains
next
Getting Started
 Contents

Action Agents
Plan-and-Execute Agents
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.rst
.pdf
Indexes
 Contents
Go Deeper
Indexes#
Note
Conceptual Guide
Indexes refer to ways to structure documents so that LLMs can best interact with them.
This module contains utility functions for working with documents, different types of indexes, and then examples for using those indexes in chains.
The most common way that indexes are used in chains is in a “retrieval” step.
This step refers to taking a user’s query and returning the most relevant documents.
We draw this distinction because (1) an index can be used for other things besides retrieval, and (2) retrieval can use other logic besides an index to find relevant documents.
We therefore have a concept of a “Retriever” interface - this is the interface that most chains work with.
Most of the time when we talk about indexes and retrieval we are talking about indexing and retrieving unstructured data (like text documents).
For interacting with structured data (SQL tables, etc) or APIs, please see the corresponding use case sections for links to relevant functionality.
The primary index and retrieval types supported by LangChain are currently centered around vector databases, and therefore
a lot of the functionality we dive deep on those topics.
For an overview of everything related to this, please see the below notebook for getting started:
Getting Started
We then provide a deep dive on the four main components.
Document Loaders
How to load documents from a variety of sources.
Text Splitters
An overview of the abstractions and implementions around splitting text.
VectorStores
An overview of VectorStores and the many integrations LangChain provides.
Retrievers
An overview of Retrievers and the implementations LangChain provides.
Go Deeper#
Document Loaders
Text Splitters
Vectorstores
Retrievers
previous
Zep Memory
next
Getting Started
 Contents

Go Deeper


previous
Zep Memory
next
Getting Started
 Contents

Go Deeper
By Harrison Chase

      © Copyright 2023, Harrison Chase.

  Last updated on May 28, 2023.


.ipynb
.pdf
Callbacks
 Contents
Callbacks
How to use callbacks
When do you want to use each of these?
Using an existing handler
Creating a custom handler
Async Callbacks
Using multiple handlers, passing in handlers
Tracing and Token Counting
Tracing
Token Counting
Callbacks#
LangChain provides a callbacks system that allows you to hook into the various stages of your LLM application. This is useful for logging, monitoring, streaming, and other tasks.
You can subscribe to these events by using the callbacks argument available throughout the API. This argument is list of handler objects, which are expected to implement one or more of the methods described below in more detail. There are two main callbacks mechanisms:
Constructor callbacks will be used for all calls made on that object, and will be scoped to that object only, i.e. if you pass a handler to the LLMChain constructor, it will not be used by the model attached to that chain.
Request callbacks will be used for that specific request only, and all sub-requests that it contains (eg. a call to an LLMChain triggers a call to a Model, which uses the same handler passed through). These are explicitly passed through.
Advanced: When you create a custom chain you can easily set it up to use the same callback system as all the built-in chains.
_call, _generate, _run, and equivalent async methods on Chains / LLMs / Chat Models / Agents / Tools now receive a 2nd argument called run_manager which is bound to that run, and contains the logging methods that can be used by that object (i.e. on_llm_new_token). This is useful when constructing a custom chain. See this guide for more information on how to create custom chains and use callbacks inside them.


CallbackHandlers are objects that implement the CallbackHandler interface, which has a method for each event that can be subscribed to. The CallbackManager will call the appropriate method on each handler when the event is triggered.
class BaseCallbackHandler:
    """Base callback handler that can be used to handle callbacks from langchain."""
    def on_llm_start(
        self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
    ) -> Any:
        """Run when LLM starts running."""
    def on_llm_new_token(self, token: str, **kwargs: Any) -> Any:
        """Run on new LLM token. Only available when streaming is enabled."""
    def on_llm_end(self, response: LLMResult, **kwargs: Any) -> Any:
        """Run when LLM ends running."""
    def on_llm_error(
        self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any
    ) -> Any:
        """Run when LLM errors."""
    def on_chain_start(
        self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any
    ) -> Any:
        """Run when chain starts running."""
    def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> Any:
        """Run when chain ends running."""
    def on_chain_error(
        self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any
    ) -> Any:
        """Run when chain errors."""
    def on_tool_start(
        self, serialized: Dict[str, Any], input_str: str, **kwargs: Any
    ) -> Any:
        """Run when tool starts running."""
    def on_tool_end(self, output: str, **kwargs: Any) -> Any:


def on_tool_end(self, output: str, **kwargs: Any) -> Any:
        """Run when tool ends running."""
    def on_tool_error(
        self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any
    ) -> Any:
        """Run when tool errors."""
    def on_text(self, text: str, **kwargs: Any) -> Any:
        """Run on arbitrary text."""
    def on_agent_action(self, action: AgentAction, **kwargs: Any) -> Any:
        """Run on agent action."""
    def on_agent_finish(self, finish: AgentFinish, **kwargs: Any) -> Any:
        """Run on agent end."""
How to use callbacks#
The callbacks argument is available on most objects throughout the API (Chains, Models, Tools, Agents, etc.) in two different places:
Constructor callbacks: defined in the constructor, eg. LLMChain(callbacks=[handler]), which will be used for all calls made on that object, and will be scoped to that object only, eg. if you pass a handler to the LLMChain constructor, it will not be used by the Model attached to that chain.
Request callbacks: defined in the call()/run()/apply() methods used for issuing a request, eg. chain.call(inputs, callbacks=[handler]), which will be used for that specific request only, and all sub-requests that it contains (eg. a call to an LLMChain triggers a call to a Model, which uses the same handler passed in the call() method).


The verbose argument is available on most objects throughout the API (Chains, Models, Tools, Agents, etc.) as a constructor argument, eg. LLMChain(verbose=True), and it is equivalent to passing a ConsoleCallbackHandler to the callbacks argument of that object and all child objects. This is useful for debugging, as it will log all events to the console.
When do you want to use each of these?#
Constructor callbacks are most useful for use cases such as logging, monitoring, etc., which are not specific to a single request, but rather to the entire chain. For example, if you want to log all the requests made to an LLMChain, you would pass a handler to the constructor.
Request callbacks are most useful for use cases such as streaming, where you want to stream the output of a single request to a specific websocket connection, or other similar use cases. For example, if you want to stream the output of a single request to a websocket, you would pass a handler to the call() method
Using an existing handler#
LangChain provides a few built-in handlers that you can use to get started. These are available in the langchain/callbacks module. The most basic handler is the StdOutCallbackHandler, which simply logs all events to stdout. In the future we will add more default handlers to the library.
Note when the verbose flag on the object is set to true, the StdOutCallbackHandler will be invoked even without being explicitly passed in.
from langchain.callbacks import StdOutCallbackHandler
from langchain.chains import LLMChain
from langchain.llms import OpenAI
from langchain.prompts import PromptTemplate
handler = StdOutCallbackHandler()
llm = OpenAI()
prompt = PromptTemplate.from_template("1 + {number} = ")
# First, let's explicitly set the StdOutCallbackHandler in `callbacks`


# First, let's explicitly set the StdOutCallbackHandler in `callbacks`
chain = LLMChain(llm=llm, prompt=prompt, callbacks=[handler])
chain.run(number=2)
# Then, let's use the `verbose` flag to achieve the same result
chain = LLMChain(llm=llm, prompt=prompt, verbose=True)
chain.run(number=2)
# Finally, let's use the request `callbacks` to achieve the same result
chain = LLMChain(llm=llm, prompt=prompt)
chain.run(number=2, callbacks=[handler])
> Entering new LLMChain chain...
Prompt after formatting:
1 + 2 =
> Finished chain.
> Entering new LLMChain chain...
Prompt after formatting:
1 + 2 =
> Finished chain.
> Entering new LLMChain chain...
Prompt after formatting:
1 + 2 =
> Finished chain.
'\n\n3'
Creating a custom handler#
You can create a custom handler to set on the object as well. In the example below, we’ll implement streaming with a custom handler.
from langchain.callbacks.base import BaseCallbackHandler
from langchain.chat_models import ChatOpenAI
from langchain.schema import HumanMessage
class MyCustomHandler(BaseCallbackHandler):
    def on_llm_new_token(self, token: str, **kwargs) -> None:
        print(f"My custom handler, token: {token}")
# To enable streaming, we pass in `streaming=True` to the ChatModel constructor
# Additionally, we pass in a list with our custom handler
chat = ChatOpenAI(max_tokens=25, streaming=True, callbacks=[MyCustomHandler()])
chat([HumanMessage(content="Tell me a joke")])
My custom handler, token:


chat([HumanMessage(content="Tell me a joke")])
My custom handler, token:
My custom handler, token: Why
My custom handler, token:  did
My custom handler, token:  the
My custom handler, token:  tomato
My custom handler, token:  turn
My custom handler, token:  red
My custom handler, token: ?
My custom handler, token:  Because
My custom handler, token:  it
My custom handler, token:  saw
My custom handler, token:  the
My custom handler, token:  salad
My custom handler, token:  dressing
My custom handler, token: !
My custom handler, token:
AIMessage(content='Why did the tomato turn red? Because it saw the salad dressing!', additional_kwargs={})
Async Callbacks#
If you are planning to use the async API, it is recommended to use AsyncCallbackHandler to avoid blocking the runloop.
Advanced if you use a sync CallbackHandler while using an async method to run your llm/chain/tool/agent, it will still work. However, under the hood, it will be called with run_in_executor which can cause issues if your CallbackHandler is not thread-safe.
import asyncio
from typing import Any, Dict, List
from langchain.schema import LLMResult
from langchain.callbacks.base import AsyncCallbackHandler
class MyCustomSyncHandler(BaseCallbackHandler):
    def on_llm_new_token(self, token: str, **kwargs) -> None:
        print(f"Sync handler being called in a `thread_pool_executor`: token: {token}")
class MyCustomAsyncHandler(AsyncCallbackHandler):
    """Async callback handler that can be used to handle callbacks from langchain."""
    async def on_llm_start(
        self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any


self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
    ) -> None:
        """Run when chain starts running."""
        print("zzzz....")
        await asyncio.sleep(0.3)
        class_name = serialized["name"]
        print("Hi! I just woke up. Your llm is starting")
    async def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None:
        """Run when chain ends running."""
        print("zzzz....")
        await asyncio.sleep(0.3)
        print("Hi! I just woke up. Your llm is ending")
# To enable streaming, we pass in `streaming=True` to the ChatModel constructor
# Additionally, we pass in a list with our custom handler
chat = ChatOpenAI(max_tokens=25, streaming=True, callbacks=[MyCustomSyncHandler(), MyCustomAsyncHandler()])
await chat.agenerate([[HumanMessage(content="Tell me a joke")]])
zzzz....
Hi! I just woke up. Your llm is starting
Sync handler being called in a `thread_pool_executor`: token:
Sync handler being called in a `thread_pool_executor`: token: Why
Sync handler being called in a `thread_pool_executor`: token:  don
Sync handler being called in a `thread_pool_executor`: token: 't
Sync handler being called in a `thread_pool_executor`: token:  scientists
Sync handler being called in a `thread_pool_executor`: token:  trust
Sync handler being called in a `thread_pool_executor`: token:  atoms
Sync handler being called in a `thread_pool_executor`: token: ?
Sync handler being called in a `thread_pool_executor`: token: Because
Sync handler being called in a `thread_pool_executor`: token:  they


Sync handler being called in a `thread_pool_executor`: token:  they
Sync handler being called in a `thread_pool_executor`: token:  make
Sync handler being called in a `thread_pool_executor`: token:  up
Sync handler being called in a `thread_pool_executor`: token:  everything
Sync handler being called in a `thread_pool_executor`: token: !
Sync handler being called in a `thread_pool_executor`: token:
zzzz....
Hi! I just woke up. Your llm is ending
LLMResult(generations=[[ChatGeneration(text="Why don't scientists trust atoms?\n\nBecause they make up everything!", generation_info=None, message=AIMessage(content="Why don't scientists trust atoms?\n\nBecause they make up everything!", additional_kwargs={}))]], llm_output={'token_usage': {}, 'model_name': 'gpt-3.5-turbo'})
Using multiple handlers, passing in handlers#
In the previous examples, we passed in callback handlers upon creation of an object by using callbacks=. In this case, the callbacks will be scoped to that particular object.
However, in many cases, it is advantageous to pass in handlers instead when running the object. When we pass through CallbackHandlers using the callbacks keyword arg when executing an run, those callbacks will be issued by all nested objects involved in the execution. For example, when a handler is passed through to an Agent, it will be used for all callbacks related to the agent and all the objects involved in the agent’s execution, in this case, the Tools, LLMChain, and LLM.
This prevents us from having to manually attach the handlers to each individual nested object.
from typing import Dict, Union, Any, List
from langchain.callbacks.base import BaseCallbackHandler
from langchain.schema import AgentAction
from langchain.agents import AgentType, initialize_agent, load_tools


from langchain.agents import AgentType, initialize_agent, load_tools
from langchain.callbacks import tracing_enabled
from langchain.llms import OpenAI
# First, define custom callback handler implementations
class MyCustomHandlerOne(BaseCallbackHandler):
    def on_llm_start(
        self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
    ) -> Any:
        print(f"on_llm_start {serialized['name']}")
    def on_llm_new_token(self, token: str, **kwargs: Any) -> Any:
        print(f"on_new_token {token}")
    def on_llm_error(
        self, error: Union[Exception, KeyboardInterrupt], **kwargs: Any
    ) -> Any:
        """Run when LLM errors."""
    def on_chain_start(
        self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any
    ) -> Any:
        print(f"on_chain_start {serialized['name']}")
    def on_tool_start(
        self, serialized: Dict[str, Any], input_str: str, **kwargs: Any
    ) -> Any:
        print(f"on_tool_start {serialized['name']}")
    def on_agent_action(self, action: AgentAction, **kwargs: Any) -> Any:
        print(f"on_agent_action {action}")
class MyCustomHandlerTwo(BaseCallbackHandler):
    def on_llm_start(
        self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
    ) -> Any:
        print(f"on_llm_start (I'm the second handler!!) {serialized['name']}")
# Instantiate the handlers
handler1 = MyCustomHandlerOne()
handler2 = MyCustomHandlerTwo()


handler1 = MyCustomHandlerOne()
handler2 = MyCustomHandlerTwo()
# Setup the agent. Only the `llm` will issue callbacks for handler2
llm = OpenAI(temperature=0, streaming=True, callbacks=[handler2])
tools = load_tools(["llm-math"], llm=llm)
agent = initialize_agent(
    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION
)
# Callbacks for handler1 will be issued by every object involved in the
# Agent execution (llm, llmchain, tool, agent executor)
agent.run("What is 2 raised to the 0.235 power?", callbacks=[handler1])
on_chain_start AgentExecutor
on_chain_start LLMChain
on_llm_start OpenAI
on_llm_start (I'm the second handler!!) OpenAI
on_new_token  I
on_new_token  need
on_new_token  to
on_new_token  use
on_new_token  a
on_new_token  calculator
on_new_token  to
on_new_token  solve
on_new_token  this
on_new_token .
on_new_token
Action
on_new_token :
on_new_token  Calculator
on_new_token
Action
on_new_token  Input
on_new_token :
on_new_token  2
on_new_token ^
on_new_token 0
on_new_token .
on_new_token 235
on_new_token
on_agent_action AgentAction(tool='Calculator', tool_input='2^0.235', log=' I need to use a calculator to solve this.\nAction: Calculator\nAction Input: 2^0.235')
on_tool_start Calculator
on_chain_start LLMMathChain
on_chain_start LLMChain
on_llm_start OpenAI


on_chain_start LLMChain
on_llm_start OpenAI
on_llm_start (I'm the second handler!!) OpenAI
on_new_token
on_new_token ```text
on_new_token
on_new_token 2
on_new_token **
on_new_token 0
on_new_token .
on_new_token 235
on_new_token
on_new_token ```
on_new_token ...
on_new_token num
on_new_token expr
on_new_token .
on_new_token evaluate
on_new_token ("
on_new_token 2
on_new_token **
on_new_token 0
on_new_token .
on_new_token 235
on_new_token ")
on_new_token ...
on_new_token
on_new_token
on_chain_start LLMChain
on_llm_start OpenAI
on_llm_start (I'm the second handler!!) OpenAI
on_new_token  I
on_new_token  now
on_new_token  know
on_new_token  the
on_new_token  final
on_new_token  answer
on_new_token .
on_new_token
Final
on_new_token  Answer
on_new_token :
on_new_token  1
on_new_token .
on_new_token 17
on_new_token 690
on_new_token 67
on_new_token 372
on_new_token 187
on_new_token 674
on_new_token
'1.1769067372187674'
Tracing and Token Counting#
Tracing and token counting are two capabilities we provide which are built on our callbacks mechanism.
Tracing#
There are two recommended ways to trace your LangChains:
Setting the LANGCHAIN_TRACING environment variable to "true".
Using a context manager with tracing_enabled() to trace a particular block of code.


Using a context manager with tracing_enabled() to trace a particular block of code.
Note if the environment variable is set, all code will be traced, regardless of whether or not it’s within the context manager.
import os
from langchain.agents import AgentType, initialize_agent, load_tools
from langchain.callbacks import tracing_enabled
from langchain.llms import OpenAI
# To run the code, make sure to set OPENAI_API_KEY and SERPAPI_API_KEY
llm = OpenAI(temperature=0)
tools = load_tools(["llm-math", "serpapi"], llm=llm)
agent = initialize_agent(
    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True
)
questions = [
    "Who won the US Open men's final in 2019? What is his age raised to the 0.334 power?",
    "Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?",
    "Who won the most recent formula 1 grand prix? What is their age raised to the 0.23 power?",
    "Who won the US Open women's final in 2019? What is her age raised to the 0.34 power?",
    "Who is Beyonce's husband? What is his age raised to the 0.19 power?",
]
os.environ["LANGCHAIN_TRACING"] = "true"
# Both of the agent runs will be traced because the environment variable is set
agent.run(questions[0])
with tracing_enabled() as session:
    assert session
    agent.run(questions[1])
> Entering new AgentExecutor chain...
 I need to find out who won the US Open men's final in 2019 and then calculate his age raised to the 0.334 power.


Action: Search
Action Input: "US Open men's final 2019 winner"
Observation: Rafael Nadal defeated Daniil Medvedev in the final, 7–5, 6–3, 5–7, 4–6, 6–4 to win the men's singles tennis title at the 2019 US Open. It was his fourth US ...
Thought: I need to find out the age of the winner
Action: Search
Action Input: "Rafael Nadal age"
Observation: 36 years
Thought: I need to calculate the age raised to the 0.334 power
Action: Calculator
Action Input: 36^0.334
Observation: Answer: 3.3098250249682484
Thought: I now know the final answer
Final Answer: Rafael Nadal, aged 36, won the US Open men's final in 2019 and his age raised to the 0.334 power is 3.3098250249682484.
> Finished chain.
> Entering new AgentExecutor chain...
 I need to find out who Olivia Wilde's boyfriend is and then calculate his age raised to the 0.23 power.
Action: Search
Action Input: "Olivia Wilde boyfriend"
Observation: Sudeikis and Wilde's relationship ended in November 2020. Wilde was publicly served with court documents regarding child custody while she was presenting Don't Worry Darling at CinemaCon 2022. In January 2021, Wilde began dating singer Harry Styles after meeting during the filming of Don't Worry Darling.
Thought: I need to find out Harry Styles' age.
Action: Search
Action Input: "Harry Styles age"
Observation: 29 years
Thought: I need to calculate 29 raised to the 0.23 power.
Action: Calculator


Action: Calculator
Action Input: 29^0.23
Observation: Answer: 2.169459462491557
Thought: I now know the final answer.
Final Answer: Harry Styles is Olivia Wilde's boyfriend and his current age raised to the 0.23 power is 2.169459462491557.
> Finished chain.
# Now, we unset the environment variable and use a context manager.
if "LANGCHAIN_TRACING" in os.environ:
    del os.environ["LANGCHAIN_TRACING"]
# here, we are writing traces to "my_test_session"
with tracing_enabled("my_test_session") as session:
    assert session
    agent.run(questions[0])  # this should be traced
agent.run(questions[1])  # this should not be traced
> Entering new AgentExecutor chain...
 I need to find out who won the US Open men's final in 2019 and then calculate his age raised to the 0.334 power.
Action: Search
Action Input: "US Open men's final 2019 winner"
Observation: Rafael Nadal defeated Daniil Medvedev in the final, 7–5, 6–3, 5–7, 4–6, 6–4 to win the men's singles tennis title at the 2019 US Open. It was his fourth US ...
Thought: I need to find out the age of the winner
Action: Search
Action Input: "Rafael Nadal age"
Observation: 36 years
Thought: I need to calculate the age raised to the 0.334 power
Action: Calculator
Action Input: 36^0.334
Observation: Answer: 3.3098250249682484
Thought: I now know the final answer


Thought: I now know the final answer
Final Answer: Rafael Nadal, aged 36, won the US Open men's final in 2019 and his age raised to the 0.334 power is 3.3098250249682484.
> Finished chain.
> Entering new AgentExecutor chain...
 I need to find out who Olivia Wilde's boyfriend is and then calculate his age raised to the 0.23 power.
Action: Search
Action Input: "Olivia Wilde boyfriend"
Observation: Sudeikis and Wilde's relationship ended in November 2020. Wilde was publicly served with court documents regarding child custody while she was presenting Don't Worry Darling at CinemaCon 2022. In January 2021, Wilde began dating singer Harry Styles after meeting during the filming of Don't Worry Darling.
Thought: I need to find out Harry Styles' age.
Action: Search
Action Input: "Harry Styles age"
Observation: 29 years
Thought: I need to calculate 29 raised to the 0.23 power.
Action: Calculator
Action Input: 29^0.23
Observation: Answer: 2.169459462491557
Thought: I now know the final answer.
Final Answer: Harry Styles is Olivia Wilde's boyfriend and his current age raised to the 0.23 power is 2.169459462491557.
> Finished chain.
"Harry Styles is Olivia Wilde's boyfriend and his current age raised to the 0.23 power is 2.169459462491557."
# The context manager is concurrency safe:
if "LANGCHAIN_TRACING" in os.environ:
    del os.environ["LANGCHAIN_TRACING"]
# start a background task
task = asyncio.create_task(agent.arun(questions[0]))  # this should not be traced


task = asyncio.create_task(agent.arun(questions[0]))  # this should not be traced
with tracing_enabled() as session:
    assert session
    tasks = [agent.arun(q) for q in questions[1:3]]  # these should be traced
    await asyncio.gather(*tasks)
await task
> Entering new AgentExecutor chain...
> Entering new AgentExecutor chain...
> Entering new AgentExecutor chain...
 I need to find out who won the grand prix and then calculate their age raised to the 0.23 power.
Action: Search
Action Input: "Formula 1 Grand Prix Winner" I need to find out who won the US Open men's final in 2019 and then calculate his age raised to the 0.334 power.
Action: Search
Action Input: "US Open men's final 2019 winner"Rafael Nadal defeated Daniil Medvedev in the final, 7–5, 6–3, 5–7, 4–6, 6–4 to win the men's singles tennis title at the 2019 US Open. It was his fourth US ... I need to find out who Olivia Wilde's boyfriend is and then calculate his age raised to the 0.23 power.
Action: Search
Action Input: "Olivia Wilde boyfriend"Sudeikis and Wilde's relationship ended in November 2020. Wilde was publicly served with court documents regarding child custody while she was presenting Don't Worry Darling at CinemaCon 2022. In January 2021, Wilde began dating singer Harry Styles after meeting during the filming of Don't Worry Darling.Lewis Hamilton has won 103 Grands Prix during his career. He won 21 races with McLaren and has won 82 with Mercedes. Lewis Hamilton holds the record for the ... I need to find out the age of the winner