diff --git a/README.md b/README.md index 89631319beea8..8cd235cbe90f9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/hwchase17/langchain) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/hwchase17/langchain) [![GitHub star chart](https://img.shields.io/github/stars/hwchase17/langchain?style=social)](https://star-history.com/#hwchase17/langchain) -[![Dependency Status](https://img.shields.io/librariesio/github/hwchase17/langchain)](https://libraries.io/github/hwchase17/langchain) +[![Dependency Status](https://img.shields.io/librariesio/github/langchain-ai/langchain)](https://libraries.io/github/langchain-ai/langchain) [![Open Issues](https://img.shields.io/github/issues-raw/hwchase17/langchain)](https://github.com/hwchase17/langchain/issues) diff --git a/docs/api_reference/guide_imports.json b/docs/api_reference/guide_imports.json index b44b46dbdb37a..0d895270aa01d 100644 --- a/docs/api_reference/guide_imports.json +++ b/docs/api_reference/guide_imports.json @@ -1 +1 @@ -{"DeepInfraEmbeddings": {"DeepInfra": "https://python.langchain.com/docs/integrations/text_embedding/deepinfra"}, "HuggingFaceEmbeddings": {"Hugging Face Hub": "https://python.langchain.com/docs/integrations/text_embedding/huggingfacehub", "Sentence Transformers Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/sentence_transformers", "LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever", "Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "Pairwise Embedding Distance ": "https://python.langchain.com/docs/guides/evaluation/comparison/pairwise_embedding_distance", "Embedding Distance": "https://python.langchain.com/docs/guides/evaluation/string/embedding_distance", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder"}, "GPT4AllEmbeddings": {"GPT4All": "https://python.langchain.com/docs/integrations/text_embedding/gpt4all", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "MosaicMLInstructorEmbeddings": {"MosaicML embeddings": "https://python.langchain.com/docs/integrations/text_embedding/mosaicml"}, "OpenAIEmbeddings": {"OpenAI": "https://python.langchain.com/docs/integrations/providers/openai", "AzureOpenAI": "https://python.langchain.com/docs/integrations/text_embedding/azureopenai", "Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "kNN": "https://python.langchain.com/docs/integrations/retrievers/knn", "DocArray Retriever": "https://python.langchain.com/docs/integrations/retrievers/docarray_retriever", "SVM": "https://python.langchain.com/docs/integrations/retrievers/svm", "Pinecone Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/pinecone_hybrid_search", "LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever", "Azure OpenAI": "https://python.langchain.com/docs/integrations/providers/azure_openai", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb", "Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Rockset": "https://python.langchain.com/docs/integrations/vectorstores/rockset", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz", "SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb", "Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense", "Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Alibaba Cloud OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn", "DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw", "MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse", "Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris", "Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase", "OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch", "Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch", "Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra", "Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb", "Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres", "MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Select by maximal marginal relevance (MMR)": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "VertexAIEmbeddings": {"Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/text_embedding/google_vertex_ai_palm"}, "BedrockEmbeddings": {"Bedrock Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/bedrock", "Bedrock": "https://python.langchain.com/docs/integrations/providers/bedrock"}, "LlamaCppEmbeddings": {"Llama-cpp": "https://python.langchain.com/docs/integrations/text_embedding/llamacpp", "Llama.cpp": "https://python.langchain.com/docs/integrations/providers/llamacpp"}, "NLPCloudEmbeddings": {"NLP Cloud": "https://python.langchain.com/docs/integrations/text_embedding/nlp_cloud"}, "SpacyEmbeddings": {"Spacy Embedding": "https://python.langchain.com/docs/integrations/text_embedding/spacy_embedding"}, "HuggingFaceInstructEmbeddings": {"InstructEmbeddings": "https://python.langchain.com/docs/integrations/text_embedding/instruct_embeddings"}, "CohereEmbeddings": {"Cohere": "https://python.langchain.com/docs/integrations/providers/cohere", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "ClarifaiEmbeddings": {"Clarifai": "https://python.langchain.com/docs/integrations/providers/clarifai"}, "MiniMaxEmbeddings": {"MiniMax": "https://python.langchain.com/docs/integrations/text_embedding/minimax"}, "FakeEmbeddings": {"Fake Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/fake", "DocArray Retriever": "https://python.langchain.com/docs/integrations/retrievers/docarray_retriever", "Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair"}, "ElasticsearchEmbeddings": {"Elasticsearch": "https://python.langchain.com/docs/integrations/text_embedding/elasticsearch", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch"}, "EmbaasEmbeddings": {"Embaas": "https://python.langchain.com/docs/integrations/text_embedding/embaas"}, "JinaEmbeddings": {"Jina": "https://python.langchain.com/docs/integrations/providers/jina"}, "AlephAlphaAsymmetricSemanticEmbedding": {"Aleph Alpha": "https://python.langchain.com/docs/integrations/text_embedding/aleph_alpha"}, "AlephAlphaSymmetricSemanticEmbedding": {"Aleph Alpha": "https://python.langchain.com/docs/integrations/providers/aleph_alpha"}, "DashScopeEmbeddings": {"DashScope": "https://python.langchain.com/docs/integrations/text_embedding/dashscope"}, "TensorflowHubEmbeddings": {"TensorflowHub": "https://python.langchain.com/docs/integrations/text_embedding/tensorflowhub"}, "ModelScopeEmbeddings": {"ModelScope": "https://python.langchain.com/docs/integrations/providers/modelscope"}, "SagemakerEndpointEmbeddings": {"SageMaker Endpoint Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/sagemaker-endpoint", "SageMaker Endpoint": "https://python.langchain.com/docs/integrations/providers/sagemaker_endpoint"}, "EmbeddingsContentHandler": {"SageMaker Endpoint Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/sagemaker-endpoint"}, "LocalAIEmbeddings": {"LocalAI": "https://python.langchain.com/docs/integrations/text_embedding/localai"}, "ElasticSearchBM25Retriever": {"ElasticSearch BM25": "https://python.langchain.com/docs/integrations/retrievers/elastic_search_bm25", "Elasticsearch": "https://python.langchain.com/docs/integrations/providers/elasticsearch"}, "ZepChatMessageHistory": {"Zep": "https://python.langchain.com/docs/integrations/retrievers/zep_memorystore"}, "HumanMessage": {"Zep": "https://python.langchain.com/docs/integrations/retrievers/zep_memorystore", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory", "Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/chat/google_vertex_ai_palm", "Azure": "https://python.langchain.com/docs/integrations/chat/azure_chat_openai", "PromptLayer ChatOpenAI": "https://python.langchain.com/docs/integrations/chat/promptlayer_chatopenai", "MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking", "Custom callback handlers": "https://python.langchain.com/docs/modules/callbacks/custom_callbacks", "Tools as OpenAI Functions": "https://python.langchain.com/docs/modules/agents/tools/tools_as_openai_functions", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Using OpenAI functions": "https://python.langchain.com/docs/modules/chains/popular/openai_functions"}, "ZepRetriever": {"Zep": "https://python.langchain.com/docs/integrations/providers/zep", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory"}, "VespaRetriever": {"Vespa": "https://python.langchain.com/docs/integrations/providers/vespa"}, "AmazonKendraRetriever": {"Amazon Kendra": "https://python.langchain.com/docs/integrations/retrievers/amazon_kendra_retriever"}, "RecursiveCharacterTextSplitter": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "MarkdownHeaderTextSplitter": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/markdown_header_metadata"}, "TextLoader": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb", "Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Rockset": "https://python.langchain.com/docs/integrations/vectorstores/rockset", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz", "SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense", "Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas", "Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Alibaba Cloud OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Clarifai": "https://python.langchain.com/docs/integrations/vectorstores/clarifai", "scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn", "DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw", "MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse", "Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris", "AwaDB": "https://python.langchain.com/docs/integrations/vectorstores/awadb", "Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase", "OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch", "Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch", "Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra", "Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo", "DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb", "Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres", "MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "QA Generation": "https://python.langchain.com/docs/guides/evaluation/examples/qa_generation", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "FAISS": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters", "Ensemble Retriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/ensemble", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Select by maximal marginal relevance (MMR)": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr"}, "OpenAI": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "OpenWeatherMap API": "https://python.langchain.com/docs/integrations/tools/openweathermap", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Gradio Tools": "https://python.langchain.com/docs/integrations/tools/gradio_tools", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer", "Streamlit": "https://python.langchain.com/docs/integrations/callbacks/streamlit", "WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "OpenAI": "https://python.langchain.com/docs/integrations/llms/openai", "Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "Helicone": "https://python.langchain.com/docs/integrations/providers/helicone", "Shale Protocol": "https://python.langchain.com/docs/integrations/providers/shaleprotocol", "WhyLabs": "https://python.langchain.com/docs/integrations/providers/whylabs_profiling", "ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Ray Serve": "https://python.langchain.com/docs/integrations/providers/ray_serve", "Log, Trace, and Monitor Langchain LLM Calls": "https://python.langchain.com/docs/integrations/providers/portkey/logging_tracing_portkey", "Portkey": "https://python.langchain.com/docs/integrations/providers/portkey/index", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv", "Xorbits Agent": "https://python.langchain.com/docs/integrations/toolkits/xorbits", "Jira": "https://python.langchain.com/docs/integrations/toolkits/jira", "Spark Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/spark", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "GitHub": "https://python.langchain.com/docs/integrations/toolkits/github", "Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "HuggingGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/hugginggpt", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg", "ConversationTokenBufferMemory": "https://python.langchain.com/docs/modules/memory/token_buffer", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "How to use multiple memory classes in the same chain": "https://python.langchain.com/docs/modules/memory/multiple_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "ConversationSummaryBufferMemory": "https://python.langchain.com/docs/modules/memory/summary_buffer", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Token counting": "https://python.langchain.com/docs/modules/callbacks/token_counting", "Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler", "Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Tool Input Schema": "https://python.langchain.com/docs/modules/agents/tools/tool_input_validation", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Async API": "https://python.langchain.com/docs/modules/chains/how_to/async_chain", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Serialization": "https://python.langchain.com/docs/modules/model_io/models/llms/llm_serialization", "Retry parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/retry", "Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime", "Pydantic (JSON) parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Transformation": "https://python.langchain.com/docs/modules/chains/foundational/transformation", "Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash", "Summarization checker chain": "https://python.langchain.com/docs/modules/chains/additional/llm_summarization_checker", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "HTTP request chain": "https://python.langchain.com/docs/modules/chains/additional/llm_requests", "LLM Symbolic Math ": "https://python.langchain.com/docs/modules/chains/additional/llm_symbolic_math", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde", "Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa", "Self-checking chain": "https://python.langchain.com/docs/modules/chains/additional/llm_checker", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "ContextualCompressionRetriever": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "CohereRerank": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Cohere": "https://python.langchain.com/docs/integrations/providers/cohere"}, "RetrievalQA": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "KNNRetriever": {"kNN": "https://python.langchain.com/docs/integrations/retrievers/knn"}, "WikipediaRetriever": {"Wikipedia": "https://python.langchain.com/docs/integrations/providers/wikipedia"}, "ChatOpenAI": {"Wikipedia": "https://python.langchain.com/docs/integrations/retrievers/wikipedia", "Arxiv": "https://python.langchain.com/docs/integrations/retrievers/arxiv", "ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "ArXiv API Tool": "https://python.langchain.com/docs/integrations/tools/arxiv", "Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search", "Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "OpenAI": "https://python.langchain.com/docs/integrations/chat/openai", "Context": "https://python.langchain.com/docs/integrations/callbacks/context", "PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer", "CnosDB": "https://python.langchain.com/docs/integrations/providers/cnosdb", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking", "CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python", "PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql", "Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "Multion Toolkit": "https://python.langchain.com/docs/integrations/toolkits/multion", "OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Debugging": "https://python.langchain.com/docs/guides/debugging", "LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough", "QA Generation": "https://python.langchain.com/docs/guides/evaluation/examples/qa_generation", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent Trajectory": "https://python.langchain.com/docs/guides/evaluation/trajectory/trajectory_eval", "Custom Trajectory Evaluator": "https://python.langchain.com/docs/guides/evaluation/trajectory/custom", "QA Correctness": "https://python.langchain.com/docs/guides/evaluation/string/qa", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Wikibase Agent": "https://python.langchain.com/docs/use_cases/agents/wikibase_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "CAMEL Role-Playing Autonomous Cooperative Agents": "https://python.langchain.com/docs/use_cases/agent_simulations/camel_role_playing", "Multi-Agent Simulated Environment: Petting Zoo": "https://python.langchain.com/docs/use_cases/agent_simulations/petting_zoo", "Multi-agent decentralized speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_bidding", "Multi-agent authoritarian speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_authoritarian", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters", "Two-Player Dungeons & Dragons": "https://python.langchain.com/docs/use_cases/agent_simulations/two_player_dnd", "Multi-Player Dungeons & Dragons": "https://python.langchain.com/docs/use_cases/agent_simulations/multi_player_dnd", "Simulated Environment: Gymnasium": "https://python.langchain.com/docs/use_cases/agent_simulations/gymnasium", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Custom callback handlers": "https://python.langchain.com/docs/modules/callbacks/custom_callbacks", "Async callbacks": "https://python.langchain.com/docs/modules/callbacks/async_callbacks", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Tools as OpenAI Functions": "https://python.langchain.com/docs/modules/agents/tools/tools_as_openai_functions", "OpenAI Multi Functions Agent": "https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent", "Handle parsing errors": "https://python.langchain.com/docs/modules/agents/how_to/handle_parsing_errors", "Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Retry parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/retry", "Pydantic (JSON) parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Connecting to a Feature Store": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain", "Using OpenAI functions": "https://python.langchain.com/docs/modules/chains/popular/openai_functions", "Neptune Open Cypher QA Chain": "https://python.langchain.com/docs/modules/chains/additional/neptune_cypher_qa", "NebulaGraphQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_nebula_qa", "Elasticsearch database": "https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database", "Extraction": "https://python.langchain.com/docs/modules/chains/additional/extraction", "KuzuQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_kuzu_qa", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "HugeGraph QA Chain": "https://python.langchain.com/docs/modules/chains/additional/graph_hugegraph_qa", "Tagging": "https://python.langchain.com/docs/modules/chains/additional/tagging", "GraphSparqlQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_sparql_qa", "Question-Answering Citations": "https://python.langchain.com/docs/modules/chains/additional/qa_citations", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare", "ArangoDB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_arangodb_qa", "Graph DB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_cypher_qa"}, "ConversationalRetrievalChain": {"Wikipedia": "https://python.langchain.com/docs/integrations/retrievers/wikipedia", "Arxiv": "https://python.langchain.com/docs/integrations/retrievers/arxiv", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "MetalRetriever": {"Metal": "https://python.langchain.com/docs/integrations/providers/metal"}, "CSVLoader": {"ChatGPT Plugin": "https://python.langchain.com/docs/integrations/retrievers/chatgpt-plugin", "CSV": "https://python.langchain.com/docs/integrations/document_loaders/csv"}, "Document": {"ChatGPT Plugin": "https://python.langchain.com/docs/integrations/retrievers/chatgpt-plugin", "Weaviate Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/weaviate-hybrid", "BM25": "https://python.langchain.com/docs/integrations/retrievers/bm25", "TF-IDF": "https://python.langchain.com/docs/integrations/retrievers/tf_idf", "Apify": "https://python.langchain.com/docs/integrations/tools/apify", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger", "Doctran Extract Properties": "https://python.langchain.com/docs/integrations/document_transformers/doctran_extract_properties", "Doctran Interrogate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_interrogate_document", "Doctran Translate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_translate_document", "Copy Paste": "https://python.langchain.com/docs/integrations/document_loaders/copypaste", "Apify Dataset": "https://python.langchain.com/docs/integrations/document_loaders/apify_dataset", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "SageMakerEndpoint": "https://python.langchain.com/docs/integrations/llms/sagemaker", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "ChatGPTPluginRetriever": {"ChatGPT Plugin": "https://python.langchain.com/docs/integrations/retrievers/chatgpt-plugin", "OpenAI": "https://python.langchain.com/docs/integrations/providers/openai"}, "GoogleCloudEnterpriseSearchRetriever": {"Google Cloud Enterprise Search": "https://python.langchain.com/docs/integrations/retrievers/google_cloud_enterprise_search"}, "DocArrayRetriever": {"DocArray Retriever": "https://python.langchain.com/docs/integrations/retrievers/docarray_retriever"}, "SVMRetriever": {"SVM": "https://python.langchain.com/docs/integrations/retrievers/svm", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index"}, "PineconeHybridSearchRetriever": {"Pinecone Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/pinecone_hybrid_search"}, "PubMedRetriever": {"PubMed": "https://python.langchain.com/docs/integrations/retrievers/pubmed"}, "WeaviateHybridSearchRetriever": {"Weaviate Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/weaviate-hybrid"}, "ArxivRetriever": {"Arxiv": "https://python.langchain.com/docs/integrations/providers/arxiv"}, "BM25Retriever": {"BM25": "https://python.langchain.com/docs/integrations/retrievers/bm25", "Ensemble Retriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/ensemble"}, "AzureCognitiveSearchRetriever": {"Azure Cognitive Search": "https://python.langchain.com/docs/integrations/providers/azure_cognitive_search_"}, "ChaindeskRetriever": {"Chaindesk": "https://python.langchain.com/docs/integrations/providers/chaindesk"}, "MergerRetriever": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "Chroma": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "DocumentCompressorPipeline": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "LongContextReorder": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "TFIDFRetriever": {"TF-IDF": "https://python.langchain.com/docs/integrations/retrievers/tf_idf"}, "load_tools": {"ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "AWS Lambda API": "https://python.langchain.com/docs/integrations/tools/awslambda", "Requests": "https://python.langchain.com/docs/integrations/tools/requests", "OpenWeatherMap API": "https://python.langchain.com/docs/integrations/tools/openweathermap", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "ArXiv API Tool": "https://python.langchain.com/docs/integrations/tools/arxiv", "GraphQL tool": "https://python.langchain.com/docs/integrations/tools/graphql", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "SerpAPI": "https://python.langchain.com/docs/integrations/providers/serpapi", "Golden": "https://python.langchain.com/docs/integrations/providers/golden", "Wolfram Alpha": "https://python.langchain.com/docs/integrations/providers/wolfram_alpha", "DataForSEO": "https://python.langchain.com/docs/integrations/providers/dataforseo", "SearxNG Search API": "https://python.langchain.com/docs/integrations/providers/searx", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "OpenWeatherMap": "https://python.langchain.com/docs/integrations/providers/openweathermap", "Google Search": "https://python.langchain.com/docs/integrations/providers/google_search", "Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model", "Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "AgentType": {"ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins", "Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "Streamlit": "https://python.langchain.com/docs/integrations/callbacks/streamlit", "WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Log, Trace, and Monitor Langchain LLM Calls": "https://python.langchain.com/docs/integrations/providers/portkey/logging_tracing_portkey", "Portkey": "https://python.langchain.com/docs/integrations/providers/portkey/index", "CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv", "Jira": "https://python.langchain.com/docs/integrations/toolkits/jira", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "GitHub": "https://python.langchain.com/docs/integrations/toolkits/github", "Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "Multion Toolkit": "https://python.langchain.com/docs/integrations/toolkits/multion", "Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example", "Debugging": "https://python.langchain.com/docs/guides/debugging", "LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Agent Trajectory": "https://python.langchain.com/docs/guides/evaluation/trajectory/trajectory_eval", "Multi-modal outputs: Image & Text": "https://python.langchain.com/docs/use_cases/multi_modal/image_agent", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Tool Input Schema": "https://python.langchain.com/docs/modules/agents/tools/tool_input_validation", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Self ask with search": "https://python.langchain.com/docs/modules/agents/agent_types/self_ask_with_search", "ReAct document store": "https://python.langchain.com/docs/modules/agents/agent_types/react_docstore", "OpenAI Multi Functions Agent": "https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Handle parsing errors": "https://python.langchain.com/docs/modules/agents/how_to/handle_parsing_errors", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent", "Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model", "Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "AIPluginTool": {"ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins"}, "Tool": {"DataForSeo API Wrapper": "https://python.langchain.com/docs/integrations/tools/dataforseo", "SerpAPI": "https://python.langchain.com/docs/integrations/tools/serpapi", "Google Search": "https://python.langchain.com/docs/integrations/tools/google_search", "Python REPL": "https://python.langchain.com/docs/integrations/tools/foo_python", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Custom multi-action agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_multi_action_agent", "Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter", "Custom agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent"}, "SearxSearchWrapper": {"SearxNG Search API": "https://python.langchain.com/docs/integrations/providers/searx"}, "GoogleSerperAPIWrapper": {"Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "initialize_agent": {"Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search", "Gradio Tools": "https://python.langchain.com/docs/integrations/tools/gradio_tools", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Jira": "https://python.langchain.com/docs/integrations/toolkits/jira", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Azure Cognitive Services Toolkit": "https://python.langchain.com/docs/integrations/toolkits/azure_cognitive_services", "Gmail Toolkit": "https://python.langchain.com/docs/integrations/toolkits/gmail", "GitHub": "https://python.langchain.com/docs/integrations/toolkits/github", "PlayWright Browser Toolkit": "https://python.langchain.com/docs/integrations/toolkits/playwright", "Office365 Toolkit": "https://python.langchain.com/docs/integrations/toolkits/office365", "Amadeus Toolkit": "https://python.langchain.com/docs/integrations/toolkits/amadeus", "Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Multi-modal outputs: Image & Text": "https://python.langchain.com/docs/use_cases/multi_modal/image_agent", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Self ask with search": "https://python.langchain.com/docs/modules/agents/agent_types/self_ask_with_search", "ReAct document store": "https://python.langchain.com/docs/modules/agents/agent_types/react_docstore", "OpenAI Multi Functions Agent": "https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Handle parsing errors": "https://python.langchain.com/docs/modules/agents/how_to/handle_parsing_errors", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent", "Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model", "Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "GooglePlacesTool": {"Google Places": "https://python.langchain.com/docs/integrations/tools/google_places"}, "HumanInputRun": {"Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "TwilioAPIWrapper": {"Twilio": "https://python.langchain.com/docs/integrations/tools/twilio"}, "IFTTTWebhook": {"IFTTT WebHooks": "https://python.langchain.com/docs/integrations/tools/ifttt"}, "WikipediaQueryRun": {"Wikipedia": "https://python.langchain.com/docs/integrations/tools/wikipedia"}, "WikipediaAPIWrapper": {"Wikipedia": "https://python.langchain.com/docs/integrations/tools/wikipedia", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory"}, "TextRequestsWrapper": {"Requests": "https://python.langchain.com/docs/integrations/tools/requests", "JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "OpenWeatherMapAPIWrapper": {"OpenWeatherMap API": "https://python.langchain.com/docs/integrations/tools/openweathermap", "OpenWeatherMap": "https://python.langchain.com/docs/integrations/providers/openweathermap"}, "PubmedQueryRun": {"PubMed Tool": "https://python.langchain.com/docs/integrations/tools/pubmed"}, "YouTubeSearchTool": {"YouTubeSearchTool": "https://python.langchain.com/docs/integrations/tools/youtube"}, "VectorstoreIndexCreator": {"Apify": "https://python.langchain.com/docs/integrations/tools/apify", "HuggingFace dataset": "https://python.langchain.com/docs/integrations/document_loaders/hugging_face_dataset", "Spreedly": "https://python.langchain.com/docs/integrations/document_loaders/spreedly", "Image captions": "https://python.langchain.com/docs/integrations/document_loaders/image_captions", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Apify Dataset": "https://python.langchain.com/docs/integrations/document_loaders/apify_dataset", "Iugu": "https://python.langchain.com/docs/integrations/document_loaders/iugu", "Stripe": "https://python.langchain.com/docs/integrations/document_loaders/stripe", "Modern Treasury": "https://python.langchain.com/docs/integrations/document_loaders/modern_treasury", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index"}, "ZapierToolkit": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier"}, "ZapierNLAWrapper": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier"}, "LLMChain": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "Predibase": "https://python.langchain.com/docs/integrations/llms/predibase", "AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Custom Trajectory Evaluator": "https://python.langchain.com/docs/guides/evaluation/trajectory/custom", "Custom Pairwise Evaluator": "https://python.langchain.com/docs/guides/evaluation/comparison/custom", "Multi-agent authoritarian speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_authoritarian", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler", "Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Connecting to a Feature Store": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Async API": "https://python.langchain.com/docs/modules/chains/how_to/async_chain", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "PromptTemplate": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Context": "https://python.langchain.com/docs/integrations/callbacks/context", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "Predibase": "https://python.langchain.com/docs/integrations/llms/predibase", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Pairwise String Comparison": "https://python.langchain.com/docs/guides/evaluation/comparison/pairwise_string", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "How to create a custom Memory class": "https://python.langchain.com/docs/modules/memory/custom_memory", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "How to use multiple memory classes in the same chain": "https://python.langchain.com/docs/modules/memory/multiple_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler", "Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime", "Select by n-gram overlap": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/ngram_overlap", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Template Formats": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/formats", "Connecting to a Feature Store": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Transformation": "https://python.langchain.com/docs/modules/chains/foundational/transformation", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain", "Async API": "https://python.langchain.com/docs/modules/chains/how_to/async_chain", "Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash", "Elasticsearch database": "https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "HTTP request chain": "https://python.langchain.com/docs/modules/chains/additional/llm_requests", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "ZapierNLARunAction": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier"}, "GoldenQueryAPIWrapper": {"Golden Query": "https://python.langchain.com/docs/integrations/tools/golden_query", "Golden": "https://python.langchain.com/docs/integrations/providers/golden"}, "ArxivAPIWrapper": {"ArXiv API Tool": "https://python.langchain.com/docs/integrations/tools/arxiv"}, "MetaphorSearchAPIWrapper": {"Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search"}, "PlayWrightBrowserToolkit": {"Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search", "PlayWright Browser Toolkit": "https://python.langchain.com/docs/integrations/toolkits/playwright"}, "MetaphorSearchResults": {"Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search"}, "SerpAPIWrapper": {"SerpAPI": "https://python.langchain.com/docs/integrations/providers/serpapi", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt"}, "GraphQLAPIWrapper": {"GraphQL tool": "https://python.langchain.com/docs/integrations/tools/graphql"}, "DuckDuckGoSearchRun": {"DuckDuckGo Search": "https://python.langchain.com/docs/integrations/tools/ddg"}, "DuckDuckGoSearchResults": {"DuckDuckGo Search": "https://python.langchain.com/docs/integrations/tools/ddg"}, "DuckDuckGoSearchAPIWrapper": {"DuckDuckGo Search": "https://python.langchain.com/docs/integrations/tools/ddg"}, "ConversationBufferMemory": {"Gradio Tools": "https://python.langchain.com/docs/integrations/tools/gradio_tools", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Bedrock": "https://python.langchain.com/docs/integrations/llms/bedrock", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "How to add Memory to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory", "Shared memory across agents and tools": "https://python.langchain.com/docs/modules/agents/how_to/sharedmemory_for_tools", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "SceneXplainTool": {"SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain"}, "WolframAlphaAPIWrapper": {"Wolfram Alpha": "https://python.langchain.com/docs/integrations/providers/wolfram_alpha"}, "load_huggingface_tool": {"Requires transformers>=4.29.0 and huggingface_hub>=0.14.1": "https://python.langchain.com/docs/integrations/tools/huggingface_tools"}, "GoogleSearchAPIWrapper": {"Google Search": "https://python.langchain.com/docs/integrations/providers/google_search", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db", "How to add Memory to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory", "Shared memory across agents and tools": "https://python.langchain.com/docs/modules/agents/how_to/sharedmemory_for_tools"}, "BingSearchAPIWrapper": {"Bing Search": "https://python.langchain.com/docs/integrations/tools/bing_search"}, "PythonREPL": {"Python REPL": "https://python.langchain.com/docs/integrations/tools/foo_python", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python"}, "ShellTool": {"Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval"}, "FileManagementToolkit": {"File System Tools": "https://python.langchain.com/docs/integrations/tools/filesystem"}, "BraveSearch": {"Brave Search": "https://python.langchain.com/docs/integrations/providers/brave_search"}, "RedisChatMessageHistory": {"Redis Chat Message History": "https://python.langchain.com/docs/integrations/memory/redis_chat_message_history", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db"}, "ZepMemory": {"Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory"}, "ConversationChain": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Bedrock": "https://python.langchain.com/docs/integrations/llms/bedrock", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg", "ConversationTokenBufferMemory": "https://python.langchain.com/docs/modules/memory/token_buffer", "How to use multiple memory classes in the same chain": "https://python.langchain.com/docs/modules/memory/multiple_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "ConversationSummaryBufferMemory": "https://python.langchain.com/docs/modules/memory/summary_buffer", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "ConversationEntityMemory": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite"}, "SQLiteEntityStore": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite"}, "ENTITY_MEMORY_CONVERSATION_TEMPLATE": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite"}, "PostgresChatMessageHistory": {"Postgres Chat Message History": "https://python.langchain.com/docs/integrations/memory/postgres_chat_message_history"}, "MomentoChatMessageHistory": {"Momento Chat Message History": "https://python.langchain.com/docs/integrations/memory/momento_chat_message_history"}, "MongoDBChatMessageHistory": {"Mongodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/mongodb_chat_message_history"}, "CassandraChatMessageHistory": {"Cassandra Chat Message History": "https://python.langchain.com/docs/integrations/memory/cassandra_chat_message_history", "Cassandra": "https://python.langchain.com/docs/integrations/providers/cassandra"}, "MotorheadMemory": {"Mot\u00f6rhead Memory": "https://python.langchain.com/docs/integrations/memory/motorhead_memory", "Mot\u00f6rhead Memory (Managed)": "https://python.langchain.com/docs/integrations/memory/motorhead_memory_managed"}, "DynamoDBChatMessageHistory": {"Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history"}, "ChatAnthropic": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "PlayWright Browser Toolkit": "https://python.langchain.com/docs/integrations/toolkits/playwright", "Agent Trajectory": "https://python.langchain.com/docs/guides/evaluation/trajectory/trajectory_eval", "Custom Pairwise Evaluator": "https://python.langchain.com/docs/guides/evaluation/comparison/custom", "Pairwise String Comparison": "https://python.langchain.com/docs/guides/evaluation/comparison/pairwise_string", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain"}, "AIMessage": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "OpenAI": "https://python.langchain.com/docs/integrations/chat/openai", "JinaChat": "https://python.langchain.com/docs/integrations/chat/jinachat"}, "CallbackManager": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "Llama-cpp": "https://python.langchain.com/docs/integrations/llms/llamacpp", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "StreamingStdOutCallbackHandler": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "GPT4All": "https://python.langchain.com/docs/integrations/llms/gpt4all", "Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Llama-cpp": "https://python.langchain.com/docs/integrations/llms/llamacpp", "C Transformers": "https://python.langchain.com/docs/integrations/llms/ctransformers", "Huggingface TextGen Inference": "https://python.langchain.com/docs/integrations/llms/huggingface_textgen_inference", "Replicate": "https://python.langchain.com/docs/integrations/llms/replicate", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "create_tagging_chain": {"Llama API": "https://python.langchain.com/docs/integrations/chat/llama_api", "Tagging": "https://python.langchain.com/docs/modules/chains/additional/tagging"}, "ChatVertexAI": {"Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/chat/google_vertex_ai_palm"}, "JinaChat": {"JinaChat": "https://python.langchain.com/docs/integrations/chat/jinachat"}, "AzureChatOpenAI": {"Azure": "https://python.langchain.com/docs/integrations/chat/azure_chat_openai", "Azure OpenAI": "https://python.langchain.com/docs/integrations/providers/azure_openai"}, "PromptLayerChatOpenAI": {"PromptLayer ChatOpenAI": "https://python.langchain.com/docs/integrations/chat/promptlayer_chatopenai"}, "ContextCallbackHandler": {"Context": "https://python.langchain.com/docs/integrations/callbacks/context"}, "ArgillaCallbackHandler": {"Argilla": "https://python.langchain.com/docs/integrations/providers/argilla"}, "PromptLayerCallbackHandler": {"PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer"}, "GPT4All": {"PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer", "GPT4All": "https://python.langchain.com/docs/integrations/llms/gpt4all", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa"}, "StreamlitCallbackHandler": {"Streamlit": "https://python.langchain.com/docs/integrations/callbacks/streamlit", "GPT4All": "https://python.langchain.com/docs/integrations/providers/gpt4all"}, "FigmaFileLoader": {"Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma"}, "AzureOpenAI": {"Azure OpenAI": "https://python.langchain.com/docs/integrations/llms/azure_openai_example", "OpenAI": "https://python.langchain.com/docs/integrations/providers/openai"}, "MyScale": {"MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query"}, "Baseten": {"Baseten": "https://python.langchain.com/docs/integrations/llms/baseten"}, "WeatherDataLoader": {"Weather": "https://python.langchain.com/docs/integrations/document_loaders/weather"}, "Tair": {"Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair"}, "UnstructuredWordDocumentLoader": {"Microsoft Word": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_word"}, "CollegeConfidentialLoader": {"College Confidential": "https://python.langchain.com/docs/integrations/document_loaders/college_confidential"}, "RWKV": {"RWKV-4": "https://python.langchain.com/docs/integrations/providers/rwkv"}, "GoogleDriveLoader": {"Google Drive": "https://python.langchain.com/docs/integrations/document_loaders/google_drive"}, "AmazonAPIGateway": {"Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example"}, "UnstructuredPowerPointLoader": {"Microsoft PowerPoint": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_powerpoint"}, "wandb_tracing_enabled": {"WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing"}, "CometCallbackHandler": {"Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking"}, "CTransformers": {"C Transformers": "https://python.langchain.com/docs/integrations/llms/ctransformers"}, "BiliBiliLoader": {"BiliBili": "https://python.langchain.com/docs/integrations/document_loaders/bilibili"}, "DiffbotLoader": {"Diffbot": "https://python.langchain.com/docs/integrations/document_loaders/diffbot"}, "AimCallbackHandler": {"Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking"}, "ModernTreasuryLoader": {"Modern Treasury": "https://python.langchain.com/docs/integrations/document_loaders/modern_treasury"}, "FacebookChatLoader": {"Facebook Chat": "https://python.langchain.com/docs/integrations/document_loaders/facebook_chat"}, "Banana": {"Banana": "https://python.langchain.com/docs/integrations/llms/banana"}, "HuggingFacePipeline": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface", "RELLM": "https://python.langchain.com/docs/integrations/llms/rellm_experimental", "JSONFormer": "https://python.langchain.com/docs/integrations/llms/jsonformer_experimental"}, "HuggingFaceHub": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface"}, "HuggingFaceHubEmbeddings": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface"}, "CharacterTextSplitter": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface", "OpenAI": "https://python.langchain.com/docs/integrations/providers/openai", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb", "Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Rockset": "https://python.langchain.com/docs/integrations/vectorstores/rockset", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz", "SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense", "Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Alibaba Cloud OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Clarifai": "https://python.langchain.com/docs/integrations/vectorstores/clarifai", "scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn", "DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw", "MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse", "Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris", "AwaDB": "https://python.langchain.com/docs/integrations/vectorstores/awadb", "Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase", "OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch", "Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch", "Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra", "Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo", "DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb", "Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres", "MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Manifest": "https://python.langchain.com/docs/integrations/llms/manifest", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "DocugamiLoader": {"Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami"}, "GutenbergLoader": {"Gutenberg": "https://python.langchain.com/docs/integrations/document_loaders/gutenberg"}, "AzureBlobStorageContainerLoader": {"Azure Blob Storage": "https://python.langchain.com/docs/integrations/providers/azure_blob_storage", "Azure Blob Storage Container": "https://python.langchain.com/docs/integrations/document_loaders/azure_blob_storage_container"}, "AzureBlobStorageFileLoader": {"Azure Blob Storage": "https://python.langchain.com/docs/integrations/providers/azure_blob_storage", "Azure Blob Storage File": "https://python.langchain.com/docs/integrations/document_loaders/azure_blob_storage_file"}, "WikipediaLoader": {"Wikipedia": "https://python.langchain.com/docs/integrations/document_loaders/wikipedia"}, "ConfluenceLoader": {"Confluence": "https://python.langchain.com/docs/integrations/document_loaders/confluence"}, "Predibase": {"Predibase": "https://python.langchain.com/docs/integrations/llms/predibase"}, "Beam": {"Beam": "https://python.langchain.com/docs/integrations/llms/beam"}, "GrobidParser": {"Grobid": "https://python.langchain.com/docs/integrations/document_loaders/grobid"}, "GenericLoader": {"Grobid": "https://python.langchain.com/docs/integrations/document_loaders/grobid", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Source Code": "https://python.langchain.com/docs/integrations/document_loaders/source_code"}, "Typesense": {"Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense"}, "Hologres": {"Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres"}, "AI21": {"AI21 Labs": "https://python.langchain.com/docs/integrations/providers/ai21", "AI21": "https://python.langchain.com/docs/integrations/llms/ai21"}, "WandbCallbackHandler": {"Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking"}, "ObsidianLoader": {"Obsidian": "https://python.langchain.com/docs/integrations/document_loaders/obsidian"}, "create_sql_agent": {"CnosDB": "https://python.langchain.com/docs/integrations/providers/cnosdb", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database"}, "SQLDatabaseToolkit": {"CnosDB": "https://python.langchain.com/docs/integrations/providers/cnosdb", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions"}, "OpenAIModerationChain": {"OpenAI": "https://python.langchain.com/docs/integrations/providers/openai"}, "ChatGPTLoader": {"OpenAI": "https://python.langchain.com/docs/integrations/providers/openai", "ChatGPT Data": "https://python.langchain.com/docs/integrations/document_loaders/chatgpt_loader"}, "AZLyricsLoader": {"AZLyrics": "https://python.langchain.com/docs/integrations/document_loaders/azlyrics"}, "ToMarkdownLoader": {"2Markdown": "https://python.langchain.com/docs/integrations/document_loaders/tomarkdown"}, "GitLoader": {"Git": "https://python.langchain.com/docs/integrations/document_loaders/git"}, "InfinoCallbackHandler": {"Infino": "https://python.langchain.com/docs/integrations/providers/infino"}, "MlflowAIGateway": {"MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway"}, "MlflowAIGatewayEmbeddings": {"MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway"}, "ChatMLflowAIGateway": {"MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway"}, "SingleStoreDB": {"SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb"}, "Tigris": {"Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris"}, "S3DirectoryLoader": {"AWS S3 Directory": "https://python.langchain.com/docs/integrations/document_loaders/aws_s3_directory"}, "TransformChain": {"Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "Transformation": "https://python.langchain.com/docs/modules/chains/foundational/transformation"}, "SQLDatabase": {"Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database"}, "Weaviate": {"Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query"}, "AirbyteJSONLoader": {"Airbyte": "https://python.langchain.com/docs/integrations/providers/airbyte", "Airbyte JSON": "https://python.langchain.com/docs/integrations/document_loaders/airbyte_json"}, "TelegramChatFileLoader": {"Telegram": "https://python.langchain.com/docs/integrations/document_loaders/telegram"}, "TelegramChatApiLoader": {"Telegram": "https://python.langchain.com/docs/integrations/providers/telegram"}, "PredictionGuard": {"Prediction Guard": "https://python.langchain.com/docs/integrations/llms/predictionguard"}, "NotionDirectoryLoader": {"Notion DB": "https://python.langchain.com/docs/integrations/providers/notion", "Notion DB 1/2": "https://python.langchain.com/docs/integrations/document_loaders/notion", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA"}, "NotionDBLoader": {"Notion DB": "https://python.langchain.com/docs/integrations/providers/notion", "Notion DB 2/2": "https://python.langchain.com/docs/integrations/document_loaders/notiondb"}, "MWDumpLoader": {"MediaWikiDump": "https://python.langchain.com/docs/integrations/document_loaders/mediawikidump"}, "BraveSearchLoader": {"Brave Search": "https://python.langchain.com/docs/integrations/document_loaders/brave_search"}, "StarRocks": {"StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks"}, "DatadogLogsLoader": {"Datadog Logs": "https://python.langchain.com/docs/integrations/document_loaders/datadog_logs"}, "ApifyDatasetLoader": {"Apify": "https://python.langchain.com/docs/integrations/providers/apify", "Apify Dataset": "https://python.langchain.com/docs/integrations/document_loaders/apify_dataset"}, "NLPCloud": {"NLPCloud": "https://python.langchain.com/docs/integrations/providers/nlpcloud", "NLP Cloud": "https://python.langchain.com/docs/integrations/llms/nlpcloud"}, "Milvus": {"Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz"}, "Qdrant": {"Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query"}, "GitbookLoader": {"GitBook": "https://python.langchain.com/docs/integrations/document_loaders/gitbook"}, "OpenSearchVectorSearch": {"OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch"}, "Pinecone": {"Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone"}, "UnstructuredFileLoader": {"Unstructured": "https://python.langchain.com/docs/integrations/providers/unstructured", "Unstructured File": "https://python.langchain.com/docs/integrations/document_loaders/unstructured_file"}, "SelfHostedPipeline": {"Runhouse": "https://python.langchain.com/docs/integrations/llms/runhouse"}, "MlflowCallbackHandler": {"MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking"}, "SpreedlyLoader": {"Spreedly": "https://python.langchain.com/docs/integrations/document_loaders/spreedly"}, "OpenLLM": {"OpenLLM": "https://python.langchain.com/docs/integrations/llms/openllm"}, "SearxSearchResults": {"SearxNG Search API": "https://python.langchain.com/docs/integrations/providers/searx"}, "Modal": {"Modal": "https://python.langchain.com/docs/integrations/llms/modal"}, "IFixitLoader": {"iFixit": "https://python.langchain.com/docs/integrations/document_loaders/ifixit"}, "AlephAlpha": {"Aleph Alpha": "https://python.langchain.com/docs/integrations/llms/aleph_alpha"}, "PipelineAI": {"PipelineAI": "https://python.langchain.com/docs/integrations/llms/pipelineai_example"}, "LlamaCpp": {"Llama.cpp": "https://python.langchain.com/docs/integrations/providers/llamacpp", "Llama-cpp": "https://python.langchain.com/docs/integrations/llms/llamacpp", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "AwaDB": {"AwaDB": "https://python.langchain.com/docs/integrations/vectorstores/awadb"}, "ArxivLoader": {"Arxiv": "https://python.langchain.com/docs/integrations/document_loaders/arxiv"}, "Anyscale": {"Anyscale": "https://python.langchain.com/docs/integrations/llms/anyscale"}, "StripeLoader": {"Stripe": "https://python.langchain.com/docs/integrations/document_loaders/stripe"}, "BlackboardLoader": {"Blackboard": "https://python.langchain.com/docs/integrations/document_loaders/blackboard"}, "WhatsAppChatLoader": {"WhatsApp": "https://python.langchain.com/docs/integrations/providers/whatsapp", "WhatsApp Chat": "https://python.langchain.com/docs/integrations/document_loaders/whatsapp_chat"}, "LanceDB": {"LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb"}, "OneDriveLoader": {"Microsoft OneDrive": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_onedrive"}, "AnalyticDB": {"AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb"}, "YoutubeLoader": {"YouTube": "https://python.langchain.com/docs/integrations/providers/youtube", "YouTube transcripts": "https://python.langchain.com/docs/integrations/document_loaders/youtube_transcript"}, "GoogleApiYoutubeLoader": {"YouTube": "https://python.langchain.com/docs/integrations/providers/youtube"}, "PromptLayerOpenAI": {"PromptLayer": "https://python.langchain.com/docs/integrations/providers/promptlayer", "PromptLayer OpenAI": "https://python.langchain.com/docs/integrations/llms/promptlayer_openai"}, "DeepLake": {"Deep Lake": "https://python.langchain.com/docs/integrations/providers/deeplake", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query"}, "WhyLabsCallbackHandler": {"WhyLabs": "https://python.langchain.com/docs/integrations/providers/whylabs_profiling"}, "FlyteCallbackHandler": {"Flyte": "https://python.langchain.com/docs/integrations/providers/flyte"}, "ManifestWrapper": {"Hazy Research": "https://python.langchain.com/docs/integrations/providers/hazy_research", "Manifest": "https://python.langchain.com/docs/integrations/llms/manifest"}, "Marqo": {"Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo"}, "IMSDbLoader": {"IMSDb": "https://python.langchain.com/docs/integrations/document_loaders/imsdb"}, "PGVector": {"PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector"}, "DeepInfra": {"DeepInfra": "https://python.langchain.com/docs/integrations/llms/deepinfra_example"}, "AgentExecutor": {"Jina": "https://python.langchain.com/docs/integrations/providers/jina", "PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter"}, "RedditPostsLoader": {"Reddit": "https://python.langchain.com/docs/integrations/document_loaders/reddit"}, "TrelloLoader": {"Trello": "https://python.langchain.com/docs/integrations/document_loaders/trello"}, "AtlasDB": {"AtlasDB": "https://python.langchain.com/docs/integrations/providers/atlas", "Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas"}, "SKLearnVectorStore": {"scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn"}, "EverNoteLoader": {"EverNote": "https://python.langchain.com/docs/integrations/document_loaders/evernote"}, "TwitterTweetLoader": {"Twitter": "https://python.langchain.com/docs/integrations/document_loaders/twitter"}, "DiscordChatLoader": {"Discord": "https://python.langchain.com/docs/integrations/document_loaders/discord"}, "RedisCache": {"Redis": "https://python.langchain.com/docs/integrations/providers/redis", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "RedisSemanticCache": {"Redis": "https://python.langchain.com/docs/integrations/providers/redis", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "Redis": {"Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis"}, "SelfQueryRetriever": {"Chroma": "https://python.langchain.com/docs/integrations/providers/chroma", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query"}, "ClearMLCallbackHandler": {"ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking"}, "StdOutCallbackHandler": {"ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain"}, "Cohere": {"Cohere": "https://python.langchain.com/docs/integrations/llms/cohere"}, "SlackDirectoryLoader": {"Slack": "https://python.langchain.com/docs/integrations/document_loaders/slack"}, "LLMContentHandler": {"SageMaker Endpoint": "https://python.langchain.com/docs/integrations/providers/sagemaker_endpoint", "SageMakerEndpoint": "https://python.langchain.com/docs/integrations/llms/sagemaker"}, "ContentHandlerBase": {"SageMaker Endpoint": "https://python.langchain.com/docs/integrations/providers/sagemaker_endpoint"}, "HNLoader": {"Hacker News": "https://python.langchain.com/docs/integrations/document_loaders/hacker_news"}, "Annoy": {"Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy"}, "GCSDirectoryLoader": {"Google Cloud Storage": "https://python.langchain.com/docs/integrations/providers/google_cloud_storage", "Google Cloud Storage Directory": "https://python.langchain.com/docs/integrations/document_loaders/google_cloud_storage_directory"}, "GCSFileLoader": {"Google Cloud Storage": "https://python.langchain.com/docs/integrations/providers/google_cloud_storage", "Google Cloud Storage File": "https://python.langchain.com/docs/integrations/document_loaders/google_cloud_storage_file"}, "ArthurCallbackHandler": {"Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking"}, "DuckDBLoader": {"DuckDB": "https://python.langchain.com/docs/integrations/document_loaders/duckdb"}, "Petals": {"Petals": "https://python.langchain.com/docs/integrations/llms/petals_example"}, "MomentoCache": {"Momento": "https://python.langchain.com/docs/integrations/providers/momento", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "AirtableLoader": {"Airtable": "https://python.langchain.com/docs/integrations/document_loaders/airtable"}, "Clarifai": {"Clarifai": "https://python.langchain.com/docs/integrations/llms/clarifai"}, "BigQueryLoader": {"Google BigQuery": "https://python.langchain.com/docs/integrations/document_loaders/google_bigquery"}, "RoamLoader": {"Roam": "https://python.langchain.com/docs/integrations/document_loaders/roam"}, "Portkey": {"Log, Trace, and Monitor Langchain LLM Calls": "https://python.langchain.com/docs/integrations/providers/portkey/logging_tracing_portkey", "Portkey": "https://python.langchain.com/docs/integrations/providers/portkey/index"}, "Vectara": {"Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation"}, "VectaraRetriever": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat"}, "load_qa_chain": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "SageMakerEndpoint": "https://python.langchain.com/docs/integrations/llms/sagemaker", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs"}, "CONDENSE_QUESTION_PROMPT": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat"}, "load_qa_with_sources_chain": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat"}, "create_csv_agent": {"CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv"}, "create_xorbits_agent": {"Xorbits Agent": "https://python.langchain.com/docs/integrations/toolkits/xorbits"}, "JiraToolkit": {"Jira": "https://python.langchain.com/docs/integrations/toolkits/jira"}, "JiraAPIWrapper": {"Jira": "https://python.langchain.com/docs/integrations/toolkits/jira"}, "create_spark_dataframe_agent": {"Spark Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/spark"}, "PyPDFLoader": {"Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "MergeDocLoader": "https://python.langchain.com/docs/integrations/document_loaders/merge_doc_loader", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat"}, "create_python_agent": {"Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python"}, "PythonREPLTool": {"Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python"}, "create_pbi_agent": {"PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi"}, "PowerBIToolkit": {"PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi"}, "PowerBIDataset": {"PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi"}, "AzureCognitiveServicesToolkit": {"Azure Cognitive Services Toolkit": "https://python.langchain.com/docs/integrations/toolkits/azure_cognitive_services"}, "Requests": {"Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "APIOperation": {"Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla"}, "NLAToolkit": {"Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval"}, "GmailToolkit": {"Gmail Toolkit": "https://python.langchain.com/docs/integrations/toolkits/gmail"}, "build_resource_service": {"Gmail Toolkit": "https://python.langchain.com/docs/integrations/toolkits/gmail"}, "create_json_agent": {"JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json"}, "JsonToolkit": {"JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json"}, "JsonSpec": {"JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "GitHubToolkit": {"GitHub": "https://python.langchain.com/docs/integrations/toolkits/github"}, "GitHubAPIWrapper": {"GitHub": "https://python.langchain.com/docs/integrations/toolkits/github"}, "create_spark_sql_agent": {"Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql"}, "SparkSQLToolkit": {"Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql"}, "SparkSQL": {"Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql"}, "O365Toolkit": {"Office365 Toolkit": "https://python.langchain.com/docs/integrations/toolkits/office365"}, "create_pandas_dataframe_agent": {"Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "MultionClientTool": {"Multion Toolkit": "https://python.langchain.com/docs/integrations/toolkits/multion"}, "AmadeusToolkit": {"Amadeus Toolkit": "https://python.langchain.com/docs/integrations/toolkits/amadeus"}, "WebBaseLoader": {"Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "WebBaseLoader": "https://python.langchain.com/docs/integrations/document_loaders/web_base", "MergeDocLoader": "https://python.langchain.com/docs/integrations/document_loaders/merge_doc_loader", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore"}, "reduce_openapi_spec": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "RequestsWrapper": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "create_openapi_agent": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "OpenAPIToolkit": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "RetrievalQAWithSourcesChain": {"Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "MatchingEngine": {"MatchingEngine": "https://python.langchain.com/docs/integrations/vectorstores/matchingengine"}, "OpenAIChat": {"Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake"}, "InMemoryDocstore": {"Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters"}, "SpacyTextSplitter": {"Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas", "Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "SentenceTransformerEmbeddings": {"Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma"}, "StarRocksSettings": {"StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks"}, "DirectoryLoader": {"StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks"}, "DocArrayHnswSearch": {"DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw"}, "Clickhouse": {"ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse"}, "SupabaseVectorStore": {"Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase"}, "AzureSearch": {"Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch"}, "Cassandra": {"Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra"}, "ElasticVectorSearch": {"ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs"}, "ElasticKnnSearch": {"ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch"}, "DocArrayInMemorySearch": {"DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory"}, "PGEmbedding": {"pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding"}, "MongoDBAtlasVectorSearch": {"MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas"}, "create_metadata_tagger": {"OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger"}, "ChatPromptTemplate": {"OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Using OpenAI functions": "https://python.langchain.com/docs/modules/chains/popular/openai_functions", "Extraction": "https://python.langchain.com/docs/modules/chains/additional/extraction", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Tagging": "https://python.langchain.com/docs/modules/chains/additional/tagging"}, "AsyncHtmlLoader": {"html2text": "https://python.langchain.com/docs/integrations/document_transformers/html2text", "AsyncHtmlLoader": "https://python.langchain.com/docs/integrations/document_loaders/async_html"}, "Html2TextTransformer": {"html2text": "https://python.langchain.com/docs/integrations/document_transformers/html2text"}, "DoctranPropertyExtractor": {"Doctran Extract Properties": "https://python.langchain.com/docs/integrations/document_transformers/doctran_extract_properties"}, "DoctranQATransformer": {"Doctran Interrogate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_interrogate_document"}, "DoctranTextTranslator": {"Doctran Translate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_translate_document"}, "SnowflakeLoader": {"Snowflake": "https://python.langchain.com/docs/integrations/document_loaders/snowflake"}, "AcreomLoader": {"acreom": "https://python.langchain.com/docs/integrations/document_loaders/acreom"}, "UnstructuredCSVLoader": {"CSV": "https://python.langchain.com/docs/integrations/document_loaders/csv"}, "XorbitsLoader": {"Xorbits Pandas DataFrame": "https://python.langchain.com/docs/integrations/document_loaders/xorbits"}, "UnstructuredEmailLoader": {"Email": "https://python.langchain.com/docs/integrations/document_loaders/email"}, "OutlookMessageLoader": {"Email": "https://python.langchain.com/docs/integrations/document_loaders/email"}, "RecursiveUrlLoader": {"Recursive URL Loader": "https://python.langchain.com/docs/integrations/document_loaders/recursive_url_loader"}, "JoplinLoader": {"Joplin": "https://python.langchain.com/docs/integrations/document_loaders/joplin"}, "EtherscanLoader": {"Etherscan Loader": "https://python.langchain.com/docs/integrations/document_loaders/Etherscan"}, "Docx2txtLoader": {"Microsoft Word": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_word"}, "OpenAIWhisperParser": {"Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio"}, "YoutubeAudioLoader": {"Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio"}, "UnstructuredURLLoader": {"URL": "https://python.langchain.com/docs/integrations/document_loaders/url"}, "SeleniumURLLoader": {"URL": "https://python.langchain.com/docs/integrations/document_loaders/url"}, "PlaywrightURLLoader": {"URL": "https://python.langchain.com/docs/integrations/document_loaders/url"}, "OpenCityDataLoader": {"Geopandas": "https://python.langchain.com/docs/integrations/document_loaders/geopandas", "Open City Data": "https://python.langchain.com/docs/integrations/document_loaders/open_city_data"}, "GeoDataFrameLoader": {"Geopandas": "https://python.langchain.com/docs/integrations/document_loaders/geopandas"}, "HuggingFaceDatasetLoader": {"HuggingFace dataset": "https://python.langchain.com/docs/integrations/document_loaders/hugging_face_dataset"}, "MHTMLLoader": {"mhtml": "https://python.langchain.com/docs/integrations/document_loaders/mhtml"}, "RocksetLoader": {"Rockset": "https://python.langchain.com/docs/integrations/document_loaders/rockset"}, "ImageCaptionLoader": {"Image captions": "https://python.langchain.com/docs/integrations/document_loaders/image_captions"}, "UnstructuredRSTLoader": {"RST": "https://python.langchain.com/docs/integrations/document_loaders/rst"}, "ConversationBufferWindowMemory": {"Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Meta-Prompt": "https://python.langchain.com/docs/use_cases/autonomous_agents/meta_prompt", "Voice Assistant": "https://python.langchain.com/docs/use_cases/chatbots/voice_assistant", "Create ChatGPT clone": "https://python.langchain.com/docs/modules/agents/how_to/chatgpt_clone"}, "UnstructuredImageLoader": {"Images": "https://python.langchain.com/docs/integrations/document_loaders/image"}, "TencentCOSFileLoader": {"Tencent COS File": "https://python.langchain.com/docs/integrations/document_loaders/tencent_cos_file"}, "TomlLoader": {"TOML": "https://python.langchain.com/docs/integrations/document_loaders/toml"}, "UnstructuredAPIFileLoader": {"Unstructured File": "https://python.langchain.com/docs/integrations/document_loaders/unstructured_file"}, "PsychicLoader": {"Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic"}, "TencentCOSDirectoryLoader": {"Tencent COS Directory": "https://python.langchain.com/docs/integrations/document_loaders/tencent_cos_directory"}, "GitHubIssuesLoader": {"GitHub": "https://python.langchain.com/docs/integrations/document_loaders/github"}, "UnstructuredOrgModeLoader": {"Org-mode": "https://python.langchain.com/docs/integrations/document_loaders/org_mode"}, "LarkSuiteDocLoader": {"LarkSuite (FeiShu)": "https://python.langchain.com/docs/integrations/document_loaders/larksuite"}, "load_summarize_chain": {"LarkSuite (FeiShu)": "https://python.langchain.com/docs/integrations/document_loaders/larksuite", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Summarization": "https://python.langchain.com/docs/use_cases/summarization"}, "IuguLoader": {"Iugu": "https://python.langchain.com/docs/integrations/document_loaders/iugu"}, "UnstructuredEPubLoader": {"EPub ": "https://python.langchain.com/docs/integrations/document_loaders/epub"}, "AttributeInfo": {"Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query"}, "UnstructuredFileIOLoader": {"Google Drive": "https://python.langchain.com/docs/integrations/document_loaders/google_drive"}, "BrowserlessLoader": {"Browserless": "https://python.langchain.com/docs/integrations/document_loaders/browserless"}, "BibtexLoader": {"BibTeX": "https://python.langchain.com/docs/integrations/document_loaders/bibtex"}, "ReadTheDocsLoader": {"ReadTheDocs Documentation": "https://python.langchain.com/docs/integrations/document_loaders/readthedocs_documentation"}, "DataFrameLoader": {"Pandas DataFrame": "https://python.langchain.com/docs/integrations/document_loaders/pandas_dataframe"}, "GoogleApiClient": {"YouTube transcripts": "https://python.langchain.com/docs/integrations/document_loaders/youtube_transcript"}, "NotebookLoader": {"Jupyter Notebook": "https://python.langchain.com/docs/integrations/document_loaders/jupyter_notebook", "Notebook": "https://python.langchain.com/docs/integrations/document_loaders/example_data/notebook"}, "UnstructuredTSVLoader": {"TSV": "https://python.langchain.com/docs/integrations/document_loaders/tsv"}, "UnstructuredODTLoader": {"Open Document Format (ODT)": "https://python.langchain.com/docs/integrations/document_loaders/odt"}, "EmbaasBlobLoader": {"Embaas": "https://python.langchain.com/docs/integrations/document_loaders/embaas"}, "Blob": {"Embaas": "https://python.langchain.com/docs/integrations/document_loaders/embaas"}, "EmbaasLoader": {"Embaas": "https://python.langchain.com/docs/integrations/document_loaders/embaas"}, "UnstructuredXMLLoader": {"XML": "https://python.langchain.com/docs/integrations/document_loaders/xml"}, "MaxComputeLoader": {"Alibaba Cloud MaxCompute": "https://python.langchain.com/docs/integrations/document_loaders/alibaba_cloud_maxcompute"}, "CubeSemanticLoader": {"Cube Semantic Layer": "https://python.langchain.com/docs/integrations/document_loaders/cube_semantic"}, "UnstructuredExcelLoader": {"Microsoft Excel": "https://python.langchain.com/docs/integrations/document_loaders/excel"}, "Language": {"Source Code": "https://python.langchain.com/docs/integrations/document_loaders/source_code"}, "LanguageParser": {"Source Code": "https://python.langchain.com/docs/integrations/document_loaders/source_code"}, "SRTLoader": {"Subtitle": "https://python.langchain.com/docs/integrations/document_loaders/subtitle"}, "MastodonTootsLoader": {"Mastodon": "https://python.langchain.com/docs/integrations/document_loaders/mastodon"}, "MergedDataLoader": {"MergeDocLoader": "https://python.langchain.com/docs/integrations/document_loaders/merge_doc_loader"}, "PySparkDataFrameLoader": {"PySpark DataFrame Loader": "https://python.langchain.com/docs/integrations/document_loaders/pyspark_dataframe"}, "CoNLLULoader": {"CoNLL-U": "https://python.langchain.com/docs/integrations/document_loaders/conll-u"}, "FaunaLoader": {"Fauna": "https://python.langchain.com/docs/integrations/document_loaders/fauna"}, "SitemapLoader": {"Sitemap": "https://python.langchain.com/docs/integrations/document_loaders/sitemap"}, "S3FileLoader": {"AWS S3 File": "https://python.langchain.com/docs/integrations/document_loaders/aws_s3_file"}, "SimpleSequentialChain": {"Baseten": "https://python.langchain.com/docs/integrations/llms/baseten", "Predibase": "https://python.langchain.com/docs/integrations/llms/predibase", "Replicate": "https://python.langchain.com/docs/integrations/llms/replicate"}, "StochasticAI": {"StochasticAI": "https://python.langchain.com/docs/integrations/llms/stochasticai"}, "ForefrontAI": {"ForefrontAI": "https://python.langchain.com/docs/integrations/llms/forefrontai_example"}, "CerebriumAI": {"CerebriumAI": "https://python.langchain.com/docs/integrations/llms/cerebriumai_example"}, "OctoAIEndpoint": {"OctoAI Compute Service": "https://python.langchain.com/docs/integrations/llms/octoai"}, "Writer": {"Writer": "https://python.langchain.com/docs/integrations/llms/writer"}, "TextGen": {"TextGen": "https://python.langchain.com/docs/integrations/llms/textgen"}, "MosaicML": {"MosaicML": "https://python.langchain.com/docs/integrations/llms/mosaicml"}, "KoboldApiLLM": {"KoboldAI API": "https://python.langchain.com/docs/integrations/llms/koboldai"}, "VertexAI": {"Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/llms/google_vertex_ai_palm"}, "Bedrock": {"Bedrock": "https://python.langchain.com/docs/integrations/llms/bedrock"}, "GooseAI": {"GooseAI": "https://python.langchain.com/docs/integrations/llms/gooseai_example"}, "Databricks": {"Databricks": "https://python.langchain.com/docs/integrations/llms/databricks"}, "MapReduceChain": {"Manifest": "https://python.langchain.com/docs/integrations/llms/manifest", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "ModelLaboratory": {"Manifest": "https://python.langchain.com/docs/integrations/llms/manifest", "Model Comparison": "https://python.langchain.com/docs/guides/model_laboratory"}, "RELLM": {"RELLM": "https://python.langchain.com/docs/integrations/llms/rellm_experimental"}, "Tongyi": {"Tongyi Qwen": "https://python.langchain.com/docs/integrations/llms/tongyi"}, "InMemoryCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "SQLiteCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "GPTCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "SQLAlchemyCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "AzureMLOnlineEndpoint": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example"}, "DollyContentFormatter": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example"}, "load_llm": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example", "Serialization": "https://python.langchain.com/docs/modules/model_io/models/llms/llm_serialization"}, "AzureMLEndpointClient": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example"}, "OpenLM": {"OpenLM": "https://python.langchain.com/docs/integrations/llms/openlm"}, "HuggingFaceTextGenInference": {"Huggingface TextGen Inference": "https://python.langchain.com/docs/integrations/llms/huggingface_textgen_inference"}, "ChatGLM": {"ChatGLM": "https://python.langchain.com/docs/integrations/llms/chatglm"}, "tool": {"JSONFormer": "https://python.langchain.com/docs/integrations/llms/jsonformer_experimental", "Agent Trajectory": "https://python.langchain.com/docs/guides/evaluation/trajectory/trajectory_eval", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools"}, "JsonFormer": {"JSONFormer": "https://python.langchain.com/docs/integrations/llms/jsonformer_experimental"}, "Replicate": {"Replicate": "https://python.langchain.com/docs/integrations/llms/replicate"}, "tracing_v2_enabled": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough"}, "wait_for_all_tracers": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough"}, "EvaluatorType": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain"}, "RunEvalConfig": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough"}, "load_dataset": {"Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "SQL Question Answering Benchmarking: Chinook": "https://python.langchain.com/docs/guides/evaluation/examples/sql_qa_benchmarking_chinook", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg"}, "QAEvalChain": {"Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "SQL Question Answering Benchmarking: Chinook": "https://python.langchain.com/docs/guides/evaluation/examples/sql_qa_benchmarking_chinook", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg"}, "QAGenerationChain": {"QA Generation": "https://python.langchain.com/docs/guides/evaluation/examples/qa_generation"}, "OpenAPISpec": {"Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "OpenAPIEndpointChain": {"Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "QAGenerateChain": {"Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering"}, "load_evaluator": {"Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent Trajectory": "https://python.langchain.com/docs/guides/evaluation/trajectory/trajectory_eval", "Pairwise Embedding Distance ": "https://python.langchain.com/docs/guides/evaluation/comparison/pairwise_embedding_distance", "Pairwise String Comparison": "https://python.langchain.com/docs/guides/evaluation/comparison/pairwise_string", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain", "QA Correctness": "https://python.langchain.com/docs/guides/evaluation/string/qa", "String Distance": "https://python.langchain.com/docs/guides/evaluation/string/string_distance", "Embedding Distance": "https://python.langchain.com/docs/guides/evaluation/string/embedding_distance"}, "ContextQAEvalChain": {"Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering"}, "AgentAction": {"Custom Trajectory Evaluator": "https://python.langchain.com/docs/guides/evaluation/trajectory/custom", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Wikibase Agent": "https://python.langchain.com/docs/use_cases/agents/wikibase_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Custom multi-action agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_multi_action_agent", "Custom agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval"}, "AgentTrajectoryEvaluator": {"Custom Trajectory Evaluator": "https://python.langchain.com/docs/guides/evaluation/trajectory/custom"}, "EmbeddingDistance": {"Pairwise Embedding Distance ": "https://python.langchain.com/docs/guides/evaluation/comparison/pairwise_embedding_distance", "Embedding Distance": "https://python.langchain.com/docs/guides/evaluation/string/embedding_distance"}, "PairwiseStringEvaluator": {"Custom Pairwise Evaluator": "https://python.langchain.com/docs/guides/evaluation/comparison/custom"}, "Criteria": {"Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain"}, "SQL_PROMPT": {"QA Correctness": "https://python.langchain.com/docs/guides/evaluation/string/qa"}, "StringEvaluator": {"Custom String Evaluator": "https://python.langchain.com/docs/guides/evaluation/string/custom"}, "StringDistance": {"String Distance": "https://python.langchain.com/docs/guides/evaluation/string/string_distance"}, "WriteFileTool": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "ReadFileTool": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "AutoGPT": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "FileChatMessageHistory": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt"}, "BaseLLM": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context"}, "VectorStore": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent"}, "Chain": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain"}, "BabyAGI": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/autonomous_agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/autonomous_agents/baby_agi_with_agent"}, "ZeroShotAgent": {"BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db", "How to add Memory to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory", "Custom MRKL agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent", "Shared memory across agents and tools": "https://python.langchain.com/docs/modules/agents/how_to/sharedmemory_for_tools"}, "BaseTool": {"!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent"}, "MarkdownHeaderTextSplitter": {"Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "MarkdownHeaderTextSplitter": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/markdown_header_metadata"}, "MultiQueryRetriever": {"QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever"}, "StringPromptTemplate": {"Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Wikibase Agent": "https://python.langchain.com/docs/use_cases/agents/wikibase_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Custom prompt template": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/custom_prompt_template"}, "AIPlugin": {"Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval"}, "AgentOutputParser": {"SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context"}, "SteamshipImageGenerationTool": {"Multi-modal outputs: Image & Text": "https://python.langchain.com/docs/use_cases/multi_modal/image_agent"}, "RegexParser": {"Multi-Agent Simulated Environment: Petting Zoo": "https://python.langchain.com/docs/use_cases/agent_simulations/petting_zoo", "Multi-agent decentralized speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_bidding", "Multi-agent authoritarian speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_authoritarian", "Simulated Environment: Gymnasium": "https://python.langchain.com/docs/use_cases/agent_simulations/gymnasium"}, "TimeWeightedVectorStoreRetriever": {"Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters"}, "PydanticOutputParser": {"MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Pydantic (JSON) parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic"}, "WebResearchRetriever": {"WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "TokenTextSplitter": {"Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "SentenceTransformersTokenTextSplitter": {"Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "NLTKTextSplitter": {"Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "StuffDocumentsChain": {"Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "ChatMessageHistory": {"Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db"}, "BaseMemory": {"How to create a custom Memory class": "https://python.langchain.com/docs/modules/memory/custom_memory"}, "ConversationKGMemory": {"Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg"}, "ConversationTokenBufferMemory": {"ConversationTokenBufferMemory": "https://python.langchain.com/docs/modules/memory/token_buffer"}, "SystemMessage": {"How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "ConversationSummaryBufferMemory": {"ConversationSummaryBufferMemory": "https://python.langchain.com/docs/modules/memory/summary_buffer"}, "BaseCallbackHandler": {"Custom callback handlers": "https://python.langchain.com/docs/modules/callbacks/custom_callbacks", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only"}, "tracing_enabled": {"Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks"}, "get_openai_callback": {"Token counting": "https://python.langchain.com/docs/modules/callbacks/token_counting", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking"}, "FileCallbackHandler": {"Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler"}, "LLMResult": {"Async callbacks": "https://python.langchain.com/docs/modules/callbacks/async_callbacks"}, "AsyncCallbackHandler": {"Async callbacks": "https://python.langchain.com/docs/modules/callbacks/async_callbacks"}, "StructuredTool": {"Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools"}, "ToolException": {"Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools"}, "MoveFileTool": {"Tools as OpenAI Functions": "https://python.langchain.com/docs/modules/agents/tools/tools_as_openai_functions"}, "RequestsGetTool": {"Tool Input Schema": "https://python.langchain.com/docs/modules/agents/tools/tool_input_validation"}, "HumanApprovalCallbackHandler": {"Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval"}, "DocstoreExplorer": {"ReAct document store": "https://python.langchain.com/docs/modules/agents/agent_types/react_docstore"}, "AgentFinish": {"Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter"}, "MessagesPlaceholder": {"Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Types of `MessagePromptTemplate`": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates"}, "LangChainTracer": {"Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent"}, "HumanInputChatModel": {"Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model"}, "FakeListLLM": {"Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm"}, "CallbackManagerForLLMRun": {"Custom LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/custom_llm"}, "LLM": {"Custom LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/custom_llm"}, "HumanInputLLM": {"Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "RetryWithErrorOutputParser": {"Retry parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/retry"}, "EnumOutputParser": {"Enum parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/enum"}, "DatetimeOutputParser": {"Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime"}, "FewShotPromptTemplate": {"Select by maximal marginal relevance (MMR)": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr", "Select by n-gram overlap": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/ngram_overlap"}, "BaseExampleSelector": {"Custom example selector": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/custom_example_selector"}, "NGramOverlapExampleSelector": {"Select by n-gram overlap": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/ngram_overlap"}, "SemanticSimilarityExampleSelector": {"Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat"}, "FewShotChatMessagePromptTemplate": {"Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat"}, "load_prompt": {"Serialization": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompt_serialization"}, "ChatMessagePromptTemplate": {"Types of `MessagePromptTemplate`": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates"}, "MultiPromptChain": {"Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "LLMRouterChain": {"Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "EmbeddingRouterChain": {"Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "BasePromptTemplate": {"Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain"}, "load_chain": {"Serialization": "https://python.langchain.com/docs/modules/chains/how_to/serialization", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub"}, "NeptuneGraph": {"Neptune Open Cypher QA Chain": "https://python.langchain.com/docs/modules/chains/additional/neptune_cypher_qa"}, "NeptuneOpenCypherQAChain": {"Neptune Open Cypher QA Chain": "https://python.langchain.com/docs/modules/chains/additional/neptune_cypher_qa"}, "LLMBashChain": {"Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash"}, "BashOutputParser": {"Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash"}, "BashProcess": {"Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash"}, "NebulaGraphQAChain": {"NebulaGraphQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_nebula_qa"}, "NebulaGraph": {"NebulaGraphQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_nebula_qa"}, "PALChain": {"Causal program-aided language (CPAL) chain": "https://python.langchain.com/docs/modules/chains/additional/cpal", "Program-aided language model (PAL) chain": "https://python.langchain.com/docs/modules/chains/additional/pal"}, "ElasticsearchDatabaseChain": {"Elasticsearch database": "https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database"}, "get_openapi_chain": {"OpenAPI calls with OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openapi_openai"}, "create_extraction_chain": {"Extraction": "https://python.langchain.com/docs/modules/chains/additional/extraction"}, "LLMSummarizationCheckerChain": {"Summarization checker chain": "https://python.langchain.com/docs/modules/chains/additional/llm_summarization_checker"}, "KuzuGraph": {"KuzuQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_kuzu_qa"}, "KuzuQAChain": {"KuzuQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_kuzu_qa"}, "create_qa_with_sources_chain": {"Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "create_qa_with_structure_chain": {"Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "HugeGraphQAChain": {"HugeGraph QA Chain": "https://python.langchain.com/docs/modules/chains/additional/graph_hugegraph_qa"}, "HugeGraph": {"HugeGraph QA Chain": "https://python.langchain.com/docs/modules/chains/additional/graph_hugegraph_qa"}, "GraphSparqlQAChain": {"GraphSparqlQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_sparql_qa"}, "RdfGraph": {"GraphSparqlQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_sparql_qa"}, "LLMRequestsChain": {"HTTP request chain": "https://python.langchain.com/docs/modules/chains/additional/llm_requests"}, "LLMSymbolicMathChain": {"LLM Symbolic Math ": "https://python.langchain.com/docs/modules/chains/additional/llm_symbolic_math"}, "create_citation_fuzzy_match_chain": {"Question-Answering Citations": "https://python.langchain.com/docs/modules/chains/additional/qa_citations"}, "BaseRetriever": {"FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "FlareChain": {"FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "ArangoGraph": {"ArangoDB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_arangodb_qa"}, "ArangoGraphQAChain": {"ArangoDB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_arangodb_qa"}, "GraphIndexCreator": {"Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "GraphQAChain": {"Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "NetworkxEntityGraph": {"Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "LLMCheckerChain": {"Self-checking chain": "https://python.langchain.com/docs/modules/chains/additional/llm_checker"}, "GraphCypherQAChain": {"Graph DB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_cypher_qa"}, "Neo4jGraph": {"Graph DB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_cypher_qa"}} \ No newline at end of file +{"DeepInfraEmbeddings": {"DeepInfra": "https://python.langchain.com/docs/integrations/text_embedding/deepinfra"}, "HuggingFaceEmbeddings": {"Hugging Face Hub": "https://python.langchain.com/docs/integrations/text_embedding/huggingfacehub", "Sentence Transformers Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/sentence_transformers", "LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever", "Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "Pairwise Embedding Distance ": "https://python.langchain.com/docs/modules/evaluation/comparison/pairwise_embedding_distance", "Embedding Distance": "https://python.langchain.com/docs/modules/evaluation/string/embedding_distance", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder"}, "GPT4AllEmbeddings": {"GPT4All": "https://python.langchain.com/docs/integrations/text_embedding/gpt4all", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "MosaicMLInstructorEmbeddings": {"MosaicML embeddings": "https://python.langchain.com/docs/integrations/text_embedding/mosaicml"}, "OpenAIEmbeddings": {"OpenAI": "https://python.langchain.com/docs/integrations/providers/openai", "AzureOpenAI": "https://python.langchain.com/docs/integrations/text_embedding/azureopenai", "Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "kNN": "https://python.langchain.com/docs/integrations/retrievers/knn", "DocArray Retriever": "https://python.langchain.com/docs/integrations/retrievers/docarray_retriever", "SVM": "https://python.langchain.com/docs/integrations/retrievers/svm", "Pinecone Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/pinecone_hybrid_search", "LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever", "Azure OpenAI": "https://python.langchain.com/docs/integrations/providers/azure_openai", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb", "Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Rockset": "https://python.langchain.com/docs/integrations/vectorstores/rockset", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz", "SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb", "Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense", "Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Alibaba Cloud OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn", "DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw", "MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse", "Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris", "Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase", "OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch", "Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch", "Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra", "Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb", "Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres", "MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Select by maximal marginal relevance (MMR)": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "VertexAIEmbeddings": {"Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/text_embedding/google_vertex_ai_palm"}, "BedrockEmbeddings": {"Bedrock Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/bedrock", "Bedrock": "https://python.langchain.com/docs/integrations/providers/bedrock"}, "LlamaCppEmbeddings": {"Llama-cpp": "https://python.langchain.com/docs/integrations/text_embedding/llamacpp", "Llama.cpp": "https://python.langchain.com/docs/integrations/providers/llamacpp"}, "NLPCloudEmbeddings": {"NLP Cloud": "https://python.langchain.com/docs/integrations/text_embedding/nlp_cloud"}, "SpacyEmbeddings": {"Spacy Embedding": "https://python.langchain.com/docs/integrations/text_embedding/spacy_embedding"}, "HuggingFaceInstructEmbeddings": {"InstructEmbeddings": "https://python.langchain.com/docs/integrations/text_embedding/instruct_embeddings"}, "CohereEmbeddings": {"Cohere": "https://python.langchain.com/docs/integrations/providers/cohere", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "ClarifaiEmbeddings": {"Clarifai": "https://python.langchain.com/docs/integrations/providers/clarifai"}, "MiniMaxEmbeddings": {"MiniMax": "https://python.langchain.com/docs/integrations/text_embedding/minimax"}, "FakeEmbeddings": {"Fake Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/fake", "DocArray Retriever": "https://python.langchain.com/docs/integrations/retrievers/docarray_retriever", "Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair"}, "ElasticsearchEmbeddings": {"Elasticsearch": "https://python.langchain.com/docs/integrations/text_embedding/elasticsearch", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch"}, "EmbaasEmbeddings": {"Embaas": "https://python.langchain.com/docs/integrations/text_embedding/embaas"}, "JinaEmbeddings": {"Jina": "https://python.langchain.com/docs/integrations/providers/jina"}, "AlephAlphaAsymmetricSemanticEmbedding": {"Aleph Alpha": "https://python.langchain.com/docs/integrations/text_embedding/aleph_alpha"}, "AlephAlphaSymmetricSemanticEmbedding": {"Aleph Alpha": "https://python.langchain.com/docs/integrations/providers/aleph_alpha"}, "DashScopeEmbeddings": {"DashScope": "https://python.langchain.com/docs/integrations/text_embedding/dashscope"}, "TensorflowHubEmbeddings": {"TensorflowHub": "https://python.langchain.com/docs/integrations/text_embedding/tensorflowhub"}, "ModelScopeEmbeddings": {"ModelScope": "https://python.langchain.com/docs/integrations/providers/modelscope"}, "SagemakerEndpointEmbeddings": {"SageMaker Endpoint Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/sagemaker-endpoint", "SageMaker Endpoint": "https://python.langchain.com/docs/integrations/providers/sagemaker_endpoint"}, "EmbeddingsContentHandler": {"SageMaker Endpoint Embeddings": "https://python.langchain.com/docs/integrations/text_embedding/sagemaker-endpoint"}, "LocalAIEmbeddings": {"LocalAI": "https://python.langchain.com/docs/integrations/text_embedding/localai"}, "ElasticSearchBM25Retriever": {"ElasticSearch BM25": "https://python.langchain.com/docs/integrations/retrievers/elastic_search_bm25", "Elasticsearch": "https://python.langchain.com/docs/integrations/providers/elasticsearch"}, "ZepChatMessageHistory": {"Zep": "https://python.langchain.com/docs/integrations/retrievers/zep_memorystore"}, "HumanMessage": {"Zep": "https://python.langchain.com/docs/integrations/retrievers/zep_memorystore", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory", "Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/chat/google_vertex_ai_palm", "Azure": "https://python.langchain.com/docs/integrations/chat/azure_chat_openai", "PromptLayer ChatOpenAI": "https://python.langchain.com/docs/integrations/chat/promptlayer_chatopenai", "MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking", "Custom callback handlers": "https://python.langchain.com/docs/modules/callbacks/custom_callbacks", "Tools as OpenAI Functions": "https://python.langchain.com/docs/modules/agents/tools/tools_as_openai_functions", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Using OpenAI functions": "https://python.langchain.com/docs/modules/chains/popular/openai_functions"}, "ZepRetriever": {"Zep": "https://python.langchain.com/docs/integrations/providers/zep", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory"}, "VespaRetriever": {"Vespa": "https://python.langchain.com/docs/integrations/providers/vespa"}, "AmazonKendraRetriever": {"Amazon Kendra": "https://python.langchain.com/docs/integrations/retrievers/amazon_kendra_retriever"}, "RecursiveCharacterTextSplitter": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "MarkdownHeaderTextSplitter": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/markdown_header_metadata"}, "TextLoader": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb", "Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Rockset": "https://python.langchain.com/docs/integrations/vectorstores/rockset", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz", "SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense", "Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas", "Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Alibaba Cloud OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Clarifai": "https://python.langchain.com/docs/integrations/vectorstores/clarifai", "scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn", "DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw", "MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse", "Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris", "AwaDB": "https://python.langchain.com/docs/integrations/vectorstores/awadb", "Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase", "OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch", "Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch", "Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra", "Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo", "DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb", "Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres", "MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "QA Generation": "https://python.langchain.com/docs/guides/evaluation/examples/qa_generation", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "FAISS": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters", "Ensemble Retriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/ensemble", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Select by maximal marginal relevance (MMR)": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr"}, "OpenAI": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "OpenWeatherMap API": "https://python.langchain.com/docs/integrations/tools/openweathermap", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Gradio Tools": "https://python.langchain.com/docs/integrations/tools/gradio_tools", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer", "Streamlit": "https://python.langchain.com/docs/integrations/callbacks/streamlit", "WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "OpenAI": "https://python.langchain.com/docs/integrations/llms/openai", "Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "Helicone": "https://python.langchain.com/docs/integrations/providers/helicone", "Shale Protocol": "https://python.langchain.com/docs/integrations/providers/shaleprotocol", "WhyLabs": "https://python.langchain.com/docs/integrations/providers/whylabs_profiling", "ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Ray Serve": "https://python.langchain.com/docs/integrations/providers/ray_serve", "Log, Trace, and Monitor Langchain LLM Calls": "https://python.langchain.com/docs/integrations/providers/portkey/logging_tracing_portkey", "Portkey": "https://python.langchain.com/docs/integrations/providers/portkey/index", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv", "Xorbits Agent": "https://python.langchain.com/docs/integrations/toolkits/xorbits", "Jira": "https://python.langchain.com/docs/integrations/toolkits/jira", "Spark Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/spark", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "GitHub": "https://python.langchain.com/docs/integrations/toolkits/github", "Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "HuggingGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/hugginggpt", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg", "ConversationTokenBufferMemory": "https://python.langchain.com/docs/modules/memory/token_buffer", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "How to use multiple memory classes in the same chain": "https://python.langchain.com/docs/modules/memory/multiple_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "ConversationSummaryBufferMemory": "https://python.langchain.com/docs/modules/memory/summary_buffer", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Token counting": "https://python.langchain.com/docs/modules/callbacks/token_counting", "Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler", "Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Tool Input Schema": "https://python.langchain.com/docs/modules/agents/tools/tool_input_validation", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Async API": "https://python.langchain.com/docs/modules/chains/how_to/async_chain", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Serialization": "https://python.langchain.com/docs/modules/model_io/models/llms/llm_serialization", "Retry parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/retry", "Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime", "Pydantic (JSON) parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Transformation": "https://python.langchain.com/docs/modules/chains/foundational/transformation", "Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash", "Summarization checker chain": "https://python.langchain.com/docs/modules/chains/additional/llm_summarization_checker", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "HTTP request chain": "https://python.langchain.com/docs/modules/chains/additional/llm_requests", "LLM Symbolic Math ": "https://python.langchain.com/docs/modules/chains/additional/llm_symbolic_math", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde", "Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa", "Self-checking chain": "https://python.langchain.com/docs/modules/chains/additional/llm_checker", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "ContextualCompressionRetriever": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "CohereRerank": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Cohere": "https://python.langchain.com/docs/integrations/providers/cohere"}, "RetrievalQA": {"Cohere Reranker": "https://python.langchain.com/docs/integrations/retrievers/cohere-reranker", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "KNNRetriever": {"kNN": "https://python.langchain.com/docs/integrations/retrievers/knn"}, "WikipediaRetriever": {"Wikipedia": "https://python.langchain.com/docs/integrations/providers/wikipedia"}, "ChatOpenAI": {"Wikipedia": "https://python.langchain.com/docs/integrations/retrievers/wikipedia", "Arxiv": "https://python.langchain.com/docs/integrations/retrievers/arxiv", "ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "ArXiv API Tool": "https://python.langchain.com/docs/integrations/tools/arxiv", "Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search", "Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "OpenAI": "https://python.langchain.com/docs/integrations/chat/openai", "Context": "https://python.langchain.com/docs/integrations/callbacks/context", "PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer", "CnosDB": "https://python.langchain.com/docs/integrations/providers/cnosdb", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking", "CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python", "PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql", "Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "Multion Toolkit": "https://python.langchain.com/docs/integrations/toolkits/multion", "OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Debugging": "https://python.langchain.com/docs/guides/debugging", "LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough", "QA Generation": "https://python.langchain.com/docs/guides/evaluation/examples/qa_generation", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent Trajectory": "https://python.langchain.com/docs/modules/evaluation/trajectory/trajectory_eval", "Custom Trajectory Evaluator": "https://python.langchain.com/docs/modules/evaluation/trajectory/custom", "QA Correctness": "https://python.langchain.com/docs/modules/evaluation/string/qa", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Wikibase Agent": "https://python.langchain.com/docs/use_cases/agents/wikibase_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "CAMEL Role-Playing Autonomous Cooperative Agents": "https://python.langchain.com/docs/use_cases/agent_simulations/camel_role_playing", "Multi-Agent Simulated Environment: Petting Zoo": "https://python.langchain.com/docs/use_cases/agent_simulations/petting_zoo", "Multi-agent decentralized speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_bidding", "Multi-agent authoritarian speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_authoritarian", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters", "Two-Player Dungeons & Dragons": "https://python.langchain.com/docs/use_cases/agent_simulations/two_player_dnd", "Multi-Player Dungeons & Dragons": "https://python.langchain.com/docs/use_cases/agent_simulations/multi_player_dnd", "Simulated Environment: Gymnasium": "https://python.langchain.com/docs/use_cases/agent_simulations/gymnasium", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Custom callback handlers": "https://python.langchain.com/docs/modules/callbacks/custom_callbacks", "Async callbacks": "https://python.langchain.com/docs/modules/callbacks/async_callbacks", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Tools as OpenAI Functions": "https://python.langchain.com/docs/modules/agents/tools/tools_as_openai_functions", "OpenAI Multi Functions Agent": "https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent", "Handle parsing errors": "https://python.langchain.com/docs/modules/agents/how_to/handle_parsing_errors", "Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Retry parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/retry", "Pydantic (JSON) parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Connecting to a Feature Store": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain", "Using OpenAI functions": "https://python.langchain.com/docs/modules/chains/popular/openai_functions", "Neptune Open Cypher QA Chain": "https://python.langchain.com/docs/modules/chains/additional/neptune_cypher_qa", "NebulaGraphQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_nebula_qa", "Elasticsearch database": "https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database", "Extraction": "https://python.langchain.com/docs/modules/chains/additional/extraction", "KuzuQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_kuzu_qa", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "HugeGraph QA Chain": "https://python.langchain.com/docs/modules/chains/additional/graph_hugegraph_qa", "Tagging": "https://python.langchain.com/docs/modules/chains/additional/tagging", "GraphSparqlQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_sparql_qa", "Question-Answering Citations": "https://python.langchain.com/docs/modules/chains/additional/qa_citations", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare", "ArangoDB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_arangodb_qa", "Graph DB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_cypher_qa"}, "ConversationalRetrievalChain": {"Wikipedia": "https://python.langchain.com/docs/integrations/retrievers/wikipedia", "Arxiv": "https://python.langchain.com/docs/integrations/retrievers/arxiv", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "MetalRetriever": {"Metal": "https://python.langchain.com/docs/integrations/providers/metal"}, "CSVLoader": {"ChatGPT Plugin": "https://python.langchain.com/docs/integrations/retrievers/chatgpt-plugin", "CSV": "https://python.langchain.com/docs/integrations/document_loaders/csv"}, "Document": {"ChatGPT Plugin": "https://python.langchain.com/docs/integrations/retrievers/chatgpt-plugin", "Weaviate Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/weaviate-hybrid", "BM25": "https://python.langchain.com/docs/integrations/retrievers/bm25", "TF-IDF": "https://python.langchain.com/docs/integrations/retrievers/tf_idf", "Apify": "https://python.langchain.com/docs/integrations/tools/apify", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger", "Doctran Extract Properties": "https://python.langchain.com/docs/integrations/document_transformers/doctran_extract_properties", "Doctran Interrogate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_interrogate_document", "Doctran Translate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_translate_document", "Copy Paste": "https://python.langchain.com/docs/integrations/document_loaders/copypaste", "Apify Dataset": "https://python.langchain.com/docs/integrations/document_loaders/apify_dataset", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "SageMakerEndpoint": "https://python.langchain.com/docs/integrations/llms/sagemaker", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "ChatGPTPluginRetriever": {"ChatGPT Plugin": "https://python.langchain.com/docs/integrations/retrievers/chatgpt-plugin", "OpenAI": "https://python.langchain.com/docs/integrations/providers/openai"}, "GoogleCloudEnterpriseSearchRetriever": {"Google Cloud Enterprise Search": "https://python.langchain.com/docs/integrations/retrievers/google_cloud_enterprise_search"}, "DocArrayRetriever": {"DocArray Retriever": "https://python.langchain.com/docs/integrations/retrievers/docarray_retriever"}, "SVMRetriever": {"SVM": "https://python.langchain.com/docs/integrations/retrievers/svm", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index"}, "PineconeHybridSearchRetriever": {"Pinecone Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/pinecone_hybrid_search"}, "PubMedRetriever": {"PubMed": "https://python.langchain.com/docs/integrations/retrievers/pubmed"}, "WeaviateHybridSearchRetriever": {"Weaviate Hybrid Search": "https://python.langchain.com/docs/integrations/retrievers/weaviate-hybrid"}, "ArxivRetriever": {"Arxiv": "https://python.langchain.com/docs/integrations/providers/arxiv"}, "BM25Retriever": {"BM25": "https://python.langchain.com/docs/integrations/retrievers/bm25", "Ensemble Retriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/ensemble"}, "AzureCognitiveSearchRetriever": {"Azure Cognitive Search": "https://python.langchain.com/docs/integrations/providers/azure_cognitive_search_"}, "ChaindeskRetriever": {"Chaindesk": "https://python.langchain.com/docs/integrations/providers/chaindesk"}, "MergerRetriever": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "Chroma": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "DocumentCompressorPipeline": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "LongContextReorder": {"LOTR (Merger Retriever)": "https://python.langchain.com/docs/integrations/retrievers/merger_retriever"}, "TFIDFRetriever": {"TF-IDF": "https://python.langchain.com/docs/integrations/retrievers/tf_idf"}, "load_tools": {"ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "AWS Lambda API": "https://python.langchain.com/docs/integrations/tools/awslambda", "Requests": "https://python.langchain.com/docs/integrations/tools/requests", "OpenWeatherMap API": "https://python.langchain.com/docs/integrations/tools/openweathermap", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "ArXiv API Tool": "https://python.langchain.com/docs/integrations/tools/arxiv", "GraphQL tool": "https://python.langchain.com/docs/integrations/tools/graphql", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "SerpAPI": "https://python.langchain.com/docs/integrations/providers/serpapi", "Golden": "https://python.langchain.com/docs/integrations/providers/golden", "Wolfram Alpha": "https://python.langchain.com/docs/integrations/providers/wolfram_alpha", "DataForSEO": "https://python.langchain.com/docs/integrations/providers/dataforseo", "SearxNG Search API": "https://python.langchain.com/docs/integrations/providers/searx", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "OpenWeatherMap": "https://python.langchain.com/docs/integrations/providers/openweathermap", "Google Search": "https://python.langchain.com/docs/integrations/providers/google_search", "Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model", "Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "AgentType": {"ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins", "Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "Streamlit": "https://python.langchain.com/docs/integrations/callbacks/streamlit", "WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Log, Trace, and Monitor Langchain LLM Calls": "https://python.langchain.com/docs/integrations/providers/portkey/logging_tracing_portkey", "Portkey": "https://python.langchain.com/docs/integrations/providers/portkey/index", "CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv", "Jira": "https://python.langchain.com/docs/integrations/toolkits/jira", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "GitHub": "https://python.langchain.com/docs/integrations/toolkits/github", "Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "Multion Toolkit": "https://python.langchain.com/docs/integrations/toolkits/multion", "Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example", "Debugging": "https://python.langchain.com/docs/guides/debugging", "LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Agent Trajectory": "https://python.langchain.com/docs/modules/evaluation/trajectory/trajectory_eval", "Multi-modal outputs: Image & Text": "https://python.langchain.com/docs/use_cases/multi_modal/image_agent", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Tool Input Schema": "https://python.langchain.com/docs/modules/agents/tools/tool_input_validation", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Self ask with search": "https://python.langchain.com/docs/modules/agents/agent_types/self_ask_with_search", "ReAct document store": "https://python.langchain.com/docs/modules/agents/agent_types/react_docstore", "OpenAI Multi Functions Agent": "https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Handle parsing errors": "https://python.langchain.com/docs/modules/agents/how_to/handle_parsing_errors", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent", "Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model", "Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "AIPluginTool": {"ChatGPT Plugins": "https://python.langchain.com/docs/integrations/tools/chatgpt_plugins"}, "Tool": {"DataForSeo API Wrapper": "https://python.langchain.com/docs/integrations/tools/dataforseo", "SerpAPI": "https://python.langchain.com/docs/integrations/tools/serpapi", "Google Search": "https://python.langchain.com/docs/integrations/tools/google_search", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Custom multi-action agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_multi_action_agent", "Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter", "Custom agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent"}, "SearxSearchWrapper": {"SearxNG Search API": "https://python.langchain.com/docs/integrations/providers/searx"}, "GoogleSerperAPIWrapper": {"Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "initialize_agent": {"Google Serper API": "https://python.langchain.com/docs/integrations/tools/google_serper", "Search Tools": "https://python.langchain.com/docs/integrations/tools/search_tools", "Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search", "Gradio Tools": "https://python.langchain.com/docs/integrations/tools/gradio_tools", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Google Serper": "https://python.langchain.com/docs/integrations/providers/google_serper", "ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Jira": "https://python.langchain.com/docs/integrations/toolkits/jira", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Azure Cognitive Services Toolkit": "https://python.langchain.com/docs/integrations/toolkits/azure_cognitive_services", "Gmail Toolkit": "https://python.langchain.com/docs/integrations/toolkits/gmail", "GitHub": "https://python.langchain.com/docs/integrations/toolkits/github", "PlayWright Browser Toolkit": "https://python.langchain.com/docs/integrations/toolkits/playwright", "Office365 Toolkit": "https://python.langchain.com/docs/integrations/toolkits/office365", "Amadeus Toolkit": "https://python.langchain.com/docs/integrations/toolkits/amadeus", "Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "Multi-modal outputs: Image & Text": "https://python.langchain.com/docs/use_cases/multi_modal/image_agent", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval", "Self ask with search": "https://python.langchain.com/docs/modules/agents/agent_types/self_ask_with_search", "ReAct document store": "https://python.langchain.com/docs/modules/agents/agent_types/react_docstore", "OpenAI Multi Functions Agent": "https://python.langchain.com/docs/modules/agents/agent_types/openai_multi_functions_agent", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Access intermediate steps": "https://python.langchain.com/docs/modules/agents/how_to/intermediate_steps", "Handle parsing errors": "https://python.langchain.com/docs/modules/agents/how_to/handle_parsing_errors", "Timeouts for agents": "https://python.langchain.com/docs/modules/agents/how_to/max_time_limit", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Cap the max number of iterations": "https://python.langchain.com/docs/modules/agents/how_to/max_iterations", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent", "Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model", "Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking", "Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "GooglePlacesTool": {"Google Places": "https://python.langchain.com/docs/integrations/tools/google_places"}, "HumanInputRun": {"Human as a tool": "https://python.langchain.com/docs/integrations/tools/human_tools", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "TwilioAPIWrapper": {"Twilio": "https://python.langchain.com/docs/integrations/tools/twilio"}, "IFTTTWebhook": {"IFTTT WebHooks": "https://python.langchain.com/docs/integrations/tools/ifttt"}, "WikipediaQueryRun": {"Wikipedia": "https://python.langchain.com/docs/integrations/tools/wikipedia"}, "WikipediaAPIWrapper": {"Wikipedia": "https://python.langchain.com/docs/integrations/tools/wikipedia", "Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory"}, "TextRequestsWrapper": {"Requests": "https://python.langchain.com/docs/integrations/tools/requests", "JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "OpenWeatherMapAPIWrapper": {"OpenWeatherMap API": "https://python.langchain.com/docs/integrations/tools/openweathermap", "OpenWeatherMap": "https://python.langchain.com/docs/integrations/providers/openweathermap"}, "PubmedQueryRun": {"PubMed Tool": "https://python.langchain.com/docs/integrations/tools/pubmed"}, "YouTubeSearchTool": {"YouTubeSearchTool": "https://python.langchain.com/docs/integrations/tools/youtube"}, "VectorstoreIndexCreator": {"Apify": "https://python.langchain.com/docs/integrations/tools/apify", "HuggingFace dataset": "https://python.langchain.com/docs/integrations/document_loaders/hugging_face_dataset", "Spreedly": "https://python.langchain.com/docs/integrations/document_loaders/spreedly", "Image captions": "https://python.langchain.com/docs/integrations/document_loaders/image_captions", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Apify Dataset": "https://python.langchain.com/docs/integrations/document_loaders/apify_dataset", "Iugu": "https://python.langchain.com/docs/integrations/document_loaders/iugu", "Stripe": "https://python.langchain.com/docs/integrations/document_loaders/stripe", "Modern Treasury": "https://python.langchain.com/docs/integrations/document_loaders/modern_treasury", "Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index"}, "ZapierToolkit": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier"}, "ZapierNLAWrapper": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier"}, "LLMChain": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "Predibase": "https://python.langchain.com/docs/integrations/llms/predibase", "AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Custom Trajectory Evaluator": "https://python.langchain.com/docs/modules/evaluation/trajectory/custom", "Custom Pairwise Evaluator": "https://python.langchain.com/docs/modules/evaluation/comparison/custom", "Multi-agent authoritarian speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_authoritarian", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler", "Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Connecting to a Feature Store": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Async API": "https://python.langchain.com/docs/modules/chains/how_to/async_chain", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "PromptTemplate": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier", "Context": "https://python.langchain.com/docs/integrations/callbacks/context", "Argilla": "https://python.langchain.com/docs/integrations/callbacks/argilla", "Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking", "Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking", "Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking", "Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking", "Flyte": "https://python.langchain.com/docs/integrations/providers/flyte", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "Predibase": "https://python.langchain.com/docs/integrations/llms/predibase", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Pairwise String Comparison": "https://python.langchain.com/docs/modules/evaluation/comparison/pairwise_string", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "How to create a custom Memory class": "https://python.langchain.com/docs/modules/memory/custom_memory", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "How to use multiple memory classes in the same chain": "https://python.langchain.com/docs/modules/memory/multiple_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler", "Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime", "Select by n-gram overlap": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/ngram_overlap", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Template Formats": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/formats", "Connecting to a Feature Store": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/connecting_to_a_feature_store", "Evaluating Custom Criteria": "https://python.langchain.com/docs/modules/evaluation/string/criteria_eval_chain", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router", "Transformation": "https://python.langchain.com/docs/modules/chains/foundational/transformation", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain", "Async API": "https://python.langchain.com/docs/modules/chains/how_to/async_chain", "Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash", "Elasticsearch database": "https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "HTTP request chain": "https://python.langchain.com/docs/modules/chains/additional/llm_requests", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "ZapierNLARunAction": {"Zapier Natural Language Actions API": "https://python.langchain.com/docs/integrations/tools/zapier"}, "GoldenQueryAPIWrapper": {"Golden Query": "https://python.langchain.com/docs/integrations/tools/golden_query", "Golden": "https://python.langchain.com/docs/integrations/providers/golden"}, "ArxivAPIWrapper": {"ArXiv API Tool": "https://python.langchain.com/docs/integrations/tools/arxiv"}, "MetaphorSearchAPIWrapper": {"Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search"}, "PlayWrightBrowserToolkit": {"Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search", "PlayWright Browser Toolkit": "https://python.langchain.com/docs/integrations/toolkits/playwright"}, "MetaphorSearchResults": {"Metaphor Search": "https://python.langchain.com/docs/integrations/tools/metaphor_search"}, "SerpAPIWrapper": {"SerpAPI": "https://python.langchain.com/docs/integrations/providers/serpapi", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt"}, "GraphQLAPIWrapper": {"GraphQL tool": "https://python.langchain.com/docs/integrations/tools/graphql"}, "DuckDuckGoSearchRun": {"DuckDuckGo Search": "https://python.langchain.com/docs/integrations/tools/ddg"}, "DuckDuckGoSearchResults": {"DuckDuckGo Search": "https://python.langchain.com/docs/integrations/tools/ddg"}, "DuckDuckGoSearchAPIWrapper": {"DuckDuckGo Search": "https://python.langchain.com/docs/integrations/tools/ddg"}, "ConversationBufferMemory": {"Gradio Tools": "https://python.langchain.com/docs/integrations/tools/gradio_tools", "SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain", "Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Bedrock": "https://python.langchain.com/docs/integrations/llms/bedrock", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "How to add Memory to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory", "Shared memory across agents and tools": "https://python.langchain.com/docs/modules/agents/how_to/sharedmemory_for_tools", "Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "SceneXplainTool": {"SceneXplain": "https://python.langchain.com/docs/integrations/tools/sceneXplain"}, "WolframAlphaAPIWrapper": {"Wolfram Alpha": "https://python.langchain.com/docs/integrations/providers/wolfram_alpha"}, "load_huggingface_tool": {"Requires transformers>=4.29.0 and huggingface_hub>=0.14.1": "https://python.langchain.com/docs/integrations/tools/huggingface_tools"}, "GoogleSearchAPIWrapper": {"Google Search": "https://python.langchain.com/docs/integrations/providers/google_search", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db", "How to add Memory to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory", "Shared memory across agents and tools": "https://python.langchain.com/docs/modules/agents/how_to/sharedmemory_for_tools"}, "BingSearchAPIWrapper": {"Bing Search": "https://python.langchain.com/docs/integrations/tools/bing_search"}, "ShellTool": {"Shell Tool": "https://python.langchain.com/docs/integrations/tools/bash", "Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval"}, "FileManagementToolkit": {"File System Tools": "https://python.langchain.com/docs/integrations/tools/filesystem"}, "BraveSearch": {"Brave Search": "https://python.langchain.com/docs/integrations/providers/brave_search"}, "RedisChatMessageHistory": {"Redis Chat Message History": "https://python.langchain.com/docs/integrations/memory/redis_chat_message_history", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db"}, "ZepMemory": {"Zep Memory": "https://python.langchain.com/docs/integrations/memory/zep_memory"}, "ConversationChain": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Bedrock": "https://python.langchain.com/docs/integrations/llms/bedrock", "Agent Debates with Tools": "https://python.langchain.com/docs/use_cases/agent_simulations/two_agent_debate_tools", "Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg", "ConversationTokenBufferMemory": "https://python.langchain.com/docs/modules/memory/token_buffer", "How to use multiple memory classes in the same chain": "https://python.langchain.com/docs/modules/memory/multiple_memory", "How to customize conversational memory": "https://python.langchain.com/docs/modules/memory/conversational_customization", "ConversationSummaryBufferMemory": "https://python.langchain.com/docs/modules/memory/summary_buffer", "Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "ConversationEntityMemory": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite"}, "SQLiteEntityStore": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite"}, "ENTITY_MEMORY_CONVERSATION_TEMPLATE": {"Entity Memory with SQLite storage": "https://python.langchain.com/docs/integrations/memory/entity_memory_with_sqlite"}, "PostgresChatMessageHistory": {"Postgres Chat Message History": "https://python.langchain.com/docs/integrations/memory/postgres_chat_message_history"}, "MomentoChatMessageHistory": {"Momento Chat Message History": "https://python.langchain.com/docs/integrations/memory/momento_chat_message_history"}, "MongoDBChatMessageHistory": {"Mongodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/mongodb_chat_message_history"}, "CassandraChatMessageHistory": {"Cassandra Chat Message History": "https://python.langchain.com/docs/integrations/memory/cassandra_chat_message_history", "Cassandra": "https://python.langchain.com/docs/integrations/providers/cassandra"}, "MotorheadMemory": {"Mot\u00f6rhead Memory": "https://python.langchain.com/docs/integrations/memory/motorhead_memory", "Mot\u00f6rhead Memory (Managed)": "https://python.langchain.com/docs/integrations/memory/motorhead_memory_managed"}, "DynamoDBChatMessageHistory": {"Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history"}, "PythonREPL": {"Dynamodb Chat Message History": "https://python.langchain.com/docs/integrations/memory/dynamodb_chat_message_history", "Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python"}, "ChatAnthropic": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "PlayWright Browser Toolkit": "https://python.langchain.com/docs/integrations/toolkits/playwright", "Agent Trajectory": "https://python.langchain.com/docs/modules/evaluation/trajectory/trajectory_eval", "Custom Pairwise Evaluator": "https://python.langchain.com/docs/modules/evaluation/comparison/custom", "Pairwise String Comparison": "https://python.langchain.com/docs/modules/evaluation/comparison/pairwise_string", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain", "Evaluating Custom Criteria": "https://python.langchain.com/docs/modules/evaluation/string/criteria_eval_chain"}, "AIMessage": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "OpenAI": "https://python.langchain.com/docs/integrations/chat/openai", "JinaChat": "https://python.langchain.com/docs/integrations/chat/jinachat", "Few shot examples for chat models": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/few_shot_examples_chat"}, "CallbackManager": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "Llama-cpp": "https://python.langchain.com/docs/integrations/llms/llamacpp", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "StreamingStdOutCallbackHandler": {"Anthropic": "https://python.langchain.com/docs/integrations/chat/anthropic", "GPT4All": "https://python.langchain.com/docs/integrations/llms/gpt4all", "Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Llama-cpp": "https://python.langchain.com/docs/integrations/llms/llamacpp", "C Transformers": "https://python.langchain.com/docs/integrations/llms/ctransformers", "Huggingface TextGen Inference": "https://python.langchain.com/docs/integrations/llms/huggingface_textgen_inference", "Replicate": "https://python.langchain.com/docs/integrations/llms/replicate", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "create_tagging_chain": {"Llama API": "https://python.langchain.com/docs/integrations/chat/llama_api", "Tagging": "https://python.langchain.com/docs/modules/chains/additional/tagging"}, "ChatVertexAI": {"Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/chat/google_vertex_ai_palm"}, "JinaChat": {"JinaChat": "https://python.langchain.com/docs/integrations/chat/jinachat"}, "AzureChatOpenAI": {"Azure": "https://python.langchain.com/docs/integrations/chat/azure_chat_openai", "Azure OpenAI": "https://python.langchain.com/docs/integrations/providers/azure_openai"}, "PromptLayerChatOpenAI": {"PromptLayer ChatOpenAI": "https://python.langchain.com/docs/integrations/chat/promptlayer_chatopenai"}, "ContextCallbackHandler": {"Context": "https://python.langchain.com/docs/integrations/callbacks/context"}, "ArgillaCallbackHandler": {"Argilla": "https://python.langchain.com/docs/integrations/providers/argilla"}, "PromptLayerCallbackHandler": {"PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer"}, "GPT4All": {"PromptLayer": "https://python.langchain.com/docs/integrations/callbacks/promptlayer", "GPT4All": "https://python.langchain.com/docs/integrations/llms/gpt4all", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa"}, "StreamlitCallbackHandler": {"Streamlit": "https://python.langchain.com/docs/integrations/callbacks/streamlit", "GPT4All": "https://python.langchain.com/docs/integrations/providers/gpt4all"}, "FigmaFileLoader": {"Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma"}, "AzureOpenAI": {"Azure OpenAI": "https://python.langchain.com/docs/integrations/llms/azure_openai_example", "OpenAI": "https://python.langchain.com/docs/integrations/providers/openai"}, "MyScale": {"MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query"}, "Baseten": {"Baseten": "https://python.langchain.com/docs/integrations/llms/baseten"}, "WeatherDataLoader": {"Weather": "https://python.langchain.com/docs/integrations/document_loaders/weather"}, "Tair": {"Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair"}, "UnstructuredWordDocumentLoader": {"Microsoft Word": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_word"}, "CollegeConfidentialLoader": {"College Confidential": "https://python.langchain.com/docs/integrations/document_loaders/college_confidential"}, "RWKV": {"RWKV-4": "https://python.langchain.com/docs/integrations/providers/rwkv"}, "GoogleDriveLoader": {"Google Drive": "https://python.langchain.com/docs/integrations/document_loaders/google_drive"}, "AmazonAPIGateway": {"Amazon API Gateway": "https://python.langchain.com/docs/integrations/llms/amazon_api_gateway_example"}, "UnstructuredPowerPointLoader": {"Microsoft PowerPoint": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_powerpoint"}, "wandb_tracing_enabled": {"WandB Tracing": "https://python.langchain.com/docs/integrations/providers/agent_with_wandb_tracing"}, "CometCallbackHandler": {"Comet": "https://python.langchain.com/docs/integrations/providers/comet_tracking"}, "CTransformers": {"C Transformers": "https://python.langchain.com/docs/integrations/llms/ctransformers"}, "BiliBiliLoader": {"BiliBili": "https://python.langchain.com/docs/integrations/document_loaders/bilibili"}, "DiffbotLoader": {"Diffbot": "https://python.langchain.com/docs/integrations/document_loaders/diffbot"}, "AimCallbackHandler": {"Aim": "https://python.langchain.com/docs/integrations/providers/aim_tracking"}, "ModernTreasuryLoader": {"Modern Treasury": "https://python.langchain.com/docs/integrations/document_loaders/modern_treasury"}, "FacebookChatLoader": {"Facebook Chat": "https://python.langchain.com/docs/integrations/document_loaders/facebook_chat"}, "Banana": {"Banana": "https://python.langchain.com/docs/integrations/llms/banana"}, "HuggingFacePipeline": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface", "RELLM": "https://python.langchain.com/docs/integrations/llms/rellm_experimental", "JSONFormer": "https://python.langchain.com/docs/integrations/llms/jsonformer_experimental"}, "HuggingFaceHub": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface"}, "HuggingFaceHubEmbeddings": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface"}, "CharacterTextSplitter": {"Hugging Face": "https://python.langchain.com/docs/integrations/providers/huggingface", "OpenAI": "https://python.langchain.com/docs/integrations/providers/openai", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation", "Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb", "Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis", "PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector", "Rockset": "https://python.langchain.com/docs/integrations/vectorstores/rockset", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz", "SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb", "Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense", "Tair": "https://python.langchain.com/docs/integrations/vectorstores/tair", "Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma", "Alibaba Cloud OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/alibabacloud_opensearch", "StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks", "Clarifai": "https://python.langchain.com/docs/integrations/vectorstores/clarifai", "scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn", "DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw", "MyScale": "https://python.langchain.com/docs/integrations/vectorstores/myscale", "ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse", "Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris", "AwaDB": "https://python.langchain.com/docs/integrations/vectorstores/awadb", "Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase", "OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch", "Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch", "Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra", "Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo", "DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory", "pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding", "FAISS": "https://python.langchain.com/docs/integrations/vectorstores/faiss", "AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb", "Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres", "MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas", "Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "Manifest": "https://python.langchain.com/docs/integrations/llms/manifest", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Vector store-augmented text generation": "https://python.langchain.com/docs/modules/chains/additional/vector_db_text_generation", "Hypothetical Document Embeddings": "https://python.langchain.com/docs/modules/chains/additional/hyde"}, "DocugamiLoader": {"Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami"}, "GutenbergLoader": {"Gutenberg": "https://python.langchain.com/docs/integrations/document_loaders/gutenberg"}, "AzureBlobStorageContainerLoader": {"Azure Blob Storage": "https://python.langchain.com/docs/integrations/providers/azure_blob_storage", "Azure Blob Storage Container": "https://python.langchain.com/docs/integrations/document_loaders/azure_blob_storage_container"}, "AzureBlobStorageFileLoader": {"Azure Blob Storage": "https://python.langchain.com/docs/integrations/providers/azure_blob_storage", "Azure Blob Storage File": "https://python.langchain.com/docs/integrations/document_loaders/azure_blob_storage_file"}, "WikipediaLoader": {"Wikipedia": "https://python.langchain.com/docs/integrations/document_loaders/wikipedia"}, "ConfluenceLoader": {"Confluence": "https://python.langchain.com/docs/integrations/document_loaders/confluence"}, "Predibase": {"Predibase": "https://python.langchain.com/docs/integrations/llms/predibase"}, "Beam": {"Beam": "https://python.langchain.com/docs/integrations/llms/beam"}, "GrobidParser": {"Grobid": "https://python.langchain.com/docs/integrations/document_loaders/grobid"}, "GenericLoader": {"Grobid": "https://python.langchain.com/docs/integrations/document_loaders/grobid", "Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio", "Source Code": "https://python.langchain.com/docs/integrations/document_loaders/source_code"}, "Typesense": {"Typesense": "https://python.langchain.com/docs/integrations/vectorstores/typesense"}, "Hologres": {"Hologres": "https://python.langchain.com/docs/integrations/vectorstores/hologres"}, "AI21": {"AI21 Labs": "https://python.langchain.com/docs/integrations/providers/ai21", "AI21": "https://python.langchain.com/docs/integrations/llms/ai21"}, "WandbCallbackHandler": {"Weights & Biases": "https://python.langchain.com/docs/integrations/providers/wandb_tracking"}, "ObsidianLoader": {"Obsidian": "https://python.langchain.com/docs/integrations/document_loaders/obsidian"}, "create_sql_agent": {"CnosDB": "https://python.langchain.com/docs/integrations/providers/cnosdb", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database"}, "SQLDatabaseToolkit": {"CnosDB": "https://python.langchain.com/docs/integrations/providers/cnosdb", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions"}, "OpenAIModerationChain": {"OpenAI": "https://python.langchain.com/docs/integrations/providers/openai"}, "ChatGPTLoader": {"OpenAI": "https://python.langchain.com/docs/integrations/providers/openai", "ChatGPT Data": "https://python.langchain.com/docs/integrations/document_loaders/chatgpt_loader"}, "AZLyricsLoader": {"AZLyrics": "https://python.langchain.com/docs/integrations/document_loaders/azlyrics"}, "ToMarkdownLoader": {"2Markdown": "https://python.langchain.com/docs/integrations/document_loaders/tomarkdown"}, "GitLoader": {"Git": "https://python.langchain.com/docs/integrations/document_loaders/git"}, "InfinoCallbackHandler": {"Infino": "https://python.langchain.com/docs/integrations/providers/infino"}, "MlflowAIGateway": {"MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway"}, "MlflowAIGatewayEmbeddings": {"MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway"}, "ChatMLflowAIGateway": {"MLflow AI Gateway": "https://python.langchain.com/docs/integrations/providers/mlflow_ai_gateway"}, "SingleStoreDB": {"SingleStoreDB": "https://python.langchain.com/docs/integrations/vectorstores/singlestoredb"}, "Tigris": {"Tigris": "https://python.langchain.com/docs/integrations/vectorstores/tigris"}, "S3DirectoryLoader": {"AWS S3 Directory": "https://python.langchain.com/docs/integrations/document_loaders/aws_s3_directory"}, "TransformChain": {"Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "Transformation": "https://python.langchain.com/docs/modules/chains/foundational/transformation"}, "SQLDatabase": {"Rebuff": "https://python.langchain.com/docs/integrations/providers/rebuff", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database"}, "Weaviate": {"Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query"}, "AirbyteJSONLoader": {"Airbyte": "https://python.langchain.com/docs/integrations/providers/airbyte", "Airbyte JSON": "https://python.langchain.com/docs/integrations/document_loaders/airbyte_json"}, "TelegramChatFileLoader": {"Telegram": "https://python.langchain.com/docs/integrations/document_loaders/telegram"}, "TelegramChatApiLoader": {"Telegram": "https://python.langchain.com/docs/integrations/providers/telegram"}, "PredictionGuard": {"Prediction Guard": "https://python.langchain.com/docs/integrations/llms/predictionguard"}, "NotionDirectoryLoader": {"Notion DB": "https://python.langchain.com/docs/integrations/providers/notion", "Notion DB 1/2": "https://python.langchain.com/docs/integrations/document_loaders/notion", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA"}, "NotionDBLoader": {"Notion DB": "https://python.langchain.com/docs/integrations/providers/notion", "Notion DB 2/2": "https://python.langchain.com/docs/integrations/document_loaders/notiondb"}, "MWDumpLoader": {"MediaWikiDump": "https://python.langchain.com/docs/integrations/document_loaders/mediawikidump"}, "BraveSearchLoader": {"Brave Search": "https://python.langchain.com/docs/integrations/document_loaders/brave_search"}, "StarRocks": {"StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks"}, "DatadogLogsLoader": {"Datadog Logs": "https://python.langchain.com/docs/integrations/document_loaders/datadog_logs"}, "ApifyDatasetLoader": {"Apify": "https://python.langchain.com/docs/integrations/providers/apify", "Apify Dataset": "https://python.langchain.com/docs/integrations/document_loaders/apify_dataset"}, "NLPCloud": {"NLPCloud": "https://python.langchain.com/docs/integrations/providers/nlpcloud", "NLP Cloud": "https://python.langchain.com/docs/integrations/llms/nlpcloud"}, "Milvus": {"Milvus": "https://python.langchain.com/docs/integrations/vectorstores/milvus", "Zilliz": "https://python.langchain.com/docs/integrations/vectorstores/zilliz"}, "Qdrant": {"Qdrant": "https://python.langchain.com/docs/integrations/vectorstores/qdrant", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query"}, "GitbookLoader": {"GitBook": "https://python.langchain.com/docs/integrations/document_loaders/gitbook"}, "OpenSearchVectorSearch": {"OpenSearch": "https://python.langchain.com/docs/integrations/vectorstores/opensearch"}, "Pinecone": {"Pinecone": "https://python.langchain.com/docs/integrations/vectorstores/pinecone", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone"}, "UnstructuredFileLoader": {"Unstructured": "https://python.langchain.com/docs/integrations/providers/unstructured", "Unstructured File": "https://python.langchain.com/docs/integrations/document_loaders/unstructured_file"}, "SelfHostedPipeline": {"Runhouse": "https://python.langchain.com/docs/integrations/llms/runhouse"}, "MlflowCallbackHandler": {"MLflow": "https://python.langchain.com/docs/integrations/providers/mlflow_tracking"}, "SpreedlyLoader": {"Spreedly": "https://python.langchain.com/docs/integrations/document_loaders/spreedly"}, "OpenLLM": {"OpenLLM": "https://python.langchain.com/docs/integrations/llms/openllm"}, "SearxSearchResults": {"SearxNG Search API": "https://python.langchain.com/docs/integrations/providers/searx"}, "Modal": {"Modal": "https://python.langchain.com/docs/integrations/llms/modal"}, "IFixitLoader": {"iFixit": "https://python.langchain.com/docs/integrations/document_loaders/ifixit"}, "AlephAlpha": {"Aleph Alpha": "https://python.langchain.com/docs/integrations/llms/aleph_alpha"}, "PipelineAI": {"PipelineAI": "https://python.langchain.com/docs/integrations/llms/pipelineai_example"}, "LlamaCpp": {"Llama.cpp": "https://python.langchain.com/docs/integrations/providers/llamacpp", "Llama-cpp": "https://python.langchain.com/docs/integrations/llms/llamacpp", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "AwaDB": {"AwaDB": "https://python.langchain.com/docs/integrations/vectorstores/awadb"}, "ArxivLoader": {"Arxiv": "https://python.langchain.com/docs/integrations/document_loaders/arxiv"}, "Anyscale": {"Anyscale": "https://python.langchain.com/docs/integrations/llms/anyscale"}, "StripeLoader": {"Stripe": "https://python.langchain.com/docs/integrations/document_loaders/stripe"}, "BlackboardLoader": {"Blackboard": "https://python.langchain.com/docs/integrations/document_loaders/blackboard"}, "WhatsAppChatLoader": {"WhatsApp": "https://python.langchain.com/docs/integrations/providers/whatsapp", "WhatsApp Chat": "https://python.langchain.com/docs/integrations/document_loaders/whatsapp_chat"}, "LanceDB": {"LanceDB": "https://python.langchain.com/docs/integrations/vectorstores/lancedb"}, "OneDriveLoader": {"Microsoft OneDrive": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_onedrive"}, "AnalyticDB": {"AnalyticDB": "https://python.langchain.com/docs/integrations/vectorstores/analyticdb"}, "YoutubeLoader": {"YouTube": "https://python.langchain.com/docs/integrations/providers/youtube", "YouTube transcripts": "https://python.langchain.com/docs/integrations/document_loaders/youtube_transcript"}, "GoogleApiYoutubeLoader": {"YouTube": "https://python.langchain.com/docs/integrations/providers/youtube"}, "PromptLayerOpenAI": {"PromptLayer": "https://python.langchain.com/docs/integrations/providers/promptlayer", "PromptLayer OpenAI": "https://python.langchain.com/docs/integrations/llms/promptlayer_openai"}, "DeepLake": {"Deep Lake": "https://python.langchain.com/docs/integrations/providers/deeplake", "Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat", "Analysis of Twitter the-algorithm source code with LangChain, GPT4 and Activeloop's Deep Lake": "https://python.langchain.com/docs/use_cases/code/twitter-the-algorithm-analysis-deeplake", "Use LangChain, GPT and Activeloop's Deep Lake to work with code base": "https://python.langchain.com/docs/use_cases/code/code-analysis-deeplake", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query"}, "WhyLabsCallbackHandler": {"WhyLabs": "https://python.langchain.com/docs/integrations/providers/whylabs_profiling"}, "FlyteCallbackHandler": {"Flyte": "https://python.langchain.com/docs/integrations/providers/flyte"}, "ManifestWrapper": {"Hazy Research": "https://python.langchain.com/docs/integrations/providers/hazy_research", "Manifest": "https://python.langchain.com/docs/integrations/llms/manifest"}, "Marqo": {"Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo"}, "IMSDbLoader": {"IMSDb": "https://python.langchain.com/docs/integrations/document_loaders/imsdb"}, "PGVector": {"PGVector": "https://python.langchain.com/docs/integrations/vectorstores/pgvector"}, "DeepInfra": {"DeepInfra": "https://python.langchain.com/docs/integrations/llms/deepinfra_example"}, "AgentExecutor": {"Jina": "https://python.langchain.com/docs/integrations/providers/jina", "PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi", "SQL Database Agent": "https://python.langchain.com/docs/integrations/toolkits/sql_database", "Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter"}, "RedditPostsLoader": {"Reddit": "https://python.langchain.com/docs/integrations/document_loaders/reddit"}, "TrelloLoader": {"Trello": "https://python.langchain.com/docs/integrations/document_loaders/trello"}, "AtlasDB": {"AtlasDB": "https://python.langchain.com/docs/integrations/providers/atlas", "Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas"}, "SKLearnVectorStore": {"scikit-learn": "https://python.langchain.com/docs/integrations/vectorstores/sklearn"}, "EverNoteLoader": {"EverNote": "https://python.langchain.com/docs/integrations/document_loaders/evernote"}, "TwitterTweetLoader": {"Twitter": "https://python.langchain.com/docs/integrations/document_loaders/twitter"}, "DiscordChatLoader": {"Discord": "https://python.langchain.com/docs/integrations/document_loaders/discord"}, "RedisCache": {"Redis": "https://python.langchain.com/docs/integrations/providers/redis", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "RedisSemanticCache": {"Redis": "https://python.langchain.com/docs/integrations/providers/redis", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "Redis": {"Redis": "https://python.langchain.com/docs/integrations/vectorstores/redis"}, "SelfQueryRetriever": {"Chroma": "https://python.langchain.com/docs/integrations/providers/chroma", "Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query"}, "ClearMLCallbackHandler": {"ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking"}, "StdOutCallbackHandler": {"ClearML": "https://python.langchain.com/docs/integrations/providers/clearml_tracking", "Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain"}, "Cohere": {"Cohere": "https://python.langchain.com/docs/integrations/llms/cohere"}, "SlackDirectoryLoader": {"Slack": "https://python.langchain.com/docs/integrations/document_loaders/slack"}, "LLMContentHandler": {"SageMaker Endpoint": "https://python.langchain.com/docs/integrations/providers/sagemaker_endpoint", "SageMakerEndpoint": "https://python.langchain.com/docs/integrations/llms/sagemaker"}, "ContentHandlerBase": {"SageMaker Endpoint": "https://python.langchain.com/docs/integrations/providers/sagemaker_endpoint"}, "HNLoader": {"Hacker News": "https://python.langchain.com/docs/integrations/document_loaders/hacker_news"}, "Annoy": {"Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy"}, "GCSDirectoryLoader": {"Google Cloud Storage": "https://python.langchain.com/docs/integrations/providers/google_cloud_storage", "Google Cloud Storage Directory": "https://python.langchain.com/docs/integrations/document_loaders/google_cloud_storage_directory"}, "GCSFileLoader": {"Google Cloud Storage": "https://python.langchain.com/docs/integrations/providers/google_cloud_storage", "Google Cloud Storage File": "https://python.langchain.com/docs/integrations/document_loaders/google_cloud_storage_file"}, "ArthurCallbackHandler": {"Arthur": "https://python.langchain.com/docs/integrations/providers/arthur_tracking"}, "DuckDBLoader": {"DuckDB": "https://python.langchain.com/docs/integrations/document_loaders/duckdb"}, "Petals": {"Petals": "https://python.langchain.com/docs/integrations/llms/petals_example"}, "MomentoCache": {"Momento": "https://python.langchain.com/docs/integrations/providers/momento", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "AirtableLoader": {"Airtable": "https://python.langchain.com/docs/integrations/document_loaders/airtable"}, "Clarifai": {"Clarifai": "https://python.langchain.com/docs/integrations/llms/clarifai"}, "BigQueryLoader": {"Google BigQuery": "https://python.langchain.com/docs/integrations/document_loaders/google_bigquery"}, "RoamLoader": {"Roam": "https://python.langchain.com/docs/integrations/document_loaders/roam"}, "Portkey": {"Log, Trace, and Monitor Langchain LLM Calls": "https://python.langchain.com/docs/integrations/providers/portkey/logging_tracing_portkey", "Portkey": "https://python.langchain.com/docs/integrations/providers/portkey/index"}, "Vectara": {"Vectara": "https://python.langchain.com/docs/integrations/vectorstores/vectara", "Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "Vectara Text Generation": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_text_generation"}, "VectaraRetriever": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat"}, "load_qa_chain": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat", "SageMakerEndpoint": "https://python.langchain.com/docs/integrations/llms/sagemaker", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs"}, "CONDENSE_QUESTION_PROMPT": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat"}, "load_qa_with_sources_chain": {"Chat Over Documents with Vectara": "https://python.langchain.com/docs/integrations/providers/vectara/vectara_chat"}, "create_csv_agent": {"CSV Agent": "https://python.langchain.com/docs/integrations/toolkits/csv"}, "create_xorbits_agent": {"Xorbits Agent": "https://python.langchain.com/docs/integrations/toolkits/xorbits"}, "JiraToolkit": {"Jira": "https://python.langchain.com/docs/integrations/toolkits/jira"}, "JiraAPIWrapper": {"Jira": "https://python.langchain.com/docs/integrations/toolkits/jira"}, "create_spark_dataframe_agent": {"Spark Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/spark"}, "PyPDFLoader": {"Document Comparison": "https://python.langchain.com/docs/integrations/toolkits/document_comparison_toolkit", "MergeDocLoader": "https://python.langchain.com/docs/integrations/document_loaders/merge_doc_loader", "Question answering over a group chat messages using Activeloop's DeepLake": "https://python.langchain.com/docs/use_cases/question_answering/semantic-search-over-chat"}, "create_python_agent": {"Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python"}, "PythonREPLTool": {"Python Agent": "https://python.langchain.com/docs/integrations/toolkits/python"}, "create_pbi_agent": {"PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi"}, "PowerBIToolkit": {"PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi"}, "PowerBIDataset": {"PowerBI Dataset Agent": "https://python.langchain.com/docs/integrations/toolkits/powerbi"}, "AzureCognitiveServicesToolkit": {"Azure Cognitive Services Toolkit": "https://python.langchain.com/docs/integrations/toolkits/azure_cognitive_services"}, "Requests": {"Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "APIOperation": {"Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla"}, "NLAToolkit": {"Natural Language APIs": "https://python.langchain.com/docs/integrations/toolkits/openapi_nla", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval"}, "GmailToolkit": {"Gmail Toolkit": "https://python.langchain.com/docs/integrations/toolkits/gmail"}, "build_resource_service": {"Gmail Toolkit": "https://python.langchain.com/docs/integrations/toolkits/gmail"}, "create_json_agent": {"JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json"}, "JsonToolkit": {"JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json"}, "JsonSpec": {"JSON Agent": "https://python.langchain.com/docs/integrations/toolkits/json", "OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "GitHubToolkit": {"GitHub": "https://python.langchain.com/docs/integrations/toolkits/github"}, "GitHubAPIWrapper": {"GitHub": "https://python.langchain.com/docs/integrations/toolkits/github"}, "create_spark_sql_agent": {"Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql"}, "SparkSQLToolkit": {"Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql"}, "SparkSQL": {"Spark SQL Agent": "https://python.langchain.com/docs/integrations/toolkits/spark_sql"}, "O365Toolkit": {"Office365 Toolkit": "https://python.langchain.com/docs/integrations/toolkits/office365"}, "create_pandas_dataframe_agent": {"Pandas Dataframe Agent": "https://python.langchain.com/docs/integrations/toolkits/pandas", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "MultionClientTool": {"Multion Toolkit": "https://python.langchain.com/docs/integrations/toolkits/multion"}, "AmadeusToolkit": {"Amadeus Toolkit": "https://python.langchain.com/docs/integrations/toolkits/amadeus"}, "WebBaseLoader": {"Vectorstore Agent": "https://python.langchain.com/docs/integrations/toolkits/vectorstore", "WebBaseLoader": "https://python.langchain.com/docs/integrations/document_loaders/web_base", "MergeDocLoader": "https://python.langchain.com/docs/integrations/document_loaders/merge_doc_loader", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "Running LLMs locally": "https://python.langchain.com/docs/use_cases/question_answering/local_retrieval_qa", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore"}, "reduce_openapi_spec": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "RequestsWrapper": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "create_openapi_agent": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "OpenAPIToolkit": {"OpenAPI agents": "https://python.langchain.com/docs/integrations/toolkits/openapi"}, "RetrievalQAWithSourcesChain": {"Weaviate": "https://python.langchain.com/docs/integrations/vectorstores/weaviate", "Marqo": "https://python.langchain.com/docs/integrations/vectorstores/marqo", "Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic", "QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "MatchingEngine": {"MatchingEngine": "https://python.langchain.com/docs/integrations/vectorstores/matchingengine"}, "OpenAIChat": {"Activeloop's Deep Lake": "https://python.langchain.com/docs/integrations/vectorstores/deeplake"}, "InMemoryDocstore": {"Annoy": "https://python.langchain.com/docs/integrations/vectorstores/annoy", "AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters"}, "SpacyTextSplitter": {"Atlas": "https://python.langchain.com/docs/integrations/vectorstores/atlas", "Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "SentenceTransformerEmbeddings": {"Chroma": "https://python.langchain.com/docs/integrations/vectorstores/chroma"}, "StarRocksSettings": {"StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks"}, "DirectoryLoader": {"StarRocks": "https://python.langchain.com/docs/integrations/vectorstores/starrocks"}, "DocArrayHnswSearch": {"DocArrayHnswSearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_hnsw"}, "Clickhouse": {"ClickHouse Vector Search": "https://python.langchain.com/docs/integrations/vectorstores/clickhouse"}, "SupabaseVectorStore": {"Supabase (Postgres)": "https://python.langchain.com/docs/integrations/vectorstores/supabase"}, "AzureSearch": {"Azure Cognitive Search": "https://python.langchain.com/docs/integrations/vectorstores/azuresearch"}, "Cassandra": {"Cassandra": "https://python.langchain.com/docs/integrations/vectorstores/cassandra"}, "ElasticVectorSearch": {"ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch", "How to add memory to a Multi-Input Chain": "https://python.langchain.com/docs/modules/memory/adding_memory_chain_multiple_inputs"}, "ElasticKnnSearch": {"ElasticSearch": "https://python.langchain.com/docs/integrations/vectorstores/elasticsearch"}, "DocArrayInMemorySearch": {"DocArrayInMemorySearch": "https://python.langchain.com/docs/integrations/vectorstores/docarray_in_memory"}, "PGEmbedding": {"pg_embedding": "https://python.langchain.com/docs/integrations/vectorstores/pgembedding"}, "MongoDBAtlasVectorSearch": {"MongoDB Atlas": "https://python.langchain.com/docs/integrations/vectorstores/mongodb_atlas"}, "create_metadata_tagger": {"OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger"}, "ChatPromptTemplate": {"OpenAI Functions Metadata Tagger": "https://python.langchain.com/docs/integrations/document_transformers/openai_metadata_tagger", "How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Prompt Pipelining": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompts_pipelining", "Using OpenAI functions": "https://python.langchain.com/docs/modules/chains/popular/openai_functions", "Extraction": "https://python.langchain.com/docs/modules/chains/additional/extraction", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa", "Tagging": "https://python.langchain.com/docs/modules/chains/additional/tagging"}, "AsyncHtmlLoader": {"html2text": "https://python.langchain.com/docs/integrations/document_transformers/html2text", "AsyncHtmlLoader": "https://python.langchain.com/docs/integrations/document_loaders/async_html"}, "Html2TextTransformer": {"html2text": "https://python.langchain.com/docs/integrations/document_transformers/html2text"}, "DoctranPropertyExtractor": {"Doctran Extract Properties": "https://python.langchain.com/docs/integrations/document_transformers/doctran_extract_properties"}, "DoctranQATransformer": {"Doctran Interrogate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_interrogate_document"}, "DoctranTextTranslator": {"Doctran Translate Documents": "https://python.langchain.com/docs/integrations/document_transformers/doctran_translate_document"}, "SnowflakeLoader": {"Snowflake": "https://python.langchain.com/docs/integrations/document_loaders/snowflake"}, "AcreomLoader": {"acreom": "https://python.langchain.com/docs/integrations/document_loaders/acreom"}, "UnstructuredCSVLoader": {"CSV": "https://python.langchain.com/docs/integrations/document_loaders/csv"}, "XorbitsLoader": {"Xorbits Pandas DataFrame": "https://python.langchain.com/docs/integrations/document_loaders/xorbits"}, "UnstructuredEmailLoader": {"Email": "https://python.langchain.com/docs/integrations/document_loaders/email"}, "OutlookMessageLoader": {"Email": "https://python.langchain.com/docs/integrations/document_loaders/email"}, "RecursiveUrlLoader": {"Recursive URL Loader": "https://python.langchain.com/docs/integrations/document_loaders/recursive_url_loader"}, "JoplinLoader": {"Joplin": "https://python.langchain.com/docs/integrations/document_loaders/joplin"}, "EtherscanLoader": {"Etherscan Loader": "https://python.langchain.com/docs/integrations/document_loaders/Etherscan"}, "Docx2txtLoader": {"Microsoft Word": "https://python.langchain.com/docs/integrations/document_loaders/microsoft_word"}, "OpenAIWhisperParser": {"Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio"}, "YoutubeAudioLoader": {"Loading documents from a YouTube url": "https://python.langchain.com/docs/integrations/document_loaders/youtube_audio"}, "UnstructuredURLLoader": {"URL": "https://python.langchain.com/docs/integrations/document_loaders/url"}, "SeleniumURLLoader": {"URL": "https://python.langchain.com/docs/integrations/document_loaders/url"}, "PlaywrightURLLoader": {"URL": "https://python.langchain.com/docs/integrations/document_loaders/url"}, "OpenCityDataLoader": {"Geopandas": "https://python.langchain.com/docs/integrations/document_loaders/geopandas", "Open City Data": "https://python.langchain.com/docs/integrations/document_loaders/open_city_data"}, "GeoDataFrameLoader": {"Geopandas": "https://python.langchain.com/docs/integrations/document_loaders/geopandas"}, "HuggingFaceDatasetLoader": {"HuggingFace dataset": "https://python.langchain.com/docs/integrations/document_loaders/hugging_face_dataset"}, "MHTMLLoader": {"mhtml": "https://python.langchain.com/docs/integrations/document_loaders/mhtml"}, "RocksetLoader": {"Rockset": "https://python.langchain.com/docs/integrations/document_loaders/rockset"}, "ImageCaptionLoader": {"Image captions": "https://python.langchain.com/docs/integrations/document_loaders/image_captions"}, "UnstructuredRSTLoader": {"RST": "https://python.langchain.com/docs/integrations/document_loaders/rst"}, "ConversationBufferWindowMemory": {"Figma": "https://python.langchain.com/docs/integrations/document_loaders/figma", "Meta-Prompt": "https://python.langchain.com/docs/use_cases/autonomous_agents/meta_prompt", "Voice Assistant": "https://python.langchain.com/docs/use_cases/chatbots/voice_assistant", "Create ChatGPT clone": "https://python.langchain.com/docs/modules/agents/how_to/chatgpt_clone"}, "UnstructuredImageLoader": {"Images": "https://python.langchain.com/docs/integrations/document_loaders/image"}, "TencentCOSFileLoader": {"Tencent COS File": "https://python.langchain.com/docs/integrations/document_loaders/tencent_cos_file"}, "TomlLoader": {"TOML": "https://python.langchain.com/docs/integrations/document_loaders/toml"}, "UnstructuredAPIFileLoader": {"Unstructured File": "https://python.langchain.com/docs/integrations/document_loaders/unstructured_file"}, "PsychicLoader": {"Psychic": "https://python.langchain.com/docs/integrations/document_loaders/psychic"}, "TencentCOSDirectoryLoader": {"Tencent COS Directory": "https://python.langchain.com/docs/integrations/document_loaders/tencent_cos_directory"}, "GitHubIssuesLoader": {"GitHub": "https://python.langchain.com/docs/integrations/document_loaders/github"}, "UnstructuredOrgModeLoader": {"Org-mode": "https://python.langchain.com/docs/integrations/document_loaders/org_mode"}, "LarkSuiteDocLoader": {"LarkSuite (FeiShu)": "https://python.langchain.com/docs/integrations/document_loaders/larksuite"}, "load_summarize_chain": {"LarkSuite (FeiShu)": "https://python.langchain.com/docs/integrations/document_loaders/larksuite", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching", "Summarization": "https://python.langchain.com/docs/use_cases/summarization"}, "IuguLoader": {"Iugu": "https://python.langchain.com/docs/integrations/document_loaders/iugu"}, "UnstructuredEPubLoader": {"EPub ": "https://python.langchain.com/docs/integrations/document_loaders/epub"}, "AttributeInfo": {"Docugami": "https://python.langchain.com/docs/integrations/document_loaders/docugami", "Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "Weaviate self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/weaviate_self_query", "Chroma self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/chroma_self_query", "DeepLake self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/deeplake_self_query", "Self-querying with Pinecone": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/pinecone", "Self-querying with MyScale": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/myscale_self_query", "Qdrant self-querying ": "https://python.langchain.com/docs/modules/data_connection/retrievers/self_query/qdrant_self_query"}, "UnstructuredFileIOLoader": {"Google Drive": "https://python.langchain.com/docs/integrations/document_loaders/google_drive"}, "BrowserlessLoader": {"Browserless": "https://python.langchain.com/docs/integrations/document_loaders/browserless"}, "BibtexLoader": {"BibTeX": "https://python.langchain.com/docs/integrations/document_loaders/bibtex"}, "ReadTheDocsLoader": {"ReadTheDocs Documentation": "https://python.langchain.com/docs/integrations/document_loaders/readthedocs_documentation"}, "DataFrameLoader": {"Pandas DataFrame": "https://python.langchain.com/docs/integrations/document_loaders/pandas_dataframe"}, "GoogleApiClient": {"YouTube transcripts": "https://python.langchain.com/docs/integrations/document_loaders/youtube_transcript"}, "NotebookLoader": {"Jupyter Notebook": "https://python.langchain.com/docs/integrations/document_loaders/jupyter_notebook", "Notebook": "https://python.langchain.com/docs/integrations/document_loaders/example_data/notebook"}, "UnstructuredTSVLoader": {"TSV": "https://python.langchain.com/docs/integrations/document_loaders/tsv"}, "UnstructuredODTLoader": {"Open Document Format (ODT)": "https://python.langchain.com/docs/integrations/document_loaders/odt"}, "EmbaasBlobLoader": {"Embaas": "https://python.langchain.com/docs/integrations/document_loaders/embaas"}, "Blob": {"Embaas": "https://python.langchain.com/docs/integrations/document_loaders/embaas"}, "EmbaasLoader": {"Embaas": "https://python.langchain.com/docs/integrations/document_loaders/embaas"}, "UnstructuredXMLLoader": {"XML": "https://python.langchain.com/docs/integrations/document_loaders/xml"}, "MaxComputeLoader": {"Alibaba Cloud MaxCompute": "https://python.langchain.com/docs/integrations/document_loaders/alibaba_cloud_maxcompute"}, "CubeSemanticLoader": {"Cube Semantic Layer": "https://python.langchain.com/docs/integrations/document_loaders/cube_semantic"}, "UnstructuredExcelLoader": {"Microsoft Excel": "https://python.langchain.com/docs/integrations/document_loaders/excel"}, "Language": {"Source Code": "https://python.langchain.com/docs/integrations/document_loaders/source_code"}, "LanguageParser": {"Source Code": "https://python.langchain.com/docs/integrations/document_loaders/source_code"}, "SRTLoader": {"Subtitle": "https://python.langchain.com/docs/integrations/document_loaders/subtitle"}, "MastodonTootsLoader": {"Mastodon": "https://python.langchain.com/docs/integrations/document_loaders/mastodon"}, "MergedDataLoader": {"MergeDocLoader": "https://python.langchain.com/docs/integrations/document_loaders/merge_doc_loader"}, "PySparkDataFrameLoader": {"PySpark DataFrame Loader": "https://python.langchain.com/docs/integrations/document_loaders/pyspark_dataframe"}, "CoNLLULoader": {"CoNLL-U": "https://python.langchain.com/docs/integrations/document_loaders/conll-u"}, "FaunaLoader": {"Fauna": "https://python.langchain.com/docs/integrations/document_loaders/fauna"}, "SitemapLoader": {"Sitemap": "https://python.langchain.com/docs/integrations/document_loaders/sitemap"}, "S3FileLoader": {"AWS S3 File": "https://python.langchain.com/docs/integrations/document_loaders/aws_s3_file"}, "SimpleSequentialChain": {"Baseten": "https://python.langchain.com/docs/integrations/llms/baseten", "Predibase": "https://python.langchain.com/docs/integrations/llms/predibase", "Replicate": "https://python.langchain.com/docs/integrations/llms/replicate"}, "StochasticAI": {"StochasticAI": "https://python.langchain.com/docs/integrations/llms/stochasticai"}, "ForefrontAI": {"ForefrontAI": "https://python.langchain.com/docs/integrations/llms/forefrontai_example"}, "CerebriumAI": {"CerebriumAI": "https://python.langchain.com/docs/integrations/llms/cerebriumai_example"}, "OctoAIEndpoint": {"OctoAI Compute Service": "https://python.langchain.com/docs/integrations/llms/octoai"}, "Writer": {"Writer": "https://python.langchain.com/docs/integrations/llms/writer"}, "TextGen": {"TextGen": "https://python.langchain.com/docs/integrations/llms/textgen"}, "MosaicML": {"MosaicML": "https://python.langchain.com/docs/integrations/llms/mosaicml"}, "KoboldApiLLM": {"KoboldAI API": "https://python.langchain.com/docs/integrations/llms/koboldai"}, "VertexAI": {"Google Cloud Platform Vertex AI PaLM ": "https://python.langchain.com/docs/integrations/llms/google_vertex_ai_palm"}, "Bedrock": {"Bedrock": "https://python.langchain.com/docs/integrations/llms/bedrock"}, "GooseAI": {"GooseAI": "https://python.langchain.com/docs/integrations/llms/gooseai_example"}, "Databricks": {"Databricks": "https://python.langchain.com/docs/integrations/llms/databricks"}, "MapReduceChain": {"Manifest": "https://python.langchain.com/docs/integrations/llms/manifest", "Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "ModelLaboratory": {"Manifest": "https://python.langchain.com/docs/integrations/llms/manifest", "Model Comparison": "https://python.langchain.com/docs/guides/model_laboratory"}, "RELLM": {"RELLM": "https://python.langchain.com/docs/integrations/llms/rellm_experimental"}, "Tongyi": {"Tongyi Qwen": "https://python.langchain.com/docs/integrations/llms/tongyi"}, "InMemoryCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "SQLiteCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "GPTCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "SQLAlchemyCache": {"Caching integrations": "https://python.langchain.com/docs/integrations/llms/llm_caching"}, "AzureMLOnlineEndpoint": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example"}, "DollyContentFormatter": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example"}, "load_llm": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example", "Serialization": "https://python.langchain.com/docs/modules/model_io/models/llms/llm_serialization"}, "AzureMLEndpointClient": {"AzureML Online Endpoint": "https://python.langchain.com/docs/integrations/llms/azureml_endpoint_example"}, "OpenLM": {"OpenLM": "https://python.langchain.com/docs/integrations/llms/openlm"}, "HuggingFaceTextGenInference": {"Huggingface TextGen Inference": "https://python.langchain.com/docs/integrations/llms/huggingface_textgen_inference"}, "ChatGLM": {"ChatGLM": "https://python.langchain.com/docs/integrations/llms/chatglm"}, "tool": {"JSONFormer": "https://python.langchain.com/docs/integrations/llms/jsonformer_experimental", "Agent Trajectory": "https://python.langchain.com/docs/modules/evaluation/trajectory/trajectory_eval", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools"}, "JsonFormer": {"JSONFormer": "https://python.langchain.com/docs/integrations/llms/jsonformer_experimental"}, "Replicate": {"Replicate": "https://python.langchain.com/docs/integrations/llms/replicate"}, "tracing_v2_enabled": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough"}, "wait_for_all_tracers": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough"}, "EvaluatorType": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain"}, "RunEvalConfig": {"LangSmith Walkthrough": "https://python.langchain.com/docs/guides/langsmith/walkthrough"}, "load_dataset": {"Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "SQL Question Answering Benchmarking: Chinook": "https://python.langchain.com/docs/guides/evaluation/examples/sql_qa_benchmarking_chinook", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg"}, "QAEvalChain": {"Question Answering Benchmarking: State of the Union Address": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_sota", "Question Answering Benchmarking: Paul Graham Essay": "https://python.langchain.com/docs/guides/evaluation/examples/qa_benchmarking_pg", "Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering", "SQL Question Answering Benchmarking: Chinook": "https://python.langchain.com/docs/guides/evaluation/examples/sql_qa_benchmarking_chinook", "Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering", "Agent VectorDB Question Answering Benchmarking": "https://python.langchain.com/docs/guides/evaluation/examples/agent_vectordb_sota_pg"}, "QAGenerationChain": {"QA Generation": "https://python.langchain.com/docs/guides/evaluation/examples/qa_generation"}, "OpenAPISpec": {"Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "OpenAPIEndpointChain": {"Evaluating an OpenAPI Chain": "https://python.langchain.com/docs/guides/evaluation/examples/openapi_eval", "OpenAPI chain": "https://python.langchain.com/docs/modules/chains/additional/openapi"}, "QAGenerateChain": {"Data Augmented Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/data_augmented_question_answering"}, "load_evaluator": {"Comparing Chain Outputs": "https://python.langchain.com/docs/guides/evaluation/examples/comparisons", "Agent Trajectory": "https://python.langchain.com/docs/modules/evaluation/trajectory/trajectory_eval", "Pairwise Embedding Distance ": "https://python.langchain.com/docs/modules/evaluation/comparison/pairwise_embedding_distance", "Pairwise String Comparison": "https://python.langchain.com/docs/modules/evaluation/comparison/pairwise_string", "Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain", "QA Correctness": "https://python.langchain.com/docs/modules/evaluation/string/qa", "String Distance": "https://python.langchain.com/docs/modules/evaluation/string/string_distance", "Embedding Distance": "https://python.langchain.com/docs/modules/evaluation/string/embedding_distance", "Evaluating Custom Criteria": "https://python.langchain.com/docs/modules/evaluation/string/criteria_eval_chain"}, "ContextQAEvalChain": {"Question Answering": "https://python.langchain.com/docs/guides/evaluation/examples/question_answering"}, "AgentAction": {"Custom Trajectory Evaluator": "https://python.langchain.com/docs/modules/evaluation/trajectory/custom", "Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Wikibase Agent": "https://python.langchain.com/docs/use_cases/agents/wikibase_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Custom multi-action agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_multi_action_agent", "Custom agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval"}, "AgentTrajectoryEvaluator": {"Custom Trajectory Evaluator": "https://python.langchain.com/docs/modules/evaluation/trajectory/custom"}, "EmbeddingDistance": {"Pairwise Embedding Distance ": "https://python.langchain.com/docs/modules/evaluation/comparison/pairwise_embedding_distance", "Embedding Distance": "https://python.langchain.com/docs/modules/evaluation/string/embedding_distance"}, "PairwiseStringEvaluator": {"Custom Pairwise Evaluator": "https://python.langchain.com/docs/modules/evaluation/comparison/custom"}, "Criteria": {"Criteria Evaluation": "https://python.langchain.com/docs/guides/evaluation/string/criteria_eval_chain"}, "SQL_PROMPT": {"QA Correctness": "https://python.langchain.com/docs/modules/evaluation/string/qa"}, "StringEvaluator": {"Custom String Evaluator": "https://python.langchain.com/docs/modules/evaluation/string/custom"}, "StringDistance": {"String Distance": "https://python.langchain.com/docs/modules/evaluation/string/string_distance"}, "WriteFileTool": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "ReadFileTool": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "AutoGPT": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt", "!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times"}, "FileChatMessageHistory": {"AutoGPT": "https://python.langchain.com/docs/use_cases/autonomous_agents/autogpt"}, "BaseLLM": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context"}, "VectorStore": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent"}, "Chain": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain"}, "BabyAGI": {"BabyAGI User Guide": "https://python.langchain.com/docs/use_cases/autonomous_agents/baby_agi", "BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/autonomous_agents/baby_agi_with_agent"}, "ZeroShotAgent": {"BabyAGI with Tools": "https://python.langchain.com/docs/use_cases/agents/baby_agi_with_agent", "Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db", "How to add Memory to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory", "Custom MRKL agent": "https://python.langchain.com/docs/modules/agents/how_to/custom_mrkl_agent", "Shared memory across agents and tools": "https://python.langchain.com/docs/modules/agents/how_to/sharedmemory_for_tools"}, "BaseTool": {"!pip install bs4": "https://python.langchain.com/docs/use_cases/autonomous_agents/marathon_times", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools", "Combine agents and vector stores": "https://python.langchain.com/docs/modules/agents/how_to/agent_vectorstore", "Custom functions with OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/custom-functions-with-openai-functions-agent"}, "MarkdownHeaderTextSplitter": {"Context aware text splitting and QA / Chat": "https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA", "MarkdownHeaderTextSplitter": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/markdown_header_metadata"}, "MultiQueryRetriever": {"QA and Chat over Documents": "https://python.langchain.com/docs/use_cases/question_answering/index", "MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever"}, "StringPromptTemplate": {"Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Wikibase Agent": "https://python.langchain.com/docs/use_cases/agents/wikibase_agent", "SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval", "Custom agent with tool retrieval": "https://python.langchain.com/docs/modules/agents/how_to/custom_agent_with_tool_retrieval", "Custom prompt template": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/custom_prompt_template"}, "AIPlugin": {"Plug-and-Plai": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval_using_plugnplai", "Custom Agent with PlugIn Retrieval": "https://python.langchain.com/docs/use_cases/agents/custom_agent_with_plugin_retrieval"}, "AgentOutputParser": {"SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base": "https://python.langchain.com/docs/use_cases/agents/sales_agent_with_context"}, "SteamshipImageGenerationTool": {"Multi-modal outputs: Image & Text": "https://python.langchain.com/docs/use_cases/multi_modal/image_agent"}, "RegexParser": {"Multi-Agent Simulated Environment: Petting Zoo": "https://python.langchain.com/docs/use_cases/agent_simulations/petting_zoo", "Multi-agent decentralized speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_bidding", "Multi-agent authoritarian speaker selection": "https://python.langchain.com/docs/use_cases/agent_simulations/multiagent_authoritarian", "Simulated Environment: Gymnasium": "https://python.langchain.com/docs/use_cases/agent_simulations/gymnasium"}, "TimeWeightedVectorStoreRetriever": {"Generative Agents in LangChain": "https://python.langchain.com/docs/use_cases/agent_simulations/characters"}, "PydanticOutputParser": {"MultiQueryRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/MultiQueryRetriever", "WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research", "Pydantic (JSON) parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/pydantic"}, "WebResearchRetriever": {"WebResearchRetriever": "https://python.langchain.com/docs/modules/data_connection/retrievers/web_research"}, "TokenTextSplitter": {"Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "SentenceTransformersTokenTextSplitter": {"Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "NLTKTextSplitter": {"Split by tokens ": "https://python.langchain.com/docs/modules/data_connection/document_transformers/text_splitters/split_by_token"}, "StuffDocumentsChain": {"Lost in the middle: The problem with long contexts": "https://python.langchain.com/docs/modules/data_connection/document_transformers/post_retrieval/long_context_reorder", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "ChatMessageHistory": {"Adding Message Memory backed by a database to an Agent": "https://python.langchain.com/docs/modules/memory/agent_with_memory_in_db"}, "BaseMemory": {"How to create a custom Memory class": "https://python.langchain.com/docs/modules/memory/custom_memory"}, "ConversationKGMemory": {"Conversation Knowledge Graph Memory": "https://python.langchain.com/docs/modules/memory/kg"}, "ConversationTokenBufferMemory": {"ConversationTokenBufferMemory": "https://python.langchain.com/docs/modules/memory/token_buffer"}, "SystemMessage": {"How to add Memory to an LLMChain": "https://python.langchain.com/docs/modules/memory/adding_memory", "Use ToolKits with OpenAI Functions": "https://python.langchain.com/docs/modules/agents/how_to/use_toolkits_with_openai_functions", "Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "ConversationSummaryBufferMemory": {"ConversationSummaryBufferMemory": "https://python.langchain.com/docs/modules/memory/summary_buffer"}, "BaseCallbackHandler": {"Custom callback handlers": "https://python.langchain.com/docs/modules/callbacks/custom_callbacks", "Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks", "Streaming final agent output": "https://python.langchain.com/docs/modules/agents/how_to/streaming_stdout_final_only"}, "tracing_enabled": {"Multiple callback handlers": "https://python.langchain.com/docs/modules/callbacks/multiple_callbacks"}, "get_openai_callback": {"Token counting": "https://python.langchain.com/docs/modules/callbacks/token_counting", "Tracking token usage": "https://python.langchain.com/docs/modules/model_io/models/llms/token_usage_tracking"}, "FileCallbackHandler": {"Logging to file": "https://python.langchain.com/docs/modules/callbacks/filecallbackhandler"}, "LLMResult": {"Async callbacks": "https://python.langchain.com/docs/modules/callbacks/async_callbacks"}, "AsyncCallbackHandler": {"Async callbacks": "https://python.langchain.com/docs/modules/callbacks/async_callbacks"}, "StructuredTool": {"Multi-Input Tools": "https://python.langchain.com/docs/modules/agents/tools/multi_input_tool", "Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools"}, "ToolException": {"Defining Custom Tools": "https://python.langchain.com/docs/modules/agents/tools/custom_tools"}, "MoveFileTool": {"Tools as OpenAI Functions": "https://python.langchain.com/docs/modules/agents/tools/tools_as_openai_functions"}, "RequestsGetTool": {"Tool Input Schema": "https://python.langchain.com/docs/modules/agents/tools/tool_input_validation"}, "HumanApprovalCallbackHandler": {"Human-in-the-loop Tool Validation": "https://python.langchain.com/docs/modules/agents/tools/human_approval"}, "DocstoreExplorer": {"ReAct document store": "https://python.langchain.com/docs/modules/agents/agent_types/react_docstore"}, "AgentFinish": {"Running Agent as an Iterator": "https://python.langchain.com/docs/modules/agents/how_to/agent_iter"}, "MessagesPlaceholder": {"Add Memory to OpenAI Functions Agent": "https://python.langchain.com/docs/modules/agents/how_to/add_memory_openai_functions", "Types of `MessagePromptTemplate`": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates"}, "LangChainTracer": {"Async API": "https://python.langchain.com/docs/modules/agents/how_to/async_agent"}, "HumanInputChatModel": {"Human input Chat Model": "https://python.langchain.com/docs/modules/model_io/models/chat/human_input_chat_model"}, "FakeListLLM": {"Fake LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/fake_llm"}, "CallbackManagerForLLMRun": {"Custom LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/custom_llm"}, "LLM": {"Custom LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/custom_llm"}, "HumanInputLLM": {"Human input LLM": "https://python.langchain.com/docs/modules/model_io/models/llms/human_input_llm"}, "RetryWithErrorOutputParser": {"Retry parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/retry"}, "EnumOutputParser": {"Enum parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/enum"}, "DatetimeOutputParser": {"Datetime parser": "https://python.langchain.com/docs/modules/model_io/output_parsers/datetime"}, "FewShotPromptTemplate": {"Select by maximal marginal relevance (MMR)": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/mmr", "Select by n-gram overlap": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/ngram_overlap"}, "BaseExampleSelector": {"Custom example selector": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/custom_example_selector"}, "NGramOverlapExampleSelector": {"Select by n-gram overlap": "https://python.langchain.com/docs/modules/model_io/prompts/example_selectors/ngram_overlap"}, "load_prompt": {"Serialization": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/prompt_serialization"}, "ChatMessagePromptTemplate": {"Types of `MessagePromptTemplate`": "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates"}, "CriteriaEvalChain": {"Evaluating Custom Criteria": "https://python.langchain.com/docs/modules/evaluation/string/criteria_eval_chain"}, "MultiPromptChain": {"Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "LLMRouterChain": {"Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "EmbeddingRouterChain": {"Router": "https://python.langchain.com/docs/modules/chains/foundational/router"}, "BasePromptTemplate": {"Custom chain": "https://python.langchain.com/docs/modules/chains/how_to/custom_chain"}, "load_chain": {"Serialization": "https://python.langchain.com/docs/modules/chains/how_to/serialization", "Loading from LangChainHub": "https://python.langchain.com/docs/modules/chains/how_to/from_hub"}, "NeptuneGraph": {"Neptune Open Cypher QA Chain": "https://python.langchain.com/docs/modules/chains/additional/neptune_cypher_qa"}, "NeptuneOpenCypherQAChain": {"Neptune Open Cypher QA Chain": "https://python.langchain.com/docs/modules/chains/additional/neptune_cypher_qa"}, "LLMBashChain": {"Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash"}, "BashOutputParser": {"Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash"}, "BashProcess": {"Bash chain": "https://python.langchain.com/docs/modules/chains/additional/llm_bash"}, "NebulaGraphQAChain": {"NebulaGraphQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_nebula_qa"}, "NebulaGraph": {"NebulaGraphQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_nebula_qa"}, "PALChain": {"Causal program-aided language (CPAL) chain": "https://python.langchain.com/docs/modules/chains/additional/cpal", "Program-aided language model (PAL) chain": "https://python.langchain.com/docs/modules/chains/additional/pal"}, "ElasticsearchDatabaseChain": {"Elasticsearch database": "https://python.langchain.com/docs/modules/chains/additional/elasticsearch_database"}, "get_openapi_chain": {"OpenAPI calls with OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openapi_openai"}, "create_extraction_chain": {"Extraction": "https://python.langchain.com/docs/modules/chains/additional/extraction"}, "LLMSummarizationCheckerChain": {"Summarization checker chain": "https://python.langchain.com/docs/modules/chains/additional/llm_summarization_checker"}, "KuzuGraph": {"KuzuQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_kuzu_qa"}, "KuzuQAChain": {"KuzuQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_kuzu_qa"}, "create_qa_with_sources_chain": {"Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "create_qa_with_structure_chain": {"Retrieval QA using OpenAI functions": "https://python.langchain.com/docs/modules/chains/additional/openai_functions_retrieval_qa"}, "HugeGraphQAChain": {"HugeGraph QA Chain": "https://python.langchain.com/docs/modules/chains/additional/graph_hugegraph_qa"}, "HugeGraph": {"HugeGraph QA Chain": "https://python.langchain.com/docs/modules/chains/additional/graph_hugegraph_qa"}, "GraphSparqlQAChain": {"GraphSparqlQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_sparql_qa"}, "RdfGraph": {"GraphSparqlQAChain": "https://python.langchain.com/docs/modules/chains/additional/graph_sparql_qa"}, "LLMRequestsChain": {"HTTP request chain": "https://python.langchain.com/docs/modules/chains/additional/llm_requests"}, "LLMSymbolicMathChain": {"LLM Symbolic Math ": "https://python.langchain.com/docs/modules/chains/additional/llm_symbolic_math"}, "create_citation_fuzzy_match_chain": {"Question-Answering Citations": "https://python.langchain.com/docs/modules/chains/additional/qa_citations"}, "BaseRetriever": {"FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "FlareChain": {"FLARE": "https://python.langchain.com/docs/modules/chains/additional/flare"}, "ArangoGraph": {"ArangoDB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_arangodb_qa"}, "ArangoGraphQAChain": {"ArangoDB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_arangodb_qa"}, "GraphIndexCreator": {"Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "GraphQAChain": {"Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "NetworkxEntityGraph": {"Graph QA": "https://python.langchain.com/docs/modules/chains/additional/graph_qa"}, "LLMCheckerChain": {"Self-checking chain": "https://python.langchain.com/docs/modules/chains/additional/llm_checker"}, "GraphCypherQAChain": {"Graph DB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_cypher_qa"}, "Neo4jGraph": {"Graph DB QA chain": "https://python.langchain.com/docs/modules/chains/additional/graph_cypher_qa"}} \ No newline at end of file diff --git a/docs/docs_skeleton/docs/modules/chains/additional/constitutional_chain.mdx b/docs/docs_skeleton/docs/guides/safety/constitutional_chain.mdx similarity index 100% rename from docs/docs_skeleton/docs/modules/chains/additional/constitutional_chain.mdx rename to docs/docs_skeleton/docs/guides/safety/constitutional_chain.mdx diff --git a/docs/docs_skeleton/docs/guides/safety/index.mdx b/docs/docs_skeleton/docs/guides/safety/index.mdx new file mode 100644 index 0000000000000..a64b1ea041d37 --- /dev/null +++ b/docs/docs_skeleton/docs/guides/safety/index.mdx @@ -0,0 +1,6 @@ +# Preventing harmful outputs + +One of the key concerns with using LLMs is that they may generate harmful or unethical text. This is an area of active research in the field. Here we present some built-in chains inspired by this research, which are intended to make the outputs of LLMs safer. + +- [Moderation chain](/docs/use_cases/safety/moderation): Explicitly check if any output text is harmful and flag it. +- [Constitutional chain](/docs/use_cases/safety/constitutional_chain): Prompt the model with a set of principles which should guide it's behavior. diff --git a/docs/docs_skeleton/docs/modules/chains/additional/moderation.mdx b/docs/docs_skeleton/docs/guides/safety/moderation.mdx similarity index 100% rename from docs/docs_skeleton/docs/modules/chains/additional/moderation.mdx rename to docs/docs_skeleton/docs/guides/safety/moderation.mdx diff --git a/docs/docs_skeleton/docs/modules/chains/additional/index.mdx b/docs/docs_skeleton/docs/modules/chains/additional/index.mdx deleted file mode 100644 index 3f7d4f56b802e..0000000000000 --- a/docs/docs_skeleton/docs/modules/chains/additional/index.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -sidebar_position: 4 ---- -# Additional - -import DocCardList from "@theme/DocCardList"; - - diff --git a/docs/docs_skeleton/docs/modules/chains/additional/multi_prompt_router.mdx b/docs/docs_skeleton/docs/modules/chains/additional/multi_prompt_router.mdx deleted file mode 100644 index 060952df817f1..0000000000000 --- a/docs/docs_skeleton/docs/modules/chains/additional/multi_prompt_router.mdx +++ /dev/null @@ -1,7 +0,0 @@ -# Dynamically selecting from multiple prompts - -This notebook demonstrates how to use the `RouterChain` paradigm to create a chain that dynamically selects the prompt to use for a given input. Specifically we show how to use the `MultiPromptChain` to create a question-answering chain that selects the prompt which is most relevant for a given question, and then answers the question using that prompt. - -import Example from "@snippets/modules/chains/additional/multi_prompt_router.mdx" - - diff --git a/docs/docs_skeleton/docs/modules/chains/foundational/sequential_chains.mdx b/docs/docs_skeleton/docs/modules/chains/foundational/sequential_chains.mdx index 0fd2f83596246..2e89506fda783 100644 --- a/docs/docs_skeleton/docs/modules/chains/foundational/sequential_chains.mdx +++ b/docs/docs_skeleton/docs/modules/chains/foundational/sequential_chains.mdx @@ -1,6 +1,6 @@ # Sequential - + The next step after calling a language model is make a series of calls to a language model. This is particularly useful when you want to take the output from one call and use it as the input to another. diff --git a/docs/docs_skeleton/docs/modules/chains/popular/index.mdx b/docs/docs_skeleton/docs/modules/chains/popular/index.mdx deleted file mode 100644 index 8fd7a29c7153b..0000000000000 --- a/docs/docs_skeleton/docs/modules/chains/popular/index.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -sidebar_position: 3 ---- -# Popular - -import DocCardList from "@theme/DocCardList"; - - diff --git a/docs/docs_skeleton/docs/modules/data_connection/retrievers/integrations/_category_.yml b/docs/docs_skeleton/docs/modules/data_connection/retrievers/integrations/_category_.yml deleted file mode 100644 index 5131f3e6ed01a..0000000000000 --- a/docs/docs_skeleton/docs/modules/data_connection/retrievers/integrations/_category_.yml +++ /dev/null @@ -1 +0,0 @@ -label: 'Integrations' diff --git a/docs/docs_skeleton/docs/modules/chains/popular/api.mdx b/docs/docs_skeleton/docs/use_cases/apis/api.mdx similarity index 100% rename from docs/docs_skeleton/docs/modules/chains/popular/api.mdx rename to docs/docs_skeleton/docs/use_cases/apis/api.mdx diff --git a/docs/docs_skeleton/docs/use_cases/question_answering/how_to/_category_.yml b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/_category_.yml new file mode 100644 index 0000000000000..4ed055b08b3e7 --- /dev/null +++ b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/_category_.yml @@ -0,0 +1 @@ +label: 'How to' diff --git a/docs/docs_skeleton/docs/modules/chains/additional/analyze_document.mdx b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/analyze_document.mdx similarity index 100% rename from docs/docs_skeleton/docs/modules/chains/additional/analyze_document.mdx rename to docs/docs_skeleton/docs/use_cases/question_answering/how_to/analyze_document.mdx diff --git a/docs/docs_skeleton/docs/modules/chains/popular/chat_vector_db.mdx b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/chat_vector_db.mdx similarity index 95% rename from docs/docs_skeleton/docs/modules/chains/popular/chat_vector_db.mdx rename to docs/docs_skeleton/docs/use_cases/question_answering/how_to/chat_vector_db.mdx index 5eb1840253981..906d576c51b81 100644 --- a/docs/docs_skeleton/docs/modules/chains/popular/chat_vector_db.mdx +++ b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/chat_vector_db.mdx @@ -2,7 +2,7 @@ sidebar_position: 2 --- -# Conversational Retrieval QA +# Store and reference chat history The ConversationalRetrievalQA chain builds on RetrievalQAChain to provide a chat history component. It first combines the chat history (either explicitly passed in or retrieved from the provided memory) and the question into a standalone question, then looks up relevant documents from the retriever, and finally passes those documents and the question to a question answering chain to return a response. diff --git a/docs/docs_skeleton/docs/modules/chains/additional/multi_retrieval_qa_router.mdx b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/multi_retrieval_qa_router.mdx similarity index 90% rename from docs/docs_skeleton/docs/modules/chains/additional/multi_retrieval_qa_router.mdx rename to docs/docs_skeleton/docs/use_cases/question_answering/how_to/multi_retrieval_qa_router.mdx index 0341e199aca3c..a8f6d19b71248 100644 --- a/docs/docs_skeleton/docs/modules/chains/additional/multi_retrieval_qa_router.mdx +++ b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/multi_retrieval_qa_router.mdx @@ -1,4 +1,4 @@ -# Dynamically selecting from multiple retrievers +# Dynamically select from multiple retrievers This notebook demonstrates how to use the `RouterChain` paradigm to create a chain that dynamically selects which Retrieval system to use. Specifically we show how to use the `MultiRetrievalQAChain` to create a question-answering chain that selects the retrieval QA chain which is most relevant for a given question, and then answers the question using it. diff --git a/docs/docs_skeleton/docs/modules/chains/additional/question_answering.mdx b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/question_answering.mdx similarity index 93% rename from docs/docs_skeleton/docs/modules/chains/additional/question_answering.mdx rename to docs/docs_skeleton/docs/use_cases/question_answering/how_to/question_answering.mdx index 56ed1ec9df7cd..30d709f65c40b 100644 --- a/docs/docs_skeleton/docs/modules/chains/additional/question_answering.mdx +++ b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/question_answering.mdx @@ -1,4 +1,4 @@ -# Document QA +# QA over in-memory documents Here we walk through how to use LangChain for question answering over a list of documents. Under the hood we'll be using our [Document chains](/docs/modules/chains/document/). diff --git a/docs/docs_skeleton/docs/modules/chains/popular/vector_db_qa.mdx b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/vector_db_qa.mdx similarity index 92% rename from docs/docs_skeleton/docs/modules/chains/popular/vector_db_qa.mdx rename to docs/docs_skeleton/docs/use_cases/question_answering/how_to/vector_db_qa.mdx index 986169ad7f739..57db52bf94f59 100644 --- a/docs/docs_skeleton/docs/modules/chains/popular/vector_db_qa.mdx +++ b/docs/docs_skeleton/docs/use_cases/question_answering/how_to/vector_db_qa.mdx @@ -1,7 +1,7 @@ --- sidebar_position: 1 --- -# Retrieval QA +# QA using a Retriever This example showcases question answering over an index. diff --git a/docs/docs_skeleton/docs/modules/chains/popular/summarize.mdx b/docs/docs_skeleton/docs/use_cases/summarization/summarize.mdx similarity index 100% rename from docs/docs_skeleton/docs/modules/chains/popular/summarize.mdx rename to docs/docs_skeleton/docs/use_cases/summarization/summarize.mdx diff --git a/docs/docs_skeleton/docs/modules/chains/popular/sqlite.mdx b/docs/docs_skeleton/docs/use_cases/tabular/sqlite.mdx similarity index 100% rename from docs/docs_skeleton/docs/modules/chains/popular/sqlite.mdx rename to docs/docs_skeleton/docs/use_cases/tabular/sqlite.mdx diff --git a/docs/docs_skeleton/vercel.json b/docs/docs_skeleton/vercel.json index beca9d71d47c8..fade6e103d947 100644 --- a/docs/docs_skeleton/vercel.json +++ b/docs/docs_skeleton/vercel.json @@ -1610,59 +1610,59 @@ }, { "source": "/en/latest/modules/chains/examples/flare.html", - "destination": "/docs/modules/chains/additional/flare" + "destination": "/docs/use_cases/question_answering/how_to/flare" }, { "source": "/en/latest/modules/chains/examples/graph_cypher_qa.html", - "destination": "/docs/modules/chains/additional/graph_cypher_qa" + "destination": "/docs/use_cases/graph/graph_cypher_qa" }, { "source": "/en/latest/modules/chains/examples/graph_nebula_qa.html", - "destination": "/docs/modules/chains/additional/graph_nebula_qa" + "destination": "/docs/use_cases/graph/graph_nebula_qa" }, { "source": "/en/latest/modules/chains/index_examples/graph_qa.html", - "destination": "/docs/modules/chains/additional/graph_qa" + "destination": "/docs/use_cases/graph/graph_qa" }, { "source": "/en/latest/modules/chains/index_examples/hyde.html", - "destination": "/docs/modules/chains/additional/hyde" + "destination": "/docs/use_cases/question_answering/how_to/hyde" }, { "source": "/en/latest/modules/chains/examples/llm_bash.html", - "destination": "/docs/modules/chains/additional/llm_bash" + "destination": "/docs/use_cases/code_writing/llm_bash" }, { "source": "/en/latest/modules/chains/examples/llm_checker.html", - "destination": "/docs/modules/chains/additional/llm_checker" + "destination": "/docs/use_cases/self_check/llm_checker" }, { "source": "/en/latest/modules/chains/examples/llm_math.html", - "destination": "/docs/modules/chains/additional/llm_math" + "destination": "/docs/use_cases/code_writing/llm_math" }, { "source": "/en/latest/modules/chains/examples/llm_requests.html", - "destination": "/docs/modules/chains/additional/llm_requests" + "destination": "/docs/use_cases/apis/llm_requests" }, { "source": "/en/latest/modules/chains/examples/llm_summarization_checker.html", - "destination": "/docs/modules/chains/additional/llm_summarization_checker" + "destination": "/docs/use_cases/self_check/llm_summarization_checker" }, { "source": "/en/latest/modules/chains/examples/openapi.html", - "destination": "/docs/modules/chains/additional/openapi" + "destination": "/docs/use_cases/apis/openapi" }, { "source": "/en/latest/modules/chains/examples/pal.html", - "destination": "/docs/modules/chains/additional/pal" + "destination": "/docs/use_cases/code_writing/pal" }, { "source": "/en/latest/modules/chains/examples/tagging.html", - "destination": "/docs/modules/chains/additional/tagging" + "destination": "/docs/use_cases/tagging" }, { "source": "/en/latest/modules/chains/index_examples/vector_db_text_generation.html", - "destination": "/docs/modules/chains/additional/vector_db_text_generation" + "destination": "/docs/use_cases/question_answering/how_to/vector_db_text_generation" }, { "source": "/en/latest/modules/chains/generic/router.html", @@ -3771,6 +3771,170 @@ { "source": "/en/latest/:path*", "destination": "/docs/:path*" + }, + { + "source": "/docs/modules/chains/additional/constitutional_chain", + "destination": "/docs/guides/safety/constitutional_chain" + }, + { + "source": "/docs/modules/chains/additional/moderation", + "destination": "/docs/guides/safety/moderation" + }, + { + "source": "/docs/modules/chains/popular/api", + "destination": "/docs/use_cases/apis/api" + }, + { + "source": "/docs/modules/chains/additional/analyze_document", + "destination": "/docs/use_cases/question_answering/how_to/analyze_document" + }, + { + "source": "/docs/modules/chains/popular/chat_vector_db", + "destination": "/docs/use_cases/question_answering/how_to/chat_vector_db" + }, + { + "source": "/docs/modules/chains/additional/multi_retrieval_qa_router", + "destination": "/docs/use_cases/question_answering/how_to/multi_retrieval_qa_router" + }, + { + "source": "/docs/modules/chains/additional/question_answering", + "destination": "/docs/use_cases/question_answering/how_to/question_answering" + }, + { + "source": "/docs/modules/chains/popular/vector_db_qa", + "destination": "/docs/use_cases/question_answering/how_to/vector_db_qa" + }, + { + "source": "/docs/modules/chains/popular/summarize", + "destination": "/docs/use_cases/summarization/summarize" + }, + { + "source": "/docs/modules/chains/popular/sqlite", + "destination": "/docs/use_cases/tabular/sqlite" + }, + { + "source": "/docs/modules/chains/popular/openai_functions", + "destination": "/docs/modules/chains/how_to/openai_functions" + }, + { + "source": "/docs/modules/chains/additional/llm_requests", + "destination": "/docs/use_cases/apis/llm_requests" + }, + { + "source": "/docs/modules/chains/additional/openai_openapi", + "destination": "/docs/use_cases/apis/openai_openapi" + }, + { + "source": "/docs/modules/chains/additional/openapi", + "destination": "/docs/use_cases/apis/openapi" + }, + { + "source": "/docs/modules/chains/additional/openapi_openai", + "destination": "/docs/use_cases/apis/openapi_openai" + }, + { + "source": "/docs/modules/chains/additional/cpal", + "destination": "/docs/use_cases/code_writing/cpal" + }, + { + "source": "/docs/modules/chains/additional/llm_bash", + "destination": "/docs/use_cases/code_writing/llm_bash" + }, + { + "source": "/docs/modules/chains/additional/llm_math", + "destination": "/docs/use_cases/code_writing/llm_math" + }, + { + "source": "/docs/modules/chains/additional/llm_symbolic_math", + "destination": "/docs/use_cases/code_writing/llm_symbolic_math" + }, + { + "source": "/docs/modules/chains/additional/pal", + "destination": "/docs/use_cases/code_writing/pal" + }, + { + "source": "/docs/modules/chains/additional/graph_arangodb_qa", + "destination": "/docs/use_cases/graph/graph_arangodb_qa" + }, + { + "source": "/docs/modules/chains/additional/graph_cypher_qa", + "destination": "/docs/use_cases/graph/graph_cypher_qa" + }, + { + "source": "/docs/modules/chains/additional/graph_hugegraph_qa", + "destination": "/docs/use_cases/graph/graph_hugegraph_qa" + }, + { + "source": "/docs/modules/chains/additional/graph_kuzu_qa", + "destination": "/docs/use_cases/graph/graph_kuzu_qa" + }, + { + "source": "/docs/modules/chains/additional/graph_nebula_qa", + "destination": "/docs/use_cases/graph/graph_nebula_qa" + }, + { + "source": "/docs/modules/chains/additional/graph_qa", + "destination": "/docs/use_cases/graph/graph_qa" + }, + { + "source": "/docs/modules/chains/additional/graph_sparql_qa", + "destination": "/docs/use_cases/graph/graph_sparql_qa" + }, + { + "source": "/docs/modules/chains/additional/neptune_cypher_qa", + "destination": "/docs/use_cases/graph/neptune_cypher_qa" + }, + { + "source": "/docs/modules/chains/additional/tot", + "destination": "/docs/use_cases/graph/tot" + }, + { + "source": "/docs/use_cases/question_answering//document-context-aware-QA", + "destination": "/docs/use_cases/question_answering/how_to/document-context-aware-QA" + }, + { + "source": "/docs/modules/chains/additional/flare", + "destination": "/docs/use_cases/question_answering/how_to/flare" + }, + { + "source": "/docs/modules/chains/additional/hyde", + "destination": "/docs/use_cases/question_answering/how_to/hyde" + }, + { + "source": "/docs/use_cases/question_answering//local_retrieval_qa", + "destination": "/docs/use_cases/question_answering/how_to/local_retrieval_qa" + }, + { + "source": "/docs/modules/chains/additional/qa_citations", + "destination": "/docs/use_cases/question_answering/how_to/qa_citations" + }, + { + "source": "/docs/modules/chains/additional/vector_db_text_generation", + "destination": "/docs/use_cases/question_answering/how_to/vector_db_text_generation" + }, + { + "source": "/docs/modules/chains/additional/openai_functions_retrieval_qa", + "destination": "/docs/use_cases/question_answering/integrations/openai_functions_retrieval_qa" + }, + { + "source": "/docs/use_cases/question_answering//semantic-search-over-chat", + "destination": "/docs/use_cases/question_answering/integrations/semantic-search-over-chat" + }, + { + "source": "/docs/modules/chains/additional/llm_checker", + "destination": "/docs/use_cases/self_check/llm_checker" + }, + { + "source": "/docs/modules/chains/additional/llm_summarization_checker", + "destination": "/docs/use_cases/self_check/llm_summarization_checker" + }, + { + "source": "/docs/modules/chains/additional/elasticsearch_database", + "destination": "/docs/use_cases/tabular/elasticsearch_database" + }, + { + "source": "/docs/modules/chains/additional/tagging", + "destination": "/docs/use_cases/tagging" } ] } \ No newline at end of file diff --git a/docs/extras/additional_resources/tutorials.mdx b/docs/extras/additional_resources/tutorials.mdx index 6b76bb130049d..3a56b1cd770f6 100644 --- a/docs/extras/additional_resources/tutorials.mdx +++ b/docs/extras/additional_resources/tutorials.mdx @@ -1,5 +1,6 @@ # Tutorials +Below are links to video tutorials and courses on LangChain. For written guides on common use cases for LangChain, check out the [use cases guides](/docs/use_cases). ⛓ icon marks a new addition [last update 2023-07-05] diff --git a/docs/extras/guides/debugging.md b/docs/extras/guides/debugging.md index b03a96f19e9bf..2034289899523 100644 --- a/docs/extras/guides/debugging.md +++ b/docs/extras/guides/debugging.md @@ -4,7 +4,7 @@ If you're building with LLMs, at some point something will break, and you'll nee Here's a few different tools and functionalities to aid in debugging. - + ## Tracing diff --git a/docs/extras/guides/model_laboratory.ipynb b/docs/extras/guides/model_laboratory.ipynb index 181b76489445e..24fd5f7760754 100644 --- a/docs/extras/guides/model_laboratory.ipynb +++ b/docs/extras/guides/model_laboratory.ipynb @@ -5,7 +5,7 @@ "id": "920a3c1a", "metadata": {}, "source": [ - "# Model Comparison\n", + "# Model comparison\n", "\n", "Constructing your language model application will likely involved choosing between many different options of prompts, models, and even chains to use. When doing so, you will want to compare these different options on different inputs in an easy, flexible, and intuitive way. \n", "\n", @@ -254,7 +254,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.3" } }, "nbformat": 4, diff --git a/docs/extras/integrations/callbacks/argilla.ipynb b/docs/extras/integrations/callbacks/argilla.ipynb index c231a49772dba..7a78b3198c69b 100644 --- a/docs/extras/integrations/callbacks/argilla.ipynb +++ b/docs/extras/integrations/callbacks/argilla.ipynb @@ -14,7 +14,7 @@ "> using both human and machine feedback. We provide support for each step in the MLOps cycle, \n", "> from data labeling to model monitoring.\n", "\n", - "\n", + "\n", " \"Open\n", "" ] diff --git a/docs/extras/integrations/document_loaders/Etherscan.ipynb b/docs/extras/integrations/document_loaders/Etherscan.ipynb index 5edf001568262..059211f14ef6d 100644 --- a/docs/extras/integrations/document_loaders/Etherscan.ipynb +++ b/docs/extras/integrations/document_loaders/Etherscan.ipynb @@ -13,12 +13,12 @@ "You will need a Etherscan api key to proceed. The free api key has 5 calls per seconds quota.\n", "\n", "The loader supports the following six functinalities:\n", - "* Retrieve normal transactions under specifc account on Ethereum Mainet\n", - "* Retrieve internal transactions under specifc account on Ethereum Mainet\n", - "* Retrieve erc20 transactions under specifc account on Ethereum Mainet\n", - "* Retrieve erc721 transactions under specifc account on Ethereum Mainet\n", - "* Retrieve erc1155 transactions under specifc account on Ethereum Mainet\n", - "* Retrieve ethereum balance in wei under specifc account on Ethereum Mainet\n", + "* Retrieve normal transactions under specific account on Ethereum Mainet\n", + "* Retrieve internal transactions under specific account on Ethereum Mainet\n", + "* Retrieve erc20 transactions under specific account on Ethereum Mainet\n", + "* Retrieve erc721 transactions under specific account on Ethereum Mainet\n", + "* Retrieve erc1155 transactions under specific account on Ethereum Mainet\n", + "* Retrieve ethereum balance in wei under specific account on Ethereum Mainet\n", "\n", "\n", "If the account does not have corresponding transactions, the loader will a list with one document. The content of document is ''.\n", diff --git a/docs/extras/integrations/document_loaders/example_data/notebook.md b/docs/extras/integrations/document_loaders/example_data/notebook.md index 1b51407a4bc09..712bfd174cc52 100644 --- a/docs/extras/integrations/document_loaders/example_data/notebook.md +++ b/docs/extras/integrations/document_loaders/example_data/notebook.md @@ -2,7 +2,7 @@ This notebook covers how to load data from an .ipynb notebook into a format suitable by LangChain. - + ```python diff --git a/docs/extras/integrations/document_loaders/tomarkdown.ipynb b/docs/extras/integrations/document_loaders/tomarkdown.ipynb index 23415e0bf33d8..359c4c88ee6c7 100644 --- a/docs/extras/integrations/document_loaders/tomarkdown.ipynb +++ b/docs/extras/integrations/document_loaders/tomarkdown.ipynb @@ -113,7 +113,7 @@ "\n", "The modules are (from least to most complex):\n", "\n", - "- [Models](https://python.langchain.com/en/latest/modules/models.html): Supported model types and integrations.\n", + "- [Models](https://python.langchain.com/docs/modules/model_io/models/): Supported model types and integrations.\n", "\n", "- [Prompts](https://python.langchain.com/en/latest/modules/prompts.html): Prompt management, optimization, and serialization.\n", "\n", diff --git a/docs/extras/integrations/providers/arangodb.mdx b/docs/extras/integrations/providers/arangodb.mdx index e2650f374fc89..5866dc92311f4 100644 --- a/docs/extras/integrations/providers/arangodb.mdx +++ b/docs/extras/integrations/providers/arangodb.mdx @@ -13,7 +13,7 @@ pip install python-arango Connect your ArangoDB Database with a Chat Model to get insights on your data. -See the notebook example [here](/docs/modules/chains/additional/graph_arangodb_qa.html). +See the notebook example [here](/docs/use_cases/graph/graph_arangodb_qa.html). ```python from arango import ArangoClient diff --git a/docs/extras/integrations/providers/argilla.mdx b/docs/extras/integrations/providers/argilla.mdx index a3653860c2be9..3c882a3294e5d 100644 --- a/docs/extras/integrations/providers/argilla.mdx +++ b/docs/extras/integrations/providers/argilla.mdx @@ -22,7 +22,7 @@ If you don't you can refer to [Argilla - 🚀 Quickstart](https://docs.argilla.i ## Tracking -See a [usage example of `ArgillaCallbackHandler`](/docs/modules/callbacks/integrations/argilla.html). +See a [usage example of `ArgillaCallbackHandler`](/docs/integrations/callbacks/argilla.html). ```python from langchain.callbacks import ArgillaCallbackHandler diff --git a/docs/extras/integrations/providers/cassandra.mdx b/docs/extras/integrations/providers/cassandra.mdx index 404a44dd985e9..3ab57a83df7d0 100644 --- a/docs/extras/integrations/providers/cassandra.mdx +++ b/docs/extras/integrations/providers/cassandra.mdx @@ -28,7 +28,7 @@ from langchain.memory import CassandraChatMessageHistory ## Memory -See a [usage example](/docs/modules/memory/integrations/cassandra_chat_message_history). +See a [usage example](/docs/integrations/memory/cassandra_chat_message_history). ```python from langchain.memory import CassandraChatMessageHistory diff --git a/docs/extras/integrations/providers/databricks.ipynb b/docs/extras/integrations/providers/databricks.ipynb index 21ffc08a25203..4064b1c264055 100644 --- a/docs/extras/integrations/providers/databricks.ipynb +++ b/docs/extras/integrations/providers/databricks.ipynb @@ -166,7 +166,7 @@ "source": [ "### SQL Database Agent example\n", "\n", - "This example demonstrates the use of the [SQL Database Agent](/docs/modules/agents/toolkits/sql_database.html) for answering questions over a Databricks database." + "This example demonstrates the use of the [SQL Database Agent](/docs/integrations/toolkits/sql_database.html) for answering questions over a Databricks database." ] }, { diff --git a/docs/extras/integrations/providers/databricks.md b/docs/extras/integrations/providers/databricks.md index 8dd3bf3d4c32f..0b4fc630e5277 100644 --- a/docs/extras/integrations/providers/databricks.md +++ b/docs/extras/integrations/providers/databricks.md @@ -32,11 +32,11 @@ See [MLflow AI Gateway](/docs/ecosystem/integrations/mlflow_ai_gateway). Databricks as an LLM provider ----------------------------- -The notebook [Wrap Databricks endpoints as LLMs](/docs/modules/model_io/models/llms/integrations/databricks.html) illustrates the method to wrap Databricks endpoints as LLMs in LangChain. It supports two types of endpoints: the serving endpoint, which is recommended for both production and development, and the cluster driver proxy app, which is recommended for interactive development. +The notebook [Wrap Databricks endpoints as LLMs](/docs/integrations/llms/databricks.html) illustrates the method to wrap Databricks endpoints as LLMs in LangChain. It supports two types of endpoints: the serving endpoint, which is recommended for both production and development, and the cluster driver proxy app, which is recommended for interactive development. Databricks endpoints support Dolly, but are also great for hosting models like MPT-7B or any other models from the Hugging Face ecosystem. Databricks endpoints can also be used with proprietary models like OpenAI to provide a governance layer for enterprises. Databricks Dolly ---------------- -Databricks’ Dolly is an instruction-following large language model trained on the Databricks machine learning platform that is licensed for commercial use. The model is available on Hugging Face Hub as databricks/dolly-v2-12b. See the notebook [Hugging Face Hub](/docs/modules/model_io/models/llms/integrations/huggingface_hub.html) for instructions to access it through the Hugging Face Hub integration with LangChain. +Databricks’ Dolly is an instruction-following large language model trained on the Databricks machine learning platform that is licensed for commercial use. The model is available on Hugging Face Hub as databricks/dolly-v2-12b. See the notebook [Hugging Face Hub](/docs/integrations/llms/huggingface_hub.html) for instructions to access it through the Hugging Face Hub integration with LangChain. diff --git a/docs/extras/integrations/providers/momento.mdx b/docs/extras/integrations/providers/momento.mdx index 5f7659b867cf1..2317c80cd7a43 100644 --- a/docs/extras/integrations/providers/momento.mdx +++ b/docs/extras/integrations/providers/momento.mdx @@ -51,4 +51,4 @@ Momento can be used as a distributed memory store for LLMs. ### Chat Message History Memory -See [this notebook](/docs/modules/memory/integrations/momento_chat_message_history.html) for a walkthrough of how to use Momento as a memory store for chat message history. +See [this notebook](/docs/integrations/memory/momento_chat_message_history.html) for a walkthrough of how to use Momento as a memory store for chat message history. diff --git a/docs/extras/integrations/providers/motherduck.mdx b/docs/extras/integrations/providers/motherduck.mdx index b8256586a578e..a388bd96fca8b 100644 --- a/docs/extras/integrations/providers/motherduck.mdx +++ b/docs/extras/integrations/providers/motherduck.mdx @@ -31,7 +31,7 @@ db = SQLDatabase.from_uri(conn_str) db_chain = SQLDatabaseChain.from_llm(OpenAI(temperature=0), db, verbose=True) ``` -From here, see the [SQL Chain](/docs/modules/chains/popular/sqlite.html) documentation on how to use. +From here, see the [SQL Chain](/docs/use_cases/tabular/sqlite.html) documentation on how to use. ## LLMCache diff --git a/docs/extras/integrations/providers/openai.mdx b/docs/extras/integrations/providers/openai.mdx index 82745c2dfc09c..63463fc478eb1 100644 --- a/docs/extras/integrations/providers/openai.mdx +++ b/docs/extras/integrations/providers/openai.mdx @@ -58,7 +58,7 @@ For a more detailed walkthrough of this, see [this notebook](/docs/modules/data_ ## Chain -See a [usage example](/docs/modules/chains/additional/moderation). +See a [usage example](/docs/guides/safety/moderation). ```python from langchain.chains import OpenAIModerationChain diff --git a/docs/extras/integrations/providers/redis.mdx b/docs/extras/integrations/providers/redis.mdx index b7350a847bf79..d1316e4d5bd93 100644 --- a/docs/extras/integrations/providers/redis.mdx +++ b/docs/extras/integrations/providers/redis.mdx @@ -106,4 +106,4 @@ Redis can be used to persist LLM conversations. For a more detailed walkthrough of the `VectorStoreRetrieverMemory` wrapper, see [this notebook](/docs/modules/memory/integrations/vectorstore_retriever_memory.html). #### Chat Message History Memory -For a detailed example of Redis to cache conversation message history, see [this notebook](/docs/modules/memory/integrations/redis_chat_message_history.html). +For a detailed example of Redis to cache conversation message history, see [this notebook](/docs/integrations/memory/redis_chat_message_history.html). diff --git a/docs/extras/integrations/toolkits/openapi_nla.ipynb b/docs/extras/integrations/toolkits/openapi_nla.ipynb index 03e13d92d1b34..c2f3b90e41f81 100644 --- a/docs/extras/integrations/toolkits/openapi_nla.ipynb +++ b/docs/extras/integrations/toolkits/openapi_nla.ipynb @@ -9,7 +9,7 @@ "\n", "Natural Language API Toolkits (NLAToolkits) permit LangChain Agents to efficiently plan and combine calls across endpoints. This notebook demonstrates a sample composition of the Speak, Klarna, and Spoonacluar APIs.\n", "\n", - "For a detailed walkthrough of the OpenAPI chains wrapped within the NLAToolkit, see the [OpenAPI Operation Chain](/docs/modules/chains/additional/openapi.html) notebook.\n", + "For a detailed walkthrough of the OpenAPI chains wrapped within the NLAToolkit, see the [OpenAPI Operation Chain](/docs/use_cases/apis/openapi.html) notebook.\n", "\n", "### First, import dependencies and load the LLM" ] diff --git a/docs/extras/integrations/toolkits/spark_sql.ipynb b/docs/extras/integrations/toolkits/spark_sql.ipynb index aad7af482c321..c29f6841c99de 100644 --- a/docs/extras/integrations/toolkits/spark_sql.ipynb +++ b/docs/extras/integrations/toolkits/spark_sql.ipynb @@ -6,7 +6,7 @@ "source": [ "# Spark SQL Agent\n", "\n", - "This notebook shows how to use agents to interact with a Spark SQL. Similar to [SQL Database Agent](https://python.langchain.com/en/latest/modules/agents/toolkits/examples/sql_database.html), it is designed to address general inquiries about Spark SQL and facilitate error recovery.\n", + "This notebook shows how to use agents to interact with a Spark SQL. Similar to [SQL Database Agent](https://python.langchain.com/docs/integrations/toolkits/sql_database), it is designed to address general inquiries about Spark SQL and facilitate error recovery.\n", "\n", "**NOTE: Note that, as this agent is in active development, all answers might not be correct. Additionally, it is not guaranteed that the agent won't perform DML statements on your Spark cluster given certain questions. Be careful running it on sensitive data!**" ] diff --git a/docs/extras/integrations/toolkits/sql_database.ipynb b/docs/extras/integrations/toolkits/sql_database.ipynb index 7f65f48af043b..9fbc31da236aa 100644 --- a/docs/extras/integrations/toolkits/sql_database.ipynb +++ b/docs/extras/integrations/toolkits/sql_database.ipynb @@ -8,7 +8,7 @@ "source": [ "# SQL Database Agent\n", "\n", - "This notebook showcases an agent designed to interact with a sql databases. The agent builds off of [SQLDatabaseChain](https://python.langchain.com/docs/modules/chains/popular/sqlite) and is designed to answer more general questions about a database, as well as recover from errors.\n", + "This notebook showcases an agent designed to interact with a sql databases. The agent builds off of [SQLDatabaseChain](https://python.langchain.com/docs/use_cases/tabular/sqlite) and is designed to answer more general questions about a database, as well as recover from errors.\n", "\n", "Note that, as this agent is in active development, all answers might not be correct. Additionally, it is not guaranteed that the agent won't perform DML statements on your database given certain questions. Be careful running it on sensitive data!\n", "\n", @@ -63,7 +63,7 @@ "source": [ "## Using ZERO_SHOT_REACT_DESCRIPTION\n", "\n", - "This shows how to initialize the agent using the ZERO_SHOT_REACT_DESCRIPTION agent type. Note that this is an alternative to the above." + "This shows how to initialize the agent using the ZERO_SHOT_REACT_DESCRIPTION agent type." ] }, { diff --git a/docs/extras/modules/chains/additional/extraction.ipynb b/docs/extras/modules/chains/additional/extraction.ipynb deleted file mode 100644 index a57c12f9c95cf..0000000000000 --- a/docs/extras/modules/chains/additional/extraction.ipynb +++ /dev/null @@ -1,566 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "6605e7f7", - "metadata": {}, - "source": [ - "# Extraction\n", - "\n", - "The extraction chain uses the OpenAI `functions` parameter to specify a schema to extract entities from a document. This helps us make sure that the model outputs exactly the schema of entities and properties that we want, with their appropriate types.\n", - "\n", - "The extraction chain is to be used when we want to extract several entities with their properties from the same passage (i.e. what people were mentioned in this passage?)" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "34f04daf", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/harrisonchase/.pyenv/versions/3.9.1/envs/langchain/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.4) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.\n", - " warnings.warn(\n" - ] - } - ], - "source": [ - "from langchain.chat_models import ChatOpenAI\n", - "from langchain.chains import create_extraction_chain, create_extraction_chain_pydantic\n", - "from langchain.prompts import ChatPromptTemplate" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "a2648974", - "metadata": {}, - "outputs": [], - "source": [ - "llm = ChatOpenAI(temperature=0, model=\"gpt-3.5-turbo-0613\")" - ] - }, - { - "cell_type": "markdown", - "id": "5ef034ce", - "metadata": {}, - "source": [ - "## Extracting entities" - ] - }, - { - "cell_type": "markdown", - "id": "78ff9df9", - "metadata": {}, - "source": [ - "To extract entities, we need to create a schema where we specify all the properties we want to find and the type we expect them to have. We can also specify which of these properties are required and which are optional." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "4ac43eba", - "metadata": {}, - "outputs": [], - "source": [ - "schema = {\n", - " \"properties\": {\n", - " \"name\": {\"type\": \"string\"},\n", - " \"height\": {\"type\": \"integer\"},\n", - " \"hair_color\": {\"type\": \"string\"},\n", - " },\n", - " \"required\": [\"name\", \"height\"],\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "640bd005", - "metadata": {}, - "outputs": [], - "source": [ - "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", - " \"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "64313214", - "metadata": {}, - "outputs": [], - "source": [ - "chain = create_extraction_chain(schema, llm)" - ] - }, - { - "cell_type": "markdown", - "id": "17c48adb", - "metadata": {}, - "source": [ - "As we can see, we extracted the required entities and their properties in the required format (it even calculated Claudia's height before returning!)" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "cc5436ed", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'name': 'Alex', 'height': 5, 'hair_color': 'blonde'},\n", - " {'name': 'Claudia', 'height': 6, 'hair_color': 'brunette'}]" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "chain.run(inp)" - ] - }, - { - "cell_type": "markdown", - "id": "8d51fcdc", - "metadata": {}, - "source": [ - "## Several entity types" - ] - }, - { - "cell_type": "markdown", - "id": "5813affe", - "metadata": {}, - "source": [ - "Notice that we are using OpenAI functions under the hood and thus the model can only call one function per request (with one, unique schema)" - ] - }, - { - "cell_type": "markdown", - "id": "511b9838", - "metadata": {}, - "source": [ - "If we want to extract more than one entity type, we need to introduce a little hack - we will define our properties with an included entity type. \n", - "\n", - "Following we have an example where we also want to extract dog attributes from the passage. Notice the 'person_' and 'dog_' prefixes we use for each property; this tells the model which entity type the property refers to. In this way, the model can return properties from several entity types in one single call." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "cf243a26", - "metadata": {}, - "outputs": [], - "source": [ - "schema = {\n", - " \"properties\": {\n", - " \"person_name\": {\"type\": \"string\"},\n", - " \"person_height\": {\"type\": \"integer\"},\n", - " \"person_hair_color\": {\"type\": \"string\"},\n", - " \"dog_name\": {\"type\": \"string\"},\n", - " \"dog_breed\": {\"type\": \"string\"},\n", - " },\n", - " \"required\": [\"person_name\", \"person_height\"],\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "52841fb3", - "metadata": {}, - "outputs": [], - "source": [ - "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", - "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", - " \"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "93f904ab", - "metadata": {}, - "outputs": [], - "source": [ - "chain = create_extraction_chain(schema, llm)" - ] - }, - { - "cell_type": "markdown", - "id": "eb074f7b", - "metadata": {}, - "source": [ - "People attributes and dog attributes were correctly extracted from the text in the same call" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "db3e9e17", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'person_name': 'Alex',\n", - " 'person_height': 5,\n", - " 'person_hair_color': 'blonde',\n", - " 'dog_name': 'Frosty',\n", - " 'dog_breed': 'labrador'},\n", - " {'person_name': 'Claudia',\n", - " 'person_height': 6,\n", - " 'person_hair_color': 'brunette'}]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "chain.run(inp)" - ] - }, - { - "cell_type": "markdown", - "id": "0273e0e2", - "metadata": {}, - "source": [ - "## Unrelated entities" - ] - }, - { - "cell_type": "markdown", - "id": "c07b3480", - "metadata": {}, - "source": [ - "What if our entities are unrelated? In that case, the model will return the unrelated entities in different dictionaries, allowing us to successfully extract several unrelated entity types in the same call." - ] - }, - { - "cell_type": "markdown", - "id": "01d98af0", - "metadata": {}, - "source": [ - "Notice that we use `required: []`: we need to allow the model to return **only** person attributes or **only** dog attributes for a single entity (person or dog)" - ] - }, - { - "cell_type": "code", - "execution_count": 48, - "id": "e584c993", - "metadata": {}, - "outputs": [], - "source": [ - "schema = {\n", - " \"properties\": {\n", - " \"person_name\": {\"type\": \"string\"},\n", - " \"person_height\": {\"type\": \"integer\"},\n", - " \"person_hair_color\": {\"type\": \"string\"},\n", - " \"dog_name\": {\"type\": \"string\"},\n", - " \"dog_breed\": {\"type\": \"string\"},\n", - " },\n", - " \"required\": [],\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 49, - "id": "ad6b105f", - "metadata": {}, - "outputs": [], - "source": [ - "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", - "\n", - "Willow is a German Shepherd that likes to play with other dogs and can always be found playing with Milo, a border collie that lives close by.\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 50, - "id": "6bfe5a33", - "metadata": {}, - "outputs": [], - "source": [ - "chain = create_extraction_chain(schema, llm)" - ] - }, - { - "cell_type": "markdown", - "id": "24fe09af", - "metadata": {}, - "source": [ - "We have each entity in its own separate dictionary, with only the appropriate attributes being returned" - ] - }, - { - "cell_type": "code", - "execution_count": 51, - "id": "f6e1fd89", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},\n", - " {'person_name': 'Claudia',\n", - " 'person_height': 6,\n", - " 'person_hair_color': 'brunette'},\n", - " {'dog_name': 'Willow', 'dog_breed': 'German Shepherd'},\n", - " {'dog_name': 'Milo', 'dog_breed': 'border collie'}]" - ] - }, - "execution_count": 51, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "chain.run(inp)" - ] - }, - { - "cell_type": "markdown", - "id": "0ac466d1", - "metadata": {}, - "source": [ - "## Extra info for an entity" - ] - }, - { - "cell_type": "markdown", - "id": "d240ffc1", - "metadata": {}, - "source": [ - "What if.. _we don't know what we want?_ More specifically, say we know a few properties we want to extract for a given entity but we also want to know if there's any extra information in the passage. Fortunately, we don't need to structure everything - we can have unstructured extraction as well. \n", - "\n", - "We can do this by introducing another hack, namely the *extra_info* attribute - let's see an example." - ] - }, - { - "cell_type": "code", - "execution_count": 68, - "id": "f19685f6", - "metadata": {}, - "outputs": [], - "source": [ - "schema = {\n", - " \"properties\": {\n", - " \"person_name\": {\"type\": \"string\"},\n", - " \"person_height\": {\"type\": \"integer\"},\n", - " \"person_hair_color\": {\"type\": \"string\"},\n", - " \"dog_name\": {\"type\": \"string\"},\n", - " \"dog_breed\": {\"type\": \"string\"},\n", - " \"dog_extra_info\": {\"type\": \"string\"},\n", - " },\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 81, - "id": "200c3477", - "metadata": {}, - "outputs": [], - "source": [ - "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", - "\n", - "Willow is a German Shepherd that likes to play with other dogs and can always be found playing with Milo, a border collie that lives close by.\n", - "\"\"\"" - ] - }, - { - "cell_type": "code", - "execution_count": 82, - "id": "ddad7dc6", - "metadata": {}, - "outputs": [], - "source": [ - "chain = create_extraction_chain(schema, llm)" - ] - }, - { - "cell_type": "markdown", - "id": "e5c0dbbc", - "metadata": {}, - "source": [ - "It is nice to know more about Willow and Milo!" - ] - }, - { - "cell_type": "code", - "execution_count": 83, - "id": "c22cfd30", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},\n", - " {'person_name': 'Claudia',\n", - " 'person_height': 6,\n", - " 'person_hair_color': 'brunette'},\n", - " {'dog_name': 'Willow',\n", - " 'dog_breed': 'German Shepherd',\n", - " 'dog_extra_information': 'likes to play with other dogs'},\n", - " {'dog_name': 'Milo',\n", - " 'dog_breed': 'border collie',\n", - " 'dog_extra_information': 'lives close by'}]" - ] - }, - "execution_count": 83, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "chain.run(inp)" - ] - }, - { - "cell_type": "markdown", - "id": "698b4c4d", - "metadata": {}, - "source": [ - "## Pydantic example" - ] - }, - { - "cell_type": "markdown", - "id": "6504a6d9", - "metadata": {}, - "source": [ - "We can also use a Pydantic schema to choose the required properties and types and we will set as 'Optional' those that are not strictly required.\n", - "\n", - "By using the `create_extraction_chain_pydantic` function, we can send a Pydantic schema as input and the output will be an instantiated object that respects our desired schema. \n", - "\n", - "In this way, we can specify our schema in the same manner that we would a new class or function in Python - with purely Pythonic types." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "6792866b", - "metadata": {}, - "outputs": [], - "source": [ - "from typing import Optional, List\n", - "from pydantic import BaseModel, Field" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "36a63761", - "metadata": {}, - "outputs": [], - "source": [ - "class Properties(BaseModel):\n", - " person_name: str\n", - " person_height: int\n", - " person_hair_color: str\n", - " dog_breed: Optional[str]\n", - " dog_name: Optional[str]" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "8ffd1e57", - "metadata": {}, - "outputs": [], - "source": [ - "chain = create_extraction_chain_pydantic(pydantic_schema=Properties, llm=llm)" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "24baa954", - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "inp = \"\"\"\n", - "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", - "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", - " \"\"\"" - ] - }, - { - "cell_type": "markdown", - "id": "84e0a241", - "metadata": {}, - "source": [ - "As we can see, we extracted the required entities and their properties in the required format:" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "f771df58", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[Properties(person_name='Alex', person_height=5, person_hair_color='blonde', dog_breed='labrador', dog_name='Frosty'),\n", - " Properties(person_name='Claudia', person_height=6, person_hair_color='brunette', dog_breed=None, dog_name=None)]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "chain.run(inp)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0df61283", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.1" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} \ No newline at end of file diff --git a/docs/extras/modules/chains/how_to/async_chain.ipynb b/docs/extras/modules/chains/how_to/async_chain.ipynb index f3e979a3f3a8e..866a4b1c91ed2 100644 --- a/docs/extras/modules/chains/how_to/async_chain.ipynb +++ b/docs/extras/modules/chains/how_to/async_chain.ipynb @@ -9,7 +9,7 @@ "\n", "LangChain provides async support for Chains by leveraging the [asyncio](https://docs.python.org/3/library/asyncio.html) library.\n", "\n", - "Async methods are currently supported in `LLMChain` (through `arun`, `apredict`, `acall`) and `LLMMathChain` (through `arun` and `acall`), `ChatVectorDBChain`, and [QA chains](/docs/modules/chains/additional/question_answering.html). Async support for other chains is on the roadmap." + "Async methods are currently supported in `LLMChain` (through `arun`, `apredict`, `acall`) and `LLMMathChain` (through `arun` and `acall`), `ChatVectorDBChain`, and [QA chains](/docs/use_cases/question_answering/how_to/question_answering.html). Async support for other chains is on the roadmap." ] }, { diff --git a/docs/extras/modules/chains/popular/openai_functions.ipynb b/docs/extras/modules/chains/how_to/openai_functions.ipynb similarity index 97% rename from docs/extras/modules/chains/popular/openai_functions.ipynb rename to docs/extras/modules/chains/how_to/openai_functions.ipynb index da4ed68ced275..62e9067beb346 100644 --- a/docs/extras/modules/chains/popular/openai_functions.ipynb +++ b/docs/extras/modules/chains/how_to/openai_functions.ipynb @@ -494,9 +494,9 @@ "\n", "There are a number of more specific chains that use OpenAI functions.\n", "- [Extraction](/docs/modules/chains/additional/extraction): very similar to structured output chain, intended for information/entity extraction specifically.\n", - "- [Tagging](/docs/modules/chains/additional/tagging): tag inputs.\n", - "- [OpenAPI](/docs/modules/chains/additional/openapi_openai): take an OpenAPI spec and create + execute valid requests against the API, using OpenAI functions under the hood.\n", - "- [QA with citations](/docs/modules/chains/additional/qa_citations): use OpenAI functions ability to extract citations from text." + "- [Tagging](/docs/use_cases/tagging): tag inputs.\n", + "- [OpenAPI](/docs/use_cases/apis/openapi_openai): take an OpenAPI spec and create + execute valid requests against the API, using OpenAI functions under the hood.\n", + "- [QA with citations](/docs/use_cases/question_answering/how_to/qa_citations): use OpenAI functions ability to extract citations from text." ] } ], diff --git a/docs/extras/modules/data_connection/document_loaders/integrations/dropbox.ipynb b/docs/extras/modules/data_connection/document_loaders/integrations/dropbox.ipynb new file mode 100644 index 0000000000000..43ec915b197c7 --- /dev/null +++ b/docs/extras/modules/data_connection/document_loaders/integrations/dropbox.ipynb @@ -0,0 +1,149 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Dropbox\n", + "\n", + "[Drobpox](https://en.wikipedia.org/wiki/Dropbox) is a file hosting service that brings everything-traditional files, cloud content, and web shortcuts together in one place.\n", + "\n", + "This notebook covers how to load documents from *Dropbox*. In addition to common files such as text and PDF files, it also supports *Dropbox Paper* files.\n", + "\n", + "## Prerequisites\n", + "\n", + "1. Create a Dropbox app.\n", + "2. Give the app these scope permissions: `files.metadata.read` and `files.content.read`.\n", + "3. Generate access token: https://www.dropbox.com/developers/apps/create.\n", + "4. `pip install dropbox` (requires `pip install unstructured` for PDF filetype).\n", + "\n", + "## Intructions\n", + "\n", + "`DropboxLoader`` requires you to create a Dropbox App and generate an access token. This can be done from https://www.dropbox.com/developers/apps/create. You also need to have the Dropbox Python SDK installed (pip install dropbox).\n", + "\n", + "DropboxLoader can load data from a list of Dropbox file paths or a single Dropbox folder path. Both paths should be relative to the root directory of the Dropbox account linked to the access token." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: dropbox in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (11.36.2)\n", + "Requirement already satisfied: requests>=2.16.2 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from dropbox) (2.31.0)\n", + "Requirement already satisfied: six>=1.12.0 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from dropbox) (1.16.0)\n", + "Requirement already satisfied: stone>=2 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from dropbox) (3.3.1)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from requests>=2.16.2->dropbox) (3.2.0)\n", + "Requirement already satisfied: idna<4,>=2.5 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from requests>=2.16.2->dropbox) (3.4)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from requests>=2.16.2->dropbox) (2.0.4)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from requests>=2.16.2->dropbox) (2023.7.22)\n", + "Requirement already satisfied: ply>=3.4 in /Users/rbarragan/.local/share/virtualenvs/langchain-kv0dsrF5/lib/python3.11/site-packages (from stone>=2->dropbox) (3.11)\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "pip install dropbox" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "from langchain.document_loaders import DropboxLoader" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# Generate access token: https://www.dropbox.com/developers/apps/create.\n", + "dropbox_access_token = \"\"\n", + "# Dropbox root folder\n", + "dropbox_folder_path = \"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "loader = DropboxLoader(\n", + " dropbox_access_token=dropbox_access_token,\n", + " dropbox_folder_path=dropbox_folder_path,\n", + " recursive=False\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File /JHSfLKn0.jpeg could not be decoded as text. Skipping.\n", + "File /A REPORT ON WILES’ CAMBRIDGE LECTURES.pdf could not be decoded as text. Skipping.\n" + ] + } + ], + "source": [ + "documents = loader.load()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "page_content='# 🎉 Getting Started with Dropbox Paper\\nDropbox Paper is great for capturing ideas and gathering quick feedback from your team. You can use words, images, code, or media from other apps, or go ahead and connect your calendar and add to-dos for projects.\\n\\n*Explore and edit this doc to play with some of these features. This doc is all yours. No one will see your edits unless you share this doc.*\\n\\n\\n# The basics\\n\\n**Selecting text** activates the formatting toolbar, where you can apply basic formatting, create lists, and add comments.\\n\\n[ ] Create to-do lists\\n- Bulleted lists\\n1. Numbered lists\\n\\n**Starting a new line** activates the insert toolbar, where you can add media from other apps, links to Dropbox files, photos, and more.\\n\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523574441249_paper-insert.png)\\n\\n\\n\\n**Add emojis** to your doc or comment by typing `**:**` ****and choosing a character. \\n\\n# 👍 👎 👏 ✅ ❌ ❤️ ⭐ 💡 📌\\n\\n\\n# Images\\n\\n**Selecting images** activates the image toolbar, where you can align images left, center, right or expand them to full width.\\n\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523473869783_Hot_Sauce.jpg)\\n\\n\\nPaste images or gifs right next to each other and they\\'ll organize automatically. Click on an image twice to start full-screen gallery view.\\n\\n\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523564536543_Clock_Melt.png)\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523564528339_Boom_Box_Melt.png)\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523564549819_Soccerball_Melt.png)\\n\\n![You can add captions too](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523564518899_Cacti_Melt.png)\\n![What a strange, melting toaster!](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523564508553_Toaster_Melt.png)\\n\\n\\n \\n\\n\\n# Form meets function\\n\\nYou and your team can create the way you want, with what you want. Dropbox Paper adapts to the way your team captures ideas.\\n\\n**Add media from apps** like YouTube and Vimeo, or add audio from Spotify and SoundCloud. Files from Google Drive and Dropbox update automatically. Start a new line and choose add media, or drop in a link to try it out.\\n\\n\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523575138939_paper-embed.png)\\n\\n\\n\\n## YouTube\\nhttps://www.youtube.com/watch?v=fmsq1uKOa08&\\n\\n\\n[https://youtu.be/fmsq1uKOa08](https://youtu.be/fmsq1uKOa08)\\n\\n\\n\\n## SoundCloud\\nhttps://w.soundcloud.com/player/?url=https%3A%2F%2Fsoundcloud.com%2Ftycho%2Fspoon-inside-out-tycho-version&autoplay=false\\n\\n\\n[https://soundcloud.com/tycho/spoon-inside-out-tycho-version](https://soundcloud.com/tycho/spoon-inside-out-tycho-version) \\n\\n\\n\\n## Dropbox files\\nhttps://www.dropbox.com/s/bgi58tkovntch5e/Wireframe%20render.pdf?dl=0\\n\\n\\n\\n\\n## Code\\n\\n**Write code** in Dropbox Paper with automatic language detection and syntax highlighting. Start a new line and type three backticks (```).\\n\\n\\n public class HelloWorld { \\n public static void main(String[] args) { \\n System.out.println(\"Hello, World\");\\n }\\n }\\n\\n\\n\\n## Tables\\n\\n**Create a table** with the menu that shows up on the right when you start a new line.\\n\\n| To insert a row or column, hover over a dividing line and click the + | ⭐ |\\n| ------------------------------------------------------------------------------------------------------- | ----- |\\n| To delete, select rows/columns and click the trash can | ⭐ ⭐ |\\n| To delete the entire table, click inside a cell, then click the dot in the top left corner of the table | ⭐ ⭐ ⭐ |\\n\\n\\n\\n\\n\\n# Collaborate with people\\n\\n**Invite people to your doc** so they can view, comment, and edit. Invite anyone you’d like—team members, contractors, stakeholders—to give them access to your doc.\\n\\n![](https://paper-attachments.dropbox.com/s_72143DBFDAF4C9DE702BB246920BC47FE7E1FA76AC23CC699374430D94E96DD2_1523574876795_paper-invite.png)\\n\\n\\n**Make your docs discoverable to your team** by adding them to shared folders. Invite-only folders create more privacy.\\n\\n\\n## Comments\\n\\n**Add comments** on a single character, an entire document, or any asset by highlighting it. **Add stickers** by clicking the 😄 in the message box.\\n\\n\\n## To-dos\\n\\n**Bring someone’s attention to a comment or to-do** by typing **@** and their name or email address. Reference a doc or folder by typing **+** and its name.\\n\\n[ ] Mentioning someone on a to-do assigns it to them and sends an email [@Patricia J](http://#)\\n[ ] Add a due date by clicking the calendar icon [@Jonathan C](http://#) [@Patricia J](http://#)\\n[ ] You can also mention docs [+🎉 Getting Started with Dropbox Paper](http://#)\\n\\n\\n\\n# Go mobile\\n\\nEdit, create, and share Paper docs on Android or iOS phones and tablets. Download the apps in the [App Store](https://itunes.apple.com/us/app/paper-by-dropbox/id1126623662) and [Google Play Store](https://play.google.com/store/apps/details?id=com.dropbox.paper).\\n\\n\\n\\n# Help\\n\\n**Visit the** [**help center**](https://www.dropbox.com/help/topics/paper) for more about Dropbox Paper.\\n\\n**For more tips,** click the **?** in the bottom right of the screen and choose **Paper guide**.\\n\\n**Give us feedback** by selecting “Feedback” from the **?** in the bottom right of the screen. We’d love to hear what you think. \\n\\n' metadata={'source': 'dropbox:///_ Getting Started with Dropbox Paper.paper', 'title': '_ Getting Started with Dropbox Paper.paper'}\n", + "page_content='# 🥂 Toast to Droplets\\n❓ **Rationale:** Reflection, especially writing, is the key to deep learning! Let’s take a few minutes to reflect on your first day at Dropbox individually, and then one lucky person will have the chance to share their toast.\\n\\n✍️ **How to fill out this template:**\\n\\n- Option 1: You can sign in and then click “Create doc” to make a copy of this template. Fill in the blanks!\\n- Option 2: If you don’t know your personal Dropbox login quickly, you can copy and paste this text into another word processing tool and start typing! \\n\\n\\n\\n## To my Droplet class:\\n\\nI feel so happy and excited to be making a toast to our newest Droplet class at Dropbox Basecamp.\\n\\nAt the beginning of our first day, I felt a bit underwhelmed with all information, and now, at the end of our first day at Dropbox, I feel I know enough for me to ramp up, but still a lot to learn**.**\\n\\nI can’t wait to explore every drl, but especially drl/(App Center)/benefits/allowance. I heard it’s so informative!\\n\\nDesigning an enlightened way of working is important, and to me, it means **a lot since I love what I do and I can help people around the globe**.\\n\\nI am excited to work with my team and flex my **technical and social** skills in my role as a **Software Engineer**.\\n\\nAs a Droplet, I pledge to:\\n\\n\\n1. Be worthy of trust by **working always with values and integrity**.\\n\\n\\n1. Keep my customers first by **caring about their happiness and the value that we provide as a company**.\\n\\n\\n1. Own it, keep it simple, and especially make work human by **providing value to people****.**\\n\\nCongrats, Droplets!\\n\\n' metadata={'source': 'dropbox:///_ Toast to Droplets.paper', 'title': '_ Toast to Droplets.paper'}\n", + "page_content='APPEARED IN BULLETIN OF THE AMERICAN MATHEMATICAL SOCIETY Volume 31, Number 1, July 1994, Pages 15-38\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n4 9 9 1\\n\\nK. RUBIN AND A. SILVERBERG\\n\\nl u J\\n\\nAbstract. In lectures at the Newton Institute in June of 1993, Andrew Wiles announced a proof of a large part of the Taniyama-Shimura Conjecture and, as a consequence, Fermat’s Last Theorem. This report for nonexperts dis- cusses the mathematics involved in Wiles’ lectures, including the necessary background and the mathematical history.\\n\\n1\\n\\n] T N . h t a m\\n\\nIntroduction\\n\\nOn June 23, 1993, Andrew Wiles wrote on a blackboard, before an audience at the Newton Institute in Cambridge, England, that if p is a prime number, u, v, and w are rational numbers, and up + vp + wp = 0, then uvw = 0. In other words, he announced that he could prove Fermat’s Last Theorem. His announce- ment came at the end of his series of three talks entitled “Modular forms, elliptic curves, and Galois representations” at the week-long workshop on “p-adic Galois representations, Iwasawa theory, and the Tamagawa numbers of motives”.\\n\\n[\\n\\n1 v 0 2 2 7 0 4 9 / h t a m : v i X r a\\n\\nIn the margin of his copy of the works of Diophantus, next to a problem on\\n\\nPythagorean triples, Pierre de Fermat (1601–1665) wrote:\\n\\nCubum autem in duos cubos, aut quadratoquadratum in duos quadrato- quadratos, et generaliter nullam in infinitum ultra quadratum potestatem in duos ejusdem nominis fas est dividere : cujus rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet.\\n\\n(It is impossible to separate a cube into two cubes, or a fourth power into two fourth powers, or in general, any power higher than the second into two like powers. I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.)\\n\\nWe restate Fermat’s conjecture as follows.\\n\\nFermat’s Last Theorem. If n > 2, then an +bn = cn has no solutions in nonzero integers a, b, and c.\\n\\nA proof by Fermat has never been found, and the problem has remained open, inspiring many generations of mathematicians. Much of modern number theory has been built on attempts to prove Fermat’s Last Theorem. For details on the\\n\\nReceived by the editors November 29, 1993. 1991 Mathematics Subject Classification. Primary 11G05; Secondary 11D41, 11G18. The authors thank the National Science Foundation for financial support.\\n\\nc(cid:13)1994 American Mathematical Society 0273-0979/94 $1.00 + $.25 per page\\n\\n1\\n\\n2\\n\\nK. RUBIN AND A. SILVERBERG\\n\\nhistory of Fermat’s Last Theorem (last because it is the last of Fermat’s questions to be answered) see [5], [6], and [26].\\n\\nWhat Andrew Wiles announced in Cambridge was that he could prove “many” elliptic curves are modular, sufficiently many to imply Fermat’s Last Theorem. In this paper we will explain Wiles’ work on elliptic curves and its connection with 1 we introduce elliptic curves and modularity, and Fermat’s Last Theorem. give the connection between Fermat’s Last Theorem and the Taniyama-Shimura Conjecture on the modularity of elliptic curves. In 2 we describe how Wiles re- duces the proof of the Taniyama-Shimura Conjecture to what we call the Modular Lifting Conjecture (which can be viewed as a weak form of the Taniyama-Shimura Conjecture), by using a theorem of Langlands and Tunnell. In 4 we show § how the Semistable Modular Lifting Conjecture is related to a conjecture of Mazur on deformations of Galois representations (Conjecture 4.2), and in 5 we describe Wiles’ method of attack on this conjecture. In order to make this survey as acces- sible as possible to nonspecialists, the more technical details are postponed as long as possible, some of them to the appendices.\\n\\nIn\\n\\n§\\n\\n§\\n\\n3 and §\\n\\n§\\n\\nMuch of this report is based on Wiles’ lectures in Cambridge. The authors apol- ogize for any errors we may have introduced. We also apologize to those whose mathematical contributions we, due to our incomplete understanding, do not prop- erly acknowledge.\\n\\nThe ideas Wiles introduced in his Cambridge lectures will have an important influence on research in number theory. Because of the great interest in this subject and the lack of a publicly available manuscript, we hope this report will be useful to the mathematics community. In early December 1993, shortly before this paper went to press, Wiles announced that “the final calculation of a precise upper bound for the Selmer group in the semistable case” (see 5.4 below) “is not yet § complete as it stands,” but that he believes he will be able to finish it in the near future using the ideas explained in his Cambridge lectures. While Wiles’ proof of Theorem 5.3 below and Fermat’s Last Theorem depends on the calculation he referred to in his December announcement, Theorem 5.4 and Corollary 5.5 do not. Wiles’ work provides for the first time infinitely many modular elliptic curves over the rational numbers which are not isomorphic over the complex numbers (see 5.5 for an explicit infinite family).\\n\\n5.3 and\\n\\n§\\n\\n§\\n\\nNotation. The integers, rational numbers, complex numbers, and p-adic integers will be denoted Z, Q, C, and Zp, respectively. If F is a field, then ¯F denotes an algebraic closure of F .\\n\\n1. Connection between Fermat’s Last Theorem and elliptic curves\\n\\n1.1. Fermat’s Last Theorem follows from modularity of elliptic curves. Suppose Fermat’s Last Theorem were false. Then there would exist nonzero integers a, b, c, and n > 2 such that an + bn = cn. It is easy to see that no generality is lost by assuming that n is a prime greater than three (or greater than four million, by [2]; see [14] for n = 3 and 4) and that a and b are relatively prime. Write down the cubic curve:\\n\\ny2 = x(x + an)(x\\n\\nbn).\\n\\n(1)\\n\\n−\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n3\\n\\n1.4 we will explain what it means for an elliptic curve to be modular. Kenneth Ribet [27] proved that if n is a prime greater than three, a, b, and c are nonzero integers, and an + bn = cn, then the elliptic curve (1) is not modular. But the results announced by Wiles imply the following.\\n\\nIn\\n\\n1.3 we will see that such curves are elliptic curves, and in\\n\\n§\\n\\n§\\n\\nTheorem 1.1 (Wiles). If A and B are distinct, nonzero, relatively prime integers, and AB(A\\n\\nB) is divisible by 16, then the elliptic curve\\n\\n−\\n\\ny2 = x(x + A)(x + B)\\n\\nis modular.\\n\\nbn with a, b, c, and n coming from our hypothetical solution to a Fermat equation as above, we see that the conditions of Theorem 1.1 are satisfied since n 5 and one of a, b, and c is even. Thus Theorem 1.1 and Ribet’s result together imply Fermat’s Last Theorem!\\n\\nTaking A = an and B =\\n\\n−\\n\\n≥\\n\\n1.2. History. The story of the connection between Fermat’s Last Theorem and elliptic curves begins in 1955, when Yutaka Taniyama (1927–1958) posed problems which may be viewed as a weaker version of the following conjecture (see [38]).\\n\\nTaniyama-Shimura Conjecture. Every elliptic curve over Q is modular.\\n\\nThe conjecture in the present form was made by Goro Shimura around 1962–64 and has become better understood due to work of Shimura [33–37] and of Andr´e Weil [42] (see also [7]). The Taniyama-Shimura Conjecture is one of the major conjectures in number theory.\\n\\nBeginning in the late 1960s [15–18], Yves Hellegouarch connected Fermat equa- tions an + bn = cn with elliptic curves of the form (1) and used results about Fer- mat’s Last Theorem to prove results about elliptic curves. The landscape changed abruptly in 1985 when Gerhard Frey stated in a lecture at Oberwolfach that elliptic curves arising from counterexamples to Fermat’s Last Theorem could not be mod- ular [11]. Shortly thereafter Ribet [27] proved this, following ideas of Jean-Pierre Serre [32] (see [24] for a survey). In other words, “Taniyama-Shimura Conjecture\\n\\nFermat’s Last Theorem”. Thus, the stage was set. A proof of the Taniyama-Shimura Conjecture (or enough of it to know that elliptic curves coming from Fermat equations are modular) would be a proof of Fermat’s Last Theorem.\\n\\n⇒\\n\\n1.3. Elliptic curves.\\n\\nDefinition. An elliptic curve over Q is a nonsingular curve defined by an equation of the form\\n\\ny2 + a1xy + a3y = x3 + a2x2 + a4x + a6\\n\\n(2)\\n\\nwhere the coefficients ai are integers. The solution ( on the elliptic curve.\\n\\n, ∞\\n\\n) will be viewed as a point\\n\\n∞\\n\\n4\\n\\nK. RUBIN AND A. SILVERBERG\\n\\nRemarks. (i) A singular point on a curve f (x, y) = 0 is a point where both partial derivatives vanish. A curve is nonsingular if it has no singular points.\\n\\n(ii) Two elliptic curves over Q are isomorphic if one can be obtained from the other by changing coordinates x = A2x′ + B, y = A3y′ + Cx′ + D, with A, B, C, D\\n\\nQ and dividing through by A6.\\n\\n∈ (iii) Every elliptic curve over Q is isomorphic to one of the form\\n\\ny2 = x3 + a2x2 + a4x + a6\\n\\nwith integers ai. A curve of this form is nonsingular if and only if the cubic on the right side has no repeated roots.\\n\\nExample. The equation y2 = x(x + 32)(x\\n\\n42) defines an elliptic curve over Q.\\n\\n−\\n\\n1.4. Modularity. Let H denote the complex upper half plane C : Im(z) > 0 } where Im(z) is the imaginary part of z. If N is a positive integer, define a group of matrices\\n\\nz\\n\\n{\\n\\n∈\\n\\na b c d\\n\\nSL2(Z) : c is divisible by N\\n\\n.\\n\\nΓ0(N ) =\\n\\n∈\\n\\n(z) = az+b The group Γ0(N ) acts on H by linear fractional transformations cz+d . (cid:9) (cid:1) The quotient space H/Γ0(N ) is a (noncompact) Riemann surface. It can be com- pleted to a compact Riemann surface, denoted X0(N ), by adjoining a finite set of points called cusps. The cusps are the finitely many equivalence classes of Q ∞} under the action of Γ0(N ) (see Chapter 1 of [35]). The complex points of an elliptic curve can also be viewed as a compact Riemann surface.\\n\\na b c d\\n\\n(cid:8)(cid:0)\\n\\n(cid:1)\\n\\n(cid:0)\\n\\ni\\n\\n∪{\\n\\nDefinition. An elliptic curve E is modular if, for some integer N , there is a holo- morphic map from X0(N ) onto E.\\n\\nExample. It can be shown that there is a (holomorphic) isomorphism from X0(15) onto the elliptic curve y2 = x(x + 32)(x\\n\\n42).\\n\\n−\\n\\nRemark . There are many equivalent definitions of modularity (see II.4.D of [24] and appendix of [22]). In some cases the equivalence is a deep result. For Wiles’ 1.7 proof of Fermat’s Last Theorem it suffices to use only the definition given in below.\\n\\n§\\n\\n§\\n\\n1.5. Semistability.\\n\\nDefinition. An elliptic curve over Q is semistable at the prime q if it is isomorphic to an elliptic curve over Q which modulo q either is nonsingular or has a singu- lar point with two distinct tangent directions. An elliptic curve over Q is called semistable if it is semistable at every prime.\\n\\nExample. The elliptic curve y2 = x(x + 32)(x isomorphic to y2 + xy + y = x3 + x2 x(x + 42)(x\\n\\n42) is semistable because it is − 10, but the elliptic curve y2 =\\n\\n10x\\n\\n−\\n\\n−\\n\\n32) is not semistable (it is not semistable at 2).\\n\\n−\\n\\n2 we explain how Wiles shows that his main result on Galois representations (Theorem 5.3) implies the following part of the Taniyama-Shimura Conjecture.\\n\\nBeginning in\\n\\n§\\n\\nSemistable Taniyama-Shimura Conjecture. Every semistable elliptic curve over Q is modular.\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n5\\n\\nProposition 1.2. The Semistable Taniyama-Shimura Conjecture implies Theorem 1.1.\\n\\nProof. If A and B are distinct, nonzero, relatively prime integers, write EA,B for the elliptic curve defined by y2 = x(x + A)(x + B). Since EA,B and E−A,−B are isomorphic over the complex numbers (i.e., as Riemann surfaces), EA,B is modular if and only if E−A,−B is modular. If further AB(A B) is divisible by 16, then either EA,B or E−A,−B is semistable (this is easy to check directly; see for example I.1 of [24]). The Semistable Taniyama-Shimura Conjecture now implies that both § EA,B and E−A,−B are modular, and thus implies Theorem 1.1.\\n\\n−\\n\\nRemark . In 1.1 we saw that Theorem 1.1 and Ribet’s Theorem together imply Fermat’s Last Theorem. Therefore, the Semistable Taniyama-Shimura Conjecture implies Fermat’s Last Theorem.\\n\\n§\\n\\n1.6. Modular forms. In this paper we will work with a definition of modularity which uses modular forms.\\n\\nDefinition. If N is a positive integer, a modular form f of weight k for Γ0(N ) is C which satisfies a holomorphic function f : H\\n\\n→\\n\\nf (γ(z)) = (cz + d)kf (z)\\n\\na b c d\\n\\nH,\\n\\n(3)\\n\\nΓ0(N ) and z\\n\\nfor every γ =\\n\\n∈\\n\\n∈\\n\\n(cid:1)\\n\\n(cid:0)\\n\\nand is holomorphic at the cusps (see Chapter 2 of [35]).\\n\\n1 1 0 1\\n\\nΓ0(N )), so ∞ n=0 ane2πinz, with complex numbers an and it has a Fourier expansion f (z) = (cid:1) . We say f is a cusp form if it with n vanishes at all the cusps; in particular for a cusp form the coefficient a0 (the value at i\\n\\nA modular form f satisfies f (z) = f (z + 1) (apply (3) to\\n\\n∈\\n\\n(cid:0)\\n\\n0 because f is holomorphic at the cusp i\\n\\n≥\\n\\n∞\\n\\nP\\n\\n) is zero. Call a cusp form normalized if a1 = 1.\\n\\n∞ For fixed N there are commuting linear operators (called Hecke operators) Tm, 1, on the (finite-dimensional) vector space of cusp forms of weight\\n\\nfor integers m two for Γ0(N ) (see Chapter 3 of [35]). If f (z) =\\n\\n≥\\n\\n∞ n=1 ane2πinz, then\\n\\nP danm/d2\\n\\n∞\\n\\ne2πinz\\n\\n(4)\\n\\nTmf (z) =\\n\\nn=1 X\\n\\n(d,N )=1 d|(n,m)\\n\\n(cid:0) X\\n\\n(cid:1)\\n\\nwhere (a, b) denotes the greatest common divisor of a and b and a b means that a divides b. The Hecke algebra T (N ) is the ring generated over Z by these operators.\\n\\n|\\n\\nDefinition. In this paper an eigenform will mean a normalized cusp form of weight two for some Γ0(N ) which is an eigenfunction for all the Hecke operators.\\n\\n∞ n=1 ane2πinz is an eigenform, then Tmf = amf for all m.\\n\\nBy (4), if f (z) =\\n\\nP\\n\\n6\\n\\nK. RUBIN AND A. SILVERBERG\\n\\n1.7. Modularity, revisited. Suppose E is an elliptic curve over Q. If p is a prime, write Fp for the finite field with p elements, and let E(Fp) denote the Fp- solutions of the equation for E (including the point at infinity). We now give a second definition of modularity for an elliptic curve.\\n\\nDefinition. An elliptic curve E over Q is modular if there exists an eigenform\\n\\n∞ n=1 ane2πinz such that for all but finitely many primes q,\\n\\n#(E(Fq)).\\n\\n(5) P\\n\\naq = q + 1\\n\\n− 2. An overview\\n\\nThe flow chart shows how Fermat’s Last Theorem would follow if one knew the Semistable Modular Lifting Conjecture (Conjecture 2.1) for the primes 3 and 5. 1 we discussed the upper arrow, i.e., the implication “Semistable Taniyama- In § Fermat’s Last Theorem”. In this section we will discuss the Shimura Conjecture other implications in the flow chart. The implication given by the lowest arrow is straightforward (Proposition 2.3), while the middle one uses an ingenious idea of Wiles (Proposition 2.4).\\n\\n⇒\\n\\nFermat’s Last Theorem\\n\\n✻\\n\\nSemistable Taniyama-Shimura Conjecture\\n\\n✻\\n\\n(cid:0)\\n\\n❅ ❅\\n\\n(cid:0)\\n\\nSemistable Taniyama-Shimura for ¯ρE,3 irreducible\\n\\nSemistable Modular Lifting for p = 5\\n\\n✻\\n\\n(cid:0) (cid:0)\\n\\n❅\\n\\n❅\\n\\nSemistable Modular Lifting for p = 3\\n\\nLanglands-Tunnell Theorem\\n\\nSemistable Modular Lifting Conjecture\\n\\nFermat’s Last Theorem .\\n\\n⇒\\n\\nRemark . By the Modular Lifting Conjecture we will mean the Semistable Modular Lifting Conjecture with the hypothesis of semistability removed. The arguments of this section can also be used to show that the Modular Lifting Conjecture for p = 3 and 5, together with the Langlands-Tunnell Theorem, imply the full Taniyama- Shimura Conjecture.\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n7\\n\\n2.1. Semistable Modular Lifting. Let ¯Q denote the algebraic closure of Q in C, and let GQ be the Galois group Gal( ¯Q/Q). If p is a prime, write\\n\\nF× p\\n\\n¯εp : GQ\\n\\n→\\n\\nfor the character giving the action of GQ on the p-th roots of unity. For the facts about elliptic curves stated below, see [39]. If E is an elliptic curve over Q and F is a subfield of the complex numbers, there is a natural commutative group law on the set of F -solutions of E, with the point at infinity as the identity element. Denote this group E(F ). If p is a prime, write E[p] for the subgroup of points in E( ¯Q) of order dividing p. Then E[p] ∼= F2 p. The action of GQ on E[p] gives a continuous representation\\n\\nGL2(Fp)\\n\\n¯ρE,p : GQ\\n\\n→\\n\\n(defined up to isomorphism) such that\\n\\n(6)\\n\\ndet(¯ρE,p) = ¯εp\\n\\nand for all but finitely many primes q,\\n\\n#(E(Fq))\\n\\n(7)\\n\\ntrace(¯ρE,p(Frobq))\\n\\nq + 1\\n\\n(mod p).\\n\\n≡ (See Appendix A for the definition of the Frobenius elements Frobq ∈ to each prime number q.)\\n\\n−\\n\\nGQ attached\\n\\n∞ n=1 ane2πinz is an eigenform, let\\n\\nOf denote the ring of integers of the number field Q(a2, a3, . . . ). (Recall that our eigenforms are normalized so that a1 = 1.)\\n\\nIf f (z) =\\n\\nP\\n\\nThe following conjecture is in the spirit of a conjecture of Mazur (see Conjectures\\n\\n3.2 and 4.2).\\n\\nConjecture 2.1 (Semistable Modular Lifting Conjecture). Suppose p is an odd prime and E is a semistable elliptic curve over Q satisfying\\n\\n(a) ¯ρE,p is irreducible, (b) there are an eigenform f (z) =\\n\\n∞ n=1 ane2πinz and a prime ideal λ of\\n\\nOf\\n\\nsuch that p\\n\\nλ and for all but finitely many primes q,\\n\\n∈\\n\\nP\\n\\n#(E(Fq))\\n\\naq ≡\\n\\nq + 1\\n\\n(mod λ).\\n\\n−\\n\\nThen E is modular.\\n\\nThe Semistable Modular Lifting Conjecture is a priori weaker than the Semi- stable Taniyama-Shimura Conjecture because of the extra hypotheses (a) and (b). The more serious condition is (b); there is no known way to produce such a form in general. But when p = 3, the existence of such a form follows from the theorem below of Tunnell [41] and Langlands [20]. Wiles then gets around condition (a) by a clever argument (described below) which, when ¯ρE,3 is not irreducible, allows him to use p = 5 instead.\\n\\n8\\n\\nK. RUBIN AND A. SILVERBERG\\n\\n2.2. Langlands-Tunnell Theorem. In order to state the Langlands-Tunnell Theorem, we need weight-one modular forms for a subgroup of Γ0(N ). Let\\n\\na b c d\\n\\nSL2(Z) : c\\n\\n0 (mod N ), a\\n\\nd\\n\\n1 (mod N )\\n\\n.\\n\\nΓ1(N ) =\\n\\n∈\\n\\n≡\\n\\n≡\\n\\n≡\\n\\n(cid:1)\\n\\n(cid:9)\\n\\n(cid:8)(cid:0)\\n\\nReplacing Γ0(N ) by Γ1(N ) in 1.6, one can define the notion of cusp forms on § Γ1(N ). See Chapter 3 of [35] for the definitions of the Hecke operators on the space of weight-one cusp forms for Γ1(N ).\\n\\nTheorem 2.2 (Langlands-Tunnell). Suppose ρ : GQ GL2(C) is a continuous irreducible representation whose image in PGL2(C) is a subgroup of S4 (the sym- metric group on four elements ), τ is complex conjugation, and det(ρ(τ )) = 1. ∞ n=1 bne2πinz for some Γ1(N ), which is an Then there is a weight-one cusp form eigenfunction for all the corresponding Hecke operators, such that for all but finitely many primes q,\\n\\n→\\n\\n−\\n\\nP\\n\\n(8)\\n\\nbq = trace(ρ(Frobq)).\\n\\nThe theorem as stated by Langlands [20] and by Tunnell [41] produces an auto- morphic representation rather than a cusp form. Using the fact that det(ρ(τ )) = 1, standard techniques (see for example [12]) show that this automorphic repre-\\n\\n− sentation corresponds to a weight-one cusp form as in Theorem 2.2.\\n\\n2.3. Semistable Modular Lifting\\n\\nSemistable Taniyama-Shimura.\\n\\n⇒\\n\\nProposition 2.3. Suppose the Semistable Modular Lifting Conjecture is true for p = 3, E is a semistable elliptic curve, and ¯ρE,3 is irreducible. Then E is modular.\\n\\nProof. It suffices to show that hypothesis (b) of the Semistable Modular Lifting Conjecture is satisfied with the given curve E, for p = 3. There is a faithful representation\\n\\nGL2(Z[√\\n\\nGL2(C)\\n\\nψ : GL2(F3) ֒\\n\\n2])\\n\\n−\\n\\n⊂\\n\\n→\\n\\nGL2(F3),\\n\\nsuch that for every g\\n\\n∈ trace(ψ(g))\\n\\n(mod(1 + √\\n\\n(9)\\n\\ntrace(g)\\n\\n2))\\n\\n≡\\n\\n−\\n\\nand\\n\\n(10)\\n\\ndet(ψ(g))\\n\\ndet(g)\\n\\n(mod 3).\\n\\n≡\\n\\nExplicitly, ψ can be defined on generators of GL2(F3) by\\n\\n√\\n\\n1 1 1 0\\n\\n1 1 1 0\\n\\n1 1\\n\\n1 1\\n\\n2 1 1 0\\n\\n.\\n\\nψ\\n\\n=\\n\\nand ψ\\n\\n=\\n\\n− −\\n\\n− −\\n\\n−\\n\\n−\\n\\n(cid:19)\\n\\n(cid:18)(cid:18)\\n\\n(cid:19)(cid:19)\\n\\n(cid:18)\\n\\n(cid:18)(cid:18) ¯ρE,3. If τ is complex conjugation, then it follows from (6) and (10) that 1. The image of ψ in PGL2(C) is a subgroup of PGL2(F3) ∼= S4.\\n\\n(cid:19)\\n\\n(cid:19)(cid:19)\\n\\n(cid:18)\\n\\nLet ρ = ψ ◦ det(ρ(τ )) = Using that ¯ρE,3 is irreducible, one can show that ρ is irreducible.\\n\\n−\\n\\n∞ n=1 bne2πinz be a weight-one cusp form for some Γ1(N ) obtained by applying the Langlands-Tunnell\\n\\nLet p be a prime of ¯Q containing 1 + √\\n\\n2. Let g(z) =\\n\\n−\\n\\nP\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n9\\n\\nTheorem (Theorem 2.2) to ρ. It follows from (6) and (10) that N is divisible by 3. The function\\n\\n0 if d 1 if d 1 if d\\n\\n0 (mod 3), 1 (mod 3), 2 (mod 3)\\n\\n∞\\n\\n≡ ≡ ≡\\n\\nχ(d)e2πinz where χ(d) =\\n\\nE(z) = 1 + 6\\n\\n\\uf8f1 \\uf8f2\\n\\nn=1 X\\n\\nXd|n\\n\\n−\\n\\n∞ n=1 cne2πinz is a weight-one modular form for Γ1(3). The product g(z)E(z) = It is now is a weight-two cusp form for Γ0(N ) with cn ≡ bn possible to find an eigenform f (z) = (mod p) for every n (see 6.10 and 6.11 of [4]). By (7), (8), and (9), f satisfies (b) of the Semistable Modular Lifting Conjecture with p = 3 and with λ = p\\n\\n\\uf8f3\\n\\nbn (mod p) for all n. P n=1 ane2πinz on Γ0(N ) such that an ≡ ∩ Of .\\n\\n∞\\n\\nP\\n\\nProposition 2.4 (Wiles). Suppose the Semistable Modular Lifting Conjecture is true for p = 3 and 5, E is a semistable elliptic curve over Q, and ¯ρE,3 is reducible. Then E is modular.\\n\\nProof. The elliptic curves over Q for which both ¯ρE,3 and ¯ρE,5 are reducible are all known to be modular (see Appendix B.1). Thus we can suppose ¯ρE,5 is irreducible. It suffices to produce an eigenform as in (b) of the Semistable Modular Lifting Conjecture, but this time there is no analogue of the Langlands-Tunnell Theorem to help. Wiles uses the Hilbert Irreducibility Theorem, applied to a parameter space of elliptic curves, to produce another semistable elliptic curve E′ over Q satisfying\\n\\n(i) ¯ρE′,5 is isomorphic to ¯ρE,5, and (ii) ¯ρE′,3 is irreducible.\\n\\n(In fact there will be infinitely many such E′; see Appendix B.2.) Now by Proposi- ∞ n=1 ane2πinz be a corresponding eigenform. tion 2.3, E′ is modular. Let f (z) = Then for all but finitely many primes q, P\\n\\n#(E′(Fq)) trace(¯ρE,5(Frobq))\\n\\naq = q + 1\\n\\ntrace(¯ρE′,5(Frobq)) #(E(Fq)) q + 1\\n\\n−\\n\\n≡ ≡\\n\\n(mod 5)\\n\\n≡\\n\\n−\\n\\nby (7). Thus the form f satisfies hypothesis (b) of the Semistable Modular Lifting Conjecture, and we conclude that E is modular.\\n\\nTaken together, Propositions 2.3 and 2.4 show that the Semistable Modular Lifting Conjecture for p = 3 and 5 implies the Semistable Taniyama-Shimura Con- jecture.\\n\\n3. Galois representations\\n\\nThe next step is to translate the Semistable Modular Lifting Conjecture into a conjecture (Conjecture 3.2) about the modularity of liftings of Galois repre- sentations. Throughout this paper, if A is a topological ring, a representation GL2(A) will mean a continuous homomorphism and [ρ] will denote the ρ : GQ isomorphism class of ρ. If p is a prime, let\\n\\n→\\n\\nZ× p\\n\\nεp : GQ\\n\\n→\\n\\nbe the character giving the action of GQ on p-power roots of unity.\\n\\n10\\n\\nK. RUBIN AND A. SILVERBERG\\n\\n3.1. The p-adic representation attached to an elliptic curve. Suppose E is an elliptic curve over Q and p is a prime number. For every positive integer n, write E[pn] for the subgroup in E( ¯Q) of points of order dividing pn and Tp(E) for the inverse limit of the E[pn] with respect to multiplication by p. For every n, E[pn] ∼= (Z/pnZ)2, and so Tp(E) ∼= Z2 p. The action of GQ induces a representation\\n\\nGL2(Zp)\\n\\nρE,p : GQ\\n\\n→\\n\\nsuch that det(ρE,p) = εp and for all but finitely many primes q,\\n\\n#(E(Fq)).\\n\\n(11)\\n\\ntrace(ρE,p(Frobq)) = q + 1\\n\\n−\\n\\nComposing ρE,p with the reduction map from Zp to Fp gives ¯ρE,p of\\n\\n2.1. §\\n\\n3.2. Modular representations. If f is an eigenform and λ is a prime ideal of Of at λ. Of , let\\n\\nOf,λ denote the completion of\\n\\nDefinition. If A is a ring, a representation ρ : GQ if there are an eigenform f (z) = homomorphism ι :\\n\\nGL2(A) is called modular ∞ n=1 ane2πinz, a ring A′ containing A, and a\\n\\n→\\n\\nA′ such that for all but finitely many primes q,\\n\\nOf →\\n\\nP\\n\\ntrace(ρ(Frobq)) = ι(aq).\\n\\n∞ n=1 ane2πinz and a prime ideal λ of\\n\\nExamples. (i) Given an eigenform f (z) = Of , Eichler and Shimura (see\\n\\n7.6 of [35]) constructed a representation\\n\\n§\\n\\nP\\n\\nρf,λ : GQ\\n\\nGL2(\\n\\nOf,λ)\\n\\n→\\n\\nZ = pZ) and for all but finitely many primes q,\\n\\nsuch that det(ρf,λ) = εp (where λ\\n\\n∩\\n\\n(12)\\n\\ntrace(ρf,λ(Frobq)) = aq.\\n\\nThus ρf,λ is modular with ι taken to be the inclusion of\\n\\nOf in\\n\\nOf,λ.\\n\\n(ii) Suppose p is a prime and E is an elliptic curve over Q. If E is modular, then ρE,p and ¯ρE,p are modular by (11), (7), and (5). Conversely, if ρE,p is modular, then it follows from (11) that E is modular. This proves the following.\\n\\nTheorem 3.1. Suppose E is an elliptic curve over Q. Then\\n\\nE is modular\\n\\nρE,p is modular for every p\\n\\nρE,p is modular for one p.\\n\\n⇔\\n\\n⇔\\n\\nRemark . In this language, the Semistable Modular Lifting Conjecture says that if p is an odd prime, E is a semistable elliptic curve over Q, and ¯ρE,p is modular and irreducible, then ρE,p is modular.\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n11\\n\\n3.3. Liftings of Galois representations. Fix a prime p and a finite field k of characteristic p. Recall that ¯k denotes an algebraic closure of k.\\n\\nGiven a map φ : A\\n\\nB, the induced map from GL2(A) to GL2(B) will also be\\n\\n→\\n\\ndenoted φ. If ρ : GQ A′ for the composition of ρ with the inclusion of GL2(A) in GL2(A′).\\n\\nGL2(A) is a representation and A′ is a ring containing A, we write\\n\\n→\\n\\nρ\\n\\n⊗\\n\\nDefinition. If ¯ρ : GQ ρ : GQ Zp-algebra and there exists a homomorphism ι : A\\n\\nGL2(k) is a representation, we say that a representation GL2(A) is a lifting of ¯ρ (to A) if A is a complete noetherian local\\n\\n→\\n\\n→\\n\\n¯k such that the diagram\\n\\n→ GL2(A)\\n\\n✟✟✯\\n\\n[ρ]\\n\\n✟✟\\n\\nι ❄ GL2(¯k)\\n\\n✲\\n\\nGQ\\n\\n[ ¯ρ ⊗ ¯k]\\n\\n¯k].\\n\\ncommutes, in the sense that [ι\\n\\nρ] = [¯ρ\\n\\n\\n\\n⊗\\n\\nExamples. (i) If E is an elliptic curve then ρE,p is a lifting of ¯ρE,p.\\n\\n(ii) If E is an elliptic curve, p is a prime, and hypotheses (a) and (b) of Conjecture\\n\\n2.1 hold with an eigenform f and prime ideal λ, then ρf,λ is a lifting of ¯ρE,p.\\n\\n3.4. Deformation data. We will be interested not in all liftings of a given ¯ρ, but rather in those satisfying various restrictions. See Appendix A for the definition of GQ associated to primes q. We say that a representation ρ the inertia groups Iq ⊂ of GQ is unramified at a prime q if ρ(Iq) = 1. If Σ is a set of primes, we say ρ is unramified outside of Σ if ρ is unramified at every q / ∈\\n\\nΣ.\\n\\nDefinition. By deformation data we mean a pair\\n\\n= (Σ, t)\\n\\nD where Σ is a finite set of primes and t is one of the words ordinary or flat.\\n\\nZ×\\n\\nA× be the composition of the\\n\\nIf A is a Zp-algebra, let εA : GQ\\n\\np →\\n\\n→\\n\\ncyclotomic character εp with the structure map.\\n\\nDefinition. Given deformation data type- outside of Σ, and ρ is t at p (where t\\n\\nGL2(A) is if A is a complete noetherian local Zp-algebra, det(ρ) = εA, ρ is unramified\\n\\n, a representation ρ : GQ\\n\\nD\\n\\n→\\n\\nD\\n\\nordinary, flat }\\n\\n; see Appendix C).\\n\\n∈ {\\n\\nDefinition. A representation ¯ρ : GQ eigenform f and a prime ideal λ of\\n\\nmodular if there are an\\n\\nGL2(k) is Of such that ρf,λ is a type-\\n\\n→\\n\\nD\\n\\nlifting of ¯ρ.\\n\\nD\\n\\nRemarks. (i) A representation with a type- fore if a representation is\\n\\nlifting must itself be type-\\n\\n. There-\\n\\nD\\n\\nD and modular.\\n\\nmodular, then it is both type-\\n\\nD\\n\\nD\\n\\n(ii) Conversely, if ¯ρ is type-\\n\\n, modular, and satisfies (ii) of Theorem 5.3 below, -modular, by work of Ribet and others (see [28]). This plays an important\\n\\nD\\n\\nthen ¯ρ is D role in Wiles’ work.\\n\\n12\\n\\nK. RUBIN AND A. SILVERBERG\\n\\n3.5. Mazur Conjecture.\\n\\nDefinition. A representation ¯ρ : GQ ¯ρ\\n\\nGL2(k) is called absolutely irreducible if\\n\\n→\\n\\n¯k is irreducible.\\n\\n⊗\\n\\nThe following variant of a conjecture of Mazur (see Conjecture 18 of [23]; see\\n\\nalso Conjecture 4.2 below) implies the Semistable Modular Lifting Conjecture.\\n\\nConjecture 3.2 (Mazur). Suppose p is an odd prime, k is a finite field of charac- GL2(k) is an absolutely irreducible teristic p, lifting of ¯ρ to the ring of integers of\\n\\nis deformation data, and ¯ρ : GQ -modular representation. Then every type-\\n\\nD\\n\\n→ D\\n\\nD a finite extension of Qp is modular.\\n\\nRemark . Loosely speaking, Conjecture 3.2 says that if ¯ρ is modular, then every lifting which “looks modular” is modular.\\n\\nDefinition. An elliptic curve E over Q has good (respectively, bad ) reduction at a prime q if E is nonsingular (respectively, singular) modulo q. An elliptic curve E over Q has ordinary (respectively, supersingular) reduction at q if E has good reduction at q and E[q] has (respectively, does not have) a subgroup of order q stable under the inertia group Iq.\\n\\nProposition 3.3. Conjecture 3.2 implies Conjecture 2.1.\\n\\nProof. Suppose p is an odd prime and E is a semistable elliptic curve over Q which satisfies (a) and (b) of Conjecture 2.1. We will apply Conjecture 3.2 with ¯ρ = ¯ρE,p. Write τ for complex conjugation. Then τ 2 = 1, and by (6), det(¯ρE,p(τ )) = 1. Since ¯ρE,p is irreducible and p is odd, a simple linear algebra argument now shows that ¯ρE,p is absolutely irreducible.\\n\\n−\\n\\nSince E satisfies (b) of Conjecture 2.1, ¯ρE,p is modular. Let\\n\\nΣ = t = ordinary if E has ordinary or bad reduction at p, t = flat if E has supersingular reduction at p,\\n\\np\\n\\nprimes q : E has bad reduction at q\\n\\n,\\n\\n•\\n\\n{\\n\\n} ∪ {\\n\\n}\\n\\n= (Σ, t).\\n\\nD\\n\\nUsing the semistability of E, one can show that ρE,p is a type- (by combining results of several people; see [28]) that ¯ρE,p is 3.2 then says ρE,p is modular. By Theorem 3.1, E is modular.\\n\\nlifting of ¯ρE,p and -modular. Conjecture\\n\\nD\\n\\nD\\n\\n4. Mazur’s deformation theory\\n\\nNext we reformulate Conjecture 3.2 as a conjecture (Conjecture 4.2) that the algebras which parametrize liftings and modular liftings of a given representation are isomorphic. It is this form of Mazur’s conjecture that Wiles attacks directly.\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n13\\n\\n4.1. The universal deformation algebra R. Fix an odd prime p, a finite field k of characteristic p, deformation data representation ¯ρ : GQ extension of Qp with residue field k.\\n\\n, and an absolutely irreducible type-\\n\\nD\\n\\nD is the ring of integers of a finite\\n\\nGL2(k). Suppose\\n\\n→\\n\\nO\\n\\nDefinition. We say ρ : GQ complete noetherian local commutes\\n\\n)-lifting of ¯ρ if ρ is type-\\n\\n, A is a → -algebra with residue field k, and the following diagram\\n\\nGL2(A) is a (\\n\\n,\\n\\nD\\n\\nO\\n\\nD\\n\\nO\\n\\nGL2(A)\\n\\n✟✟✯\\n\\n[ρ]\\n\\n✟✟\\n\\n❄ GL2(k)\\n\\n✲\\n\\nGQ\\n\\n[ ¯ρ]\\n\\nwhere the vertical map is reduction modulo the maximal ideal of A.\\n\\nTheorem 4.1 (Mazur-Ramakrishna). With p, k, an that for every ( φρ : R\\n\\nas above, there are D GL2(R) of ¯ρ, with the property -algebra homomorphism\\n\\n, ¯ρ, and\\n\\nO\\n\\nalgebra R and a (\\n\\n)-lifting ρR : GQ )-lifting ρ of ¯ρ to A there is a unique\\n\\n,\\n\\nO\\n\\nD\\n\\nO\\n\\n→\\n\\n,\\n\\nD\\n\\nO\\n\\nO\\n\\nA such that the diagram\\n\\n→\\n\\n[ρR]\\n\\n✲\\n\\nGQ\\n\\nGL2(R)\\n\\n❍\\n\\n❍❍\\n\\nφρ ❄ GL2(A)\\n\\n[ρ]\\n\\n❍❍❥\\n\\ncommutes.\\n\\nThis theorem was proved by Mazur [21] in the case when\\n\\nis ordinary and is flat. Theorem 4.1 determines R and ρR up to\\n\\nD\\n\\nby Ramakrishna [25] when isomorphism.\\n\\nD\\n\\n4.2. The universal modular deformation algebra T. Fix an odd prime p, a , and an absolutely irreducible finite field k of characteristic p, deformation data -modular, and fix an type- representation ¯ρ : GQ eigenform f and a prime ideal λ of lifting of ¯ρ. is the ring of integers of a finite extension of Qp with Suppose in addition that residue field k, Of,λ ⊆ O\\n\\nD\\n\\nGL2(k). Assume ¯ρ is\\n\\nD\\n\\n→\\n\\nD\\n\\nOf such that ρf,λ is a type-\\n\\nD\\n\\nO , and the diagram\\n\\nGL2(\\n\\nOf,λ) ❄ GL2(k)\\n\\n✟✟✟✯ ✲\\n\\n[ρf,λ] ✟\\n\\nGQ\\n\\n[ ¯ρ]\\n\\ncommutes, where the vertical map is the reduction map.\\n\\n)-lifting of ¯ρ, and Wiles constructs a generalized Hecke algebra T which has the following properties (recall that Hecke algebras T (N ) were defined in\\n\\nUnder these assumptions ρf,λ ⊗ O 1.6).\\n\\nis a (\\n\\n,\\n\\nD\\n\\nO\\n\\n§\\n\\n(T1) T is a complete noetherian local\\n\\nalgebra with residue field k.\\n\\nO\\n\\n14\\n\\nK. RUBIN AND A. SILVERBERG\\n\\n(T2) There are an integer N divisible only by primes in Σ and a homomorphism by the Σ. By abuse of notation\\n\\nfrom the Hecke algebra T (N ) to T such that T is generated over images of the Hecke operators Tq for primes q / ∈ we write Tq also for its image in T.\\n\\nO\\n\\n(T3) There is a (\\n\\n,\\n\\n)-lifting\\n\\nD\\n\\nO\\n\\nGL2(T)\\n\\nρT : GQ\\n\\n→\\n\\nof ¯ρ with the property that trace(ρT(Frobq)) = Tq for every prime q / ∈\\n\\nΣ. )-lifting of ¯ρ to A, then there is a unique\\n\\n(T4) If ρ is modular and is a (\\n\\n,\\n\\nD\\n\\nO\\n\\nalgebra homomorphism ψρ : T\\n\\nA such that the diagram\\n\\nO\\n\\n→ [ρ T]\\n\\n✲\\n\\nGL2(T)\\n\\nGQ\\n\\n❍\\n\\n❍❍\\n\\nψρ ❄ GL2(A)\\n\\n[ρ]\\n\\n❍❍❥\\n\\ncommutes.\\n\\nSince ρT is a (\\n\\n,\\n\\n)-lifting of ¯ρ, by Theorem 4.1 there is a homomorphism\\n\\nD\\n\\nO\\n\\nT\\n\\nϕ : R\\n\\n→\\n\\nρR. By (T3), ϕ(trace(ρR(Frobq))) = Tq for every\\n\\nsuch that ρT is isomorphic to ϕ prime q / ∈\\n\\nΣ, so it follows from (T2) that ϕ is surjective.\\n\\n4.3. Mazur Conjecture, revisited. Conjecture 3.2 can be reformulated in the following way.\\n\\nConjecture 4.2 (Mazur). Suppose p, k, T is an isomorphism. above map ϕ : R\\n\\n, ¯ρ, and\\n\\nare as in\\n\\n4.2. Then the\\n\\nD\\n\\nO\\n\\n§\\n\\n→\\n\\nConjecture 4.2 was stated in [23] (Conjecture 18) for\\n\\nordinary, and Wiles\\n\\nD\\n\\nmodified the conjecture to include the flat case.\\n\\nProposition 4.3. Conjecture 4.2 implies Conjecture 3.2.\\n\\nProof. Suppose ¯ρ : GQ -modular, A is D the ring of integers of a finite extension of Qp, and ρ is a type- lifting of ¯ρ to A. to be the ring of integers of a sufficiently large finite extension of Qp, and Taking and its residue field, respectively, we may assume that ρ is extending ρ and ¯ρ to A, with φρ a ( as in Theorem 4.1. By (T3) and Theorem 4.1, ψ(Tq) = trace(ρ(Frobq)) for all but 3.5 of [35], given such a homomorphism ψ (and viewing A as finitely many q. By ∞ n=1 ane2πinz where aq = ψ(Tq) for all but a subring of C), there is an eigenform finitely many primes q. Thus ρ is modular.\\n\\nGL2(k) is absolutely irreducible and\\n\\n→\\n\\nD\\n\\nO )-lifting of ¯ρ. Assuming Conjecture 4.2, let ψ = φρ ◦\\n\\nO\\n\\nϕ−1 : T\\n\\n,\\n\\nD\\n\\nO\\n\\n→\\n\\n§\\n\\nP\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n15\\n\\n5. Wiles’ approach to the Mazur Conjecture\\n\\nIn this section we sketch the major ideas of Wiles’ attack on Conjecture 4.2. The first step (Theorem 5.2), and the key to Wiles’ proof, is to reduce Conjecture 4.2 to a bound on the order of the cotangent space at a prime of R. In 5.2 we § see that the corresponding tangent space is a Selmer group, and in 5.3 we outline a general procedure due to Kolyvagin for bounding sizes of Selmer groups. The input for Kolyvagin’s method is known as an Euler system. The most difficult 5.4), and the part described as “not yet complete” in his part of Wiles’ work ( § December announcement, is his construction of a suitable Euler system. In 5.5 we state the results announced by Wiles (Theorems 5.3 and 5.4 and Corollary 5.5) and explain why Theorem 5.3 suffices for proving the Semistable Taniyama-Shimura Conjecture. As an application of Corollary 5.5 we write down an infinite family of modular elliptic curves. , ¯ρ, 5 fix p, k,\\n\\n§\\n\\n§\\n\\n∞ n=1 ane2πinz, and λ as in\\n\\n4.2.\\n\\nFor O By property (T4) there is a homomorphism\\n\\n, f (z) =\\n\\n§\\n\\n§\\n\\nD\\n\\nP\\n\\nπ : T\\n\\n→ O . By property (T2) and (12), π satisfies\\n\\nsuch that π π(Tq) = aq for all but finitely many q.\\n\\nρT is isomorphic to ρf,λ ⊗ O\\n\\n\\n\\n5.1. Key reduction. Wiles uses the following generalization of a theorem of Mazur, which says that T is Gorenstein.\\n\\nTheorem 5.1. There is a (noncanonical ) T-module isomorphism\\n\\n) ∼ →\\n\\nHomO(T,\\n\\nT.\\n\\nO\\n\\nLet η denote the ideal of\\n\\ngenerated by the image under the composition\\n\\nO HomO(T,\\n\\n) ∼ →\\n\\nT π\\n\\nO\\n\\n→ O\\n\\nHomO(T,\\n\\nof the element π ∈ choice of isomorphism in Theorem 5.1.\\n\\n). The ideal η is well defined independent of the\\n\\nO\\n\\nThe map π determines distinguished prime ideals of T and R,\\n\\nϕ) = ϕ−1(pT).\\n\\npT = ker(π),\\n\\npR = ker(π\\n\\n\\n\\nTheorem 5.2 (Wiles). If\\n\\n#(pR/p2\\n\\nR)\\n\\n#(\\n\\n/η) <\\n\\n, ∞\\n\\n≤\\n\\nO\\n\\nT is an isomorphism.\\n\\nthen ϕ : R\\n\\n→\\n\\nThe proof is entirely commutative algebra. The surjectivity of ϕ shows that /η). Thus if\\n\\n#(pR/p2 #(pR/p2\\n\\n#(pT/p2 #(\\n\\nT), and Wiles proves that #(pT/p2\\n\\nR) R)\\n\\nT)\\n\\n#(\\n\\n≥ ≤\\n\\n≥\\n\\nO\\n\\n/η), then\\n\\nO\\n\\n#(pR/p2\\n\\nR) = #(pT/p2\\n\\n(13)\\n\\nT) = #(\\n\\n/η).\\n\\nO\\n\\nThe first equality in (13) shows that ϕ induces an isomorphism of tangent spaces. Wiles uses the second equality in (13) and Theorem 5.1 to deduce that T is a local\\n\\n16\\n\\nK. RUBIN AND A. SILVERBERG\\n\\ncomplete intersection over that\\n\\n(that is, there are f1, . . . , fr ∈ O\\n\\n[[x1, . . . , xr]] such\\n\\nO\\n\\nT ∼=\\n\\n[[x1, . . . , xr]]/(f1, . . . , fr)\\n\\nO\\n\\nas morphism.\\n\\nalgebras). Wiles then combines these two results to prove that ϕ is an iso-\\n\\nO\\n\\n5.2. Selmer groups. In general, if M is a torsion GQ-module, a Selmer group attached to M is a subgroup of the Galois cohomology group H 1(GQ, M ) deter- mined by certain “local conditions” in the following way. If q is a prime with decomposition group Dq ⊂\\n\\nGQ, then there is a restriction map\\n\\nresq : H 1(GQ, M )\\n\\nH 1(Dq, M ).\\n\\n→ Jq ⊆\\n\\nH 1(Dq, M ) : q prime\\n\\n= For a fixed collection of subgroups { the particular problem under consideration, the corresponding Selmer group is\\n\\ndepending on\\n\\nJ\\n\\n}\\n\\nres−1\\n\\nH 1(GQ, M ).\\n\\nS(M ) =\\n\\nq (Jq)\\n\\n⊆\\n\\nq \\\\ Write H i(Q, M ) for H i(GQ, M ), and H i(Qq, M ) for H i(Dq, M ).\\n\\nExample. The original examples of Selmer groups come from elliptic curves. Fix an elliptic curve E and a positive integer m, and take M = E[m], the subgroup of points in E( ¯Q) of order dividing m. There is a natural inclusion\\n\\nH 1(Q, E[m])\\n\\nE(Q)/mE(Q) ֒\\n\\n(14)\\n\\n→\\n\\nE( ¯Q) is any\\n\\nE(Q) to the cocycle σ\\n\\nobtained by sending x point satisfying my = x. Similarly, for every prime q there is a natural inclusion\\n\\nσ(y)\\n\\ny, where y\\n\\n∈\\n\\n7→\\n\\n−\\n\\n∈\\n\\nH 1(Qq, E[m]).\\n\\nE(Qq)/mE(Qq) ֒\\n\\n→ Define the Selmer group S(E[m]) in this case by taking the group Jq to be the image of E(Qq)/mE(Qq) in H 1(Qq, E[m]), for every q. This Selmer group is an important tool in studying the arithmetic of E because it contains (via (14)) E(Q)/mE(Q).\\n\\n5, let m denote the maximal ideal /mn) can be\\n\\nRetaining the notation from the beginning of\\n\\n§\\n\\nand fix a positive integer n. The tangent space HomO(pR/p2 R,\\n\\nof identified with a Selmer group as follows. Let Vn be the matrix algebra M2(\\n\\nO\\n\\nO\\n\\n/mn), with GQ acting via the adjoint repre-\\n\\nO\\n\\nsentation σ(B) = ρf,λ(σ)Bρf,λ(σ)−1. There is a natural injection\\n\\ns : HomO(pR/p2 R,\\n\\n/mn) ֒\\n\\nH 1(Q, Vn)\\n\\nO\\n\\n→\\n\\nwhich is described in Appendix D (see also\\n\\n1.6 of [21]). Wiles defines a collection . Let SD(Vn) denote the associated Selmer\\n\\n§\\n\\nH 1(Qq, Vn) }\\n\\n=\\n\\nJq ⊆\\n\\ndepending on\\n\\nJ group. Wiles proves that s induces an isomorphism\\n\\n{\\n\\nD\\n\\n/mn) ∼ →\\n\\nHomO(pR/p2 R,\\n\\nSD(Vn).\\n\\nO\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n17\\n\\n5.3. Euler systems. We have now reduced the proof of Mazur’s conjecture to bounding the size of the Selmer groups SD(Vn). About five years ago Kolyvagin [19], building on ideas of his own and of Thaine [40], introduced a revolutionary new method for bounding the size of a Selmer group. This new machinery, which is crucial for Wiles’ proof, is what we now describe.\\n\\nH 1(Qq,M ) is } 5.2. Let ˆM = a system of subgroups with associated Selmer group S(M ) as in Hom(M, µm), where µm is the group of m-th roots of unity. For every prime q, the cup product gives a nondegenerate Tate pairing\\n\\nSuppose M is a GQ-module of odd exponent m and\\n\\n=\\n\\nJq ⊆ §\\n\\nJ\\n\\n{\\n\\nH 2(Qq, µm) ∼ → H 1(Q, ˆM ), then\\n\\nH 1(Qq, ˆM )\\n\\niq : H 1(Qq, M )\\n\\nZ/mZ\\n\\n,\\n\\nh\\n\\n×\\n\\n→\\n\\nH 1(Q, M ) and d\\n\\n(see Chapters VI and VII of [3]). If c\\n\\n∈\\n\\n∈\\n\\n(15)\\n\\nresq(c), resq(d) h\\n\\niq = 0.\\n\\nq X\\n\\nH 1(Q, ˆM ) be the Selmer\\n\\nis a finite set of primes. Let S∗\\n\\nSuppose that\\n\\nL ⊆ H 1(Qq, ˆM ) }\\n\\nL group given by the local conditions\\n\\n∗ =\\n\\nJ ∗ q ⊆\\n\\n, where\\n\\nJ\\n\\n{\\n\\nthe orthogonal complement of Jq under H 1(Qq, ˆM )\\n\\n,\\n\\nif q / if q\\n\\n, ∈ L . ∈ L\\n\\niq\\n\\nJ ∗ q =\\n\\nh\\n\\n(\\n\\nH 1(Q, ˆM ), define\\n\\nIf d\\n\\n∈\\n\\nZ/mZ\\n\\nθd :\\n\\nJq →\\n\\nYq∈L\\n\\nby\\n\\nθd((cq)) =\\n\\ncq, resq(d) h\\n\\niq.\\n\\nXq∈L\\n\\nWrite resL : H 1(Q, M ) maps. By (15) and the definition of J ∗ in addition resL is injective on S(M ), then\\n\\nq∈L H 1(Qq, M ) for the product of the restriction ker(θd). If\\n\\n→\\n\\nS∗\\n\\nq , if d\\n\\nL, then resL(S(M ))\\n\\n∈\\n\\n⊆\\n\\nQ\\n\\n#(S(M ))\\n\\n#\\n\\nker(θd)\\n\\n.\\n\\n≤\\n\\n(cid:0) \\\\d∈S∗\\n\\nL\\n\\n(cid:1)\\n\\nThe difficulty is to produce enough cohomology classes in S∗\\n\\nL to show that the right side of the above inequality is small. Following Kolyvagin, an Euler system is S∗ L for a large (infinite) collection of sets of a compatible collection of classes κ( )) primes is related to resℓ(κ( )). Once an Euler system is given, Kolyvagin has an inductive procedure for choosing a set\\n\\n) L\\n\\n∈\\n\\n. Loosely speaking, compatible means that if ℓ /\\n\\n, then resℓ(κ(\\n\\nℓ\\n\\nL\\n\\n∈ L\\n\\nL ∪ {\\n\\n}\\n\\nL\\n\\nsuch that\\n\\nL\\n\\nresL is injective on S(M ),\\n\\n•\\n\\nP⊆L ker(θκ(P)) can be computed in terms of κ( ∅\\n\\n).\\n\\nT\\n\\n18\\n\\nK. RUBIN AND A. SILVERBERG\\n\\nS∗\\n\\nS∗\\n\\n, then S∗\\n\\nL.)\\n\\nL, so κ(\\n\\n)\\n\\n(Note that if\\n\\nP ⊆\\n\\nP For several important Selmer groups it is possible to construct Euler systems for\\n\\n∈\\n\\nP ⊆ L\\n\\nwhich Kolyvagin’s procedure produces a set\\n\\nactually giving an equality\\n\\nL ker(θκ(P))\\n\\n#(S(M )) = #\\n\\n.\\n\\n(cid:0) \\\\P⊆L This is what Wiles needs to do for the Selmer group SD(Vn). There are several examples in the literature where this kind of argument is worked out in some detail. For the simplest case, where the Selmer group in question is the ideal class group ) are constructed from cyclotomic units, of a real abelian number field and the κ( L see [29]. For other cases involving ideal class groups and Selmer groups of elliptic curves, see [19], [31], [30], [13].\\n\\n(cid:1)\\n\\n5.4. Wiles’ geometric Euler system. The task now is to construct an Euler system of cohomology classes with which to bound #(SD(Vn)) using Kolyvagin’s method. This is the most technically difficult part of Wiles’ proof and is the part of Wiles’ work he referred to as not yet complete in his December announcement. We give only general remarks about Wiles’ construction.\\n\\nThe first step in the construction is due to Flach [10]. He constructed classes consisting of just one prime. This allows one to bound the ) L\\n\\nS∗\\n\\nκ( exponent of SD(Vn), but not its order.\\n\\nL for sets\\n\\n∈\\n\\nL\\n\\nEvery Euler system starts with some explicit, concrete objects. Earlier examples of Euler systems come from cyclotomic or elliptic units, Gauss sums, or Heegner points on elliptic curves. Wiles (following Flach) constructs his cohomology classes from modular units, i.e., meromorphic functions on modular curves which are holo- morphic and nonzero away from the cusps. More precisely, κ( ) comes from an explicit function on the modular curve X1(L, N ), the curve obtained by taking the quotient space of the upper half plane by the action of the group\\n\\nL\\n\\na b c d\\n\\nSL2(Z) : c\\n\\n1 (mod L) } ≡ ℓ∈L ℓ and where N is the N of (T2) of\\n\\n0\\n\\n(mod LN ),\\n\\na\\n\\nd\\n\\n,\\n\\nΓ1(L, N ) =\\n\\n∈\\n\\n≡\\n\\n≡\\n\\n{ (cid:1) (cid:0) and adjoining the cusps, where L = The construction and study of the classes κ( [8], [9] and others.\\n\\n4.2. ) rely heavily on results of Faltings\\n\\n§\\n\\nL\\n\\nQ\\n\\n5.5. Wiles’ results. Wiles announced two main results (Theorems 5.3 and 5.4 below) in the direction of Mazur’s conjecture, under two different sets of hypotheses on the representation ¯ρ. Theorem 5.3 implies the Semistable Taniyama-Shimura Conjecture and Fermat’s Last Theorem. Wiles’ proof of Theorem 5.3 depends on the not-yet-complete construction of an appropriate Euler system (as in 5.4), while his proof of Theorem 5.4 (though not yet fully checked) does not. For Theorem 5.4, Wiles bounds the Selmer group of 5.2 without constructing a new Euler system, by using results from the Iwasawa theory of imaginary quadratic fields. (These results in turn rely on Kolyvagin’s method and the Euler system of elliptic units; see [31].)\\n\\n§\\n\\n§\\n\\nSince for ease of exposition we defined modularity of representations in terms of Γ0(N ) instead of Γ1(N ), the theorems stated below are weaker than those an- nounced by Wiles, but have the same applications to elliptic curves. (Note that by our definition of type-\\n\\n, if ¯ρ is type-\\n\\n, then det(¯ρ) = ¯εp.)\\n\\nD\\n\\nD\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n19\\n\\nIf ¯ρ is a representation of GQ on a vector space V , Sym2(¯ρ) denotes the repre-\\n\\nsentation on the symmetric square of V induced by ¯ρ.\\n\\nTheorem 5.3 (Wiles). Suppose p, k, the following additional conditions :\\n\\n, ¯ρ, and\\n\\nare as in\\n\\n4.2 and ¯ρ satisfies\\n\\nD\\n\\nO\\n\\n§\\n\\n(i) Sym2(¯ρ) is absolutely irreducible, (ii) if ¯ρ is ramified at q and q (iii) if p is 3 or 5, then for some prime q, p divides #(¯ρ(Iq)).\\n\\n= p, then the restriction of ¯ρ to Dq is reducible,\\n\\n6\\n\\nT is an isomorphism.\\n\\nThen ϕ : R\\n\\n→\\n\\nSince Theorem 5.3 does not yield the full Mazur Conjecture (Conjecture 4.2) for 2 to see which elliptic curves §\\n\\np = 3 and 5, we need to reexamine the arguments of E can be proved modular using Theorem 5.3 applied to ¯ρE,3 and ¯ρE,5.\\n\\nHypothesis (i) of Theorem 5.3 will be satisfied if the image of ¯ρE,p is sufficiently large in GL2(Fp) (for example, if ¯ρE,p is surjective). For p = 3 and p = 5, if ¯ρE,p satisfies hypothesis (iii) and is irreducible, then it satisfies hypothesis (i).\\n\\nIf E is semistable, p is an odd prime, and ¯ρE,p is irreducible and modular, then (see the proof of Proposition 3.3) and ¯ρE,p satisfies (ii) ¯ρE,p is D 14 of Appendix C of [39]). Therefore by Propositions and (iii) (use Tate curves; see 4.3 and 3.3, Theorem 5.3 implies that the Semistable Modular Lifting Conjecture (Conjecture 2.1) holds for p = 3 and for p = 5. As shown in 2, the Semistable Taniyama-Shimura Conjecture and Fermat’s Last Theorem follow.\\n\\nmodular for some\\n\\nD\\n\\n§\\n\\n§\\n\\nTheorem 5.4 (Wiles). Suppose p, k, contains no nontrivial p-th roots of unity. Suppose also that there are an imaginary quadratic field F of discriminant prime to p and a character χ : Gal( ¯Q/F ) × such that T is the induced representation Indχ of GQ is a ( an isomorphism.\\n\\n, ¯ρ, and\\n\\nare as in\\n\\n4.2 and\\n\\nD\\n\\nO\\n\\n§\\n\\nO\\n\\n→ O\\n\\n)-lifting of ¯ρ. Then ϕ : R\\n\\n,\\n\\nD\\n\\nO\\n\\n→\\n\\nCorollary 5.5 (Wiles). Suppose E is an elliptic curve over Q with complex mul- tiplication by an imaginary quadratic field F and p is an odd prime at which E has good reduction. If E′ is an elliptic curve over Q satisfying\\n\\nE′ has good reduction at p and ¯ρE′,p is isomorphic to ¯ρE,p,\\n\\n•\\n\\nthen E′ is modular.\\n\\nProof of corollary. Let p be a prime of F containing p, and define = the ring of integers of the completion of F at p,\\n\\nO • • •\\n\\n/p primes at which E or E′ has bad reduction\\n\\nk = Σ = t = ordinary if E has ordinary reduction at p, t = flat if E has supersingular reduction at p,\\n\\n,\\n\\nO {\\n\\nO\\n\\np\\n\\n,\\n\\n} ∪ {\\n\\n}\\n\\n= (Σ, t).\\n\\nD\\n\\nLet\\n\\nχ : Gal( ¯Q/F )\\n\\nAutO(E[p∞]) ∼=\\n\\n×\\n\\n→\\n\\nO\\n\\nbe the character giving the action of Gal( ¯Q/F ) on E[p∞] (where E[p∞] is the group of points of E killed by the endomorphisms of E which lie in some power of p). It is not hard to see that ρE,p ⊗ O\\n\\nis isomorphic to Indχ.\\n\\n20\\n\\nK. RUBIN AND A. SILVERBERG\\n\\nSince E has complex multiplication, it is well known that E and ¯ρE,p are mod- ular. Since E has good reduction at p, it can be shown that the discriminant of contains no nontrivial p-th roots of unity. One can show F is prime to p and that all of the hypotheses of Theorem 5.4 are satisfied with ¯ρ = ¯ρE,p ⊗ k. By our assumptions on E′, ρE′,p ⊗ O )-lifting of ¯ρ, and we conclude (using the D same reasoning as in the proofs of Propositions 3.3 and 4.3) that ρE′,p is modular and hence E′ is modular.\\n\\nO\\n\\nis a (\\n\\n,\\n\\nO\\n\\nRemarks. (i) The elliptic curves E′ of Corollary 5.5 are not semistable.\\n\\n(ii) Suppose E and p are as in Corollary 5.5 and p = 3 or 5. As in Appendix B.2 one can show that the elliptic curves E′ over Q with good reduction at p and with ¯ρE′,p isomorphic to ¯ρE,p give infinitely many C-isomorphism classes.\\n\\nExample. Take E to be the elliptic curve defined by\\n\\ny2 = x3\\n\\nx2\\n\\n3x\\n\\n1.\\n\\n−\\n\\n−\\n\\n−\\n\\nThen E has complex multiplication by Q(√ Define polynomials\\n\\n2), and E has good reduction at 3.\\n\\n−\\n\\n1512t3 3, a4(t) = a6(t) = 40824t6 + 31104t5 + 8370t4 + 504t3\\n\\n2430t4\\n\\n396t2\\n\\n56t\\n\\n−\\n\\n−\\n\\n−\\n\\n−\\n\\n−\\n\\n148t2\\n\\n24t\\n\\n1,\\n\\n−\\n\\n−\\n\\n−\\n\\nQ let Et be the elliptic curve\\n\\nand for each t\\n\\n∈\\n\\ny2 = x3\\n\\nx2 + a4(t)x + a6(t)\\n\\n−\\n\\nQ, ¯ρEt,3 is isomorphic to (note that E0 = E). It can be shown that for every t 0 or 1 (mod 3) (or more generally if t = 3a/b or t = 3a/b + 1 ¯ρE,3. If t with a and b integers and b not divisible by 3), then Et has good reduction at 3, for instance because the discriminant of Et is\\n\\n∈\\n\\nZ and t\\n\\n∈\\n\\n≡\\n\\n29(27t2 + 10t + 1)3(27t2 + 18t + 1)3.\\n\\nThus for these values of t, Corollary 5.5 shows that Et is modular and so is any elliptic curve over Q isomorphic over C to Et, i.e., any elliptic curve over Q with j-invariant equal to\\n\\n3\\n\\n4(27t2 + 6t + 1)(135t2 + 54t + 5) (27t2 + 10t + 1)(27t2 + 18t + 1)\\n\\n.\\n\\n(cid:18)\\n\\n(cid:19)\\n\\nThis explicitly gives infinitely many modular elliptic curves over Q which are\\n\\nnonisomorphic over C.\\n\\n(For definitions of complex multiplication, discriminant, and j-invariant, see any\\n\\nstandard reference on elliptic curves, such as [39].)\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n21\\n\\nAppendix A. Galois groups and Frobenius elements\\n\\nWrite GQ = Gal( ¯Q/Q). If q is a prime number and\\n\\nis a prime ideal dividing\\n\\nQ\\n\\nq in the ring of integers of ¯Q, there is a filtration\\n\\nGQ\\n\\nDQ ⊃\\n\\nIQ\\n\\n⊃ where the decomposition group DQ and the inertia group IQ are defined by\\n\\nDQ = IQ =\\n\\nσ\\n\\nGQ : σ ∈ Q ∈ DQ : σx\\n\\n=\\n\\n,\\n\\n{\\n\\nQ} x (mod\\n\\nσ\\n\\n) for all algebraic integers x }\\n\\n.\\n\\n≡ { There are natural identifications\\n\\nQ\\n\\nDQ/IQ ∼= Gal( ¯Fq/Fq),\\n\\nDQ ∼= Gal( ¯Qq/Qq),\\n\\nxq of GQ\\n\\nand FrobQ ∈ Gal( ¯Fq/Fq). If and\\n\\nDQ/IQ denotes the inverse image of the canonical generator x\\n\\n7→ for some σ\\n\\n′ is another prime ideal above q, then\\n\\n′ = σ\\n\\nQ DQ′ = σDQσ−1,\\n\\nQ\\n\\nQ\\n\\n∈\\n\\nFrobQ′ = σFrobQσ−1.\\n\\nIQ′ = σIQσ−1,\\n\\nSince we will care about these objects only up to conjugation, we will write Dq and GQ for any representative of a FrobQ. If ρ is a represen- Iq. We will write Frobq ∈ tation of GQ which is unramified at q, then trace(ρ(Frobq)) and det(ρ(Frobq)) are well defined independent of any choices.\\n\\nAppendix B. Some details on the proof of Proposition 2.4\\n\\nB.1. The modular curve X0(15) can be viewed as a curve defined over Q in such a way that the noncusp rational points correspond to isomorphism classes (over C) E( ¯Q) is a subgroup of pairs (E′, 42), of order 15 stable under GQ. An equation for X0(15) is y2 = x(x + 32)(x the elliptic curve discussed in 1. There are eight rational points on X0(15), four of § which are cusps. There are four modular elliptic curves, corresponding to a modular form for Γ0(50) (see p. 86 of [1]), which lie in the four distinct C-isomorphism classes that correspond to the noncusp rational points on X0(15).\\n\\n) where E′ is an elliptic curve over Q and\\n\\nC\\n\\nC ⊂\\n\\n−\\n\\nTherefore every elliptic curve over Q with a GQ-stable subgroup of order 15 is modular. Equivalently, if E is an elliptic curve over Q and both ¯ρE,3 and ¯ρE,5 are reducible, then E is modular.\\n\\nB.2. Fix a semistable elliptic curve E over Q. We will show that there are infinitely many semistable elliptic curves E′ over Q such that\\n\\n(i) ¯ρE′,5 is isomorphic to ¯ρE,5, and (ii) ¯ρE′,3 is irreducible. Let\\n\\n1 0 0 1\\n\\na b c d\\n\\na b c d\\n\\nSL2(Z) :\\n\\n(mod 5) }\\n\\n.\\n\\nΓ(5) =\\n\\n≡\\n\\n∈\\n\\n{\\n\\nLet X be the twist of the classical modular curve X(5) (see [35]) by the cocycle (cid:0) induced by ¯ρE,5, and let S be the set of cusps of X. Then X is a curve defined over Q which has the following properties. The rational points on X − (E′, φ) where E′ is an elliptic curve over Q and φ : E[5] module isomorphism.\\n\\n(cid:1)\\n\\n(cid:0)\\n\\n(cid:1)\\n\\n(cid:1)\\n\\n(cid:0)\\n\\nS correspond to isomorphism classes of pairs E′[5] is a GQ-\\n\\n\\n\\n→\\n\\n22\\n\\nK. RUBIN AND A. SILVERBERG\\n\\nS is four copies of H/Γ(5), so each component of\\n\\nAs a complex manifold X X has genus zero.\\n\\n\\n\\n−\\n\\nLet X 0 be the component of X containing the rational point corresponding to (E, identity). Then X 0 is a curve of genus zero defined over Q with a rational point, so it has infinitely many rational points. We want to show that infinitely many of these points correspond to semistable elliptic curves E′ with ¯ρE′,3 irreducible.\\n\\nThere is another modular curve ˆX defined over Q, with a finite set ˆS of cusps,\\n\\nwhich has the following properties. The rational points on ˆX (E′, φ, module isomorphism, and As a complex manifold ˆX The map that forgets the subgroup X defined over Q and of degree [Γ(5) : Γ(5)\\n\\nˆS correspond to isomorphism classes of triples E′[5] is a GQ-\\n\\n\\n\\n−\\n\\n) where E′ is an elliptic curve over Q, φ : E[5]\\n\\nC\\n\\n→\\n\\nE′[3] is a GQ-stable subgroup of order 3.\\n\\nC ⊂ −\\n\\nˆS is four copies of H/(Γ(5)\\n\\nΓ0(3)).\\n\\n•\\n\\n∩ induces a surjective morphism θ : ˆX\\n\\nC\\n\\n→\\n\\nΓ0(3)] = 4.\\n\\n∩\\n\\nLet ˆX 0 be the component of ˆX which maps to X 0. The function field of X 0 is Q(t), and the function field of ˆX 0 is Q(t)[x]/f (t, x) where f (t, x) Q(t)[x] is irreducible and has degree 4 in x. If t′ Q is sufficiently close 5-adically to the value of t which corresponds to E, then the corresponding elliptic curve is semistable at Q so that f (t1, x) is 5. By the Hilbert Irreducibility Theorem we can find a t1 ∈ irreducible in Q[x]. It is possible to fix a prime ℓ = 5 such that f (t1, x) has no roots modulo ℓ. If t′ Q is sufficiently close ℓ-adically to t1, then f (t′, x) has no rational roots, and thus t′ corresponds to a rational point of X 0 which is not the image of a rational point of ˆX 0. Therefore there are infinitely many elliptic curves E′ over Q which are semistable at 5 and satisfy\\n\\n∈\\n\\n∈\\n\\n6\\n\\n∈\\n\\n(i) E′[5] ∼= E[5] as GQ-modules, and (ii) E′[3] has no subgroup of order 3 stable under GQ.\\n\\nIt follows from (i) and the semistability of E that E′ is semistable at all primes = 5, and thus E′ is semistable. We therefore have infinitely many semistable q elliptic curves E′ which satisfy the desired conditions.\\n\\n6\\n\\nAppendix C. Representation types\\n\\nSuppose A is a complete noetherian local Zp-algebra and ρ : GQ\\n\\nGL2(A) is a |Dp for the restriction of ρ to the decomposition group Dp.\\n\\n→\\n\\nrepresentation. Write ρ We say ρ is\\n\\nordinary at p if ρ\\n\\n|Dp is (after a change of basis, if necessary) of the form flat at p if ρ is not ordinary, and for every ideal a of finite index in A, the (cid:0) |Dp modulo a is the representation associated to the ¯Qp-points reduction of ρ of a finite flat group scheme over Zp.\\n\\n\\n\\n∗ ∗ 0 χ\\n\\nwhere χ is unramified and the * are functions from Dp to A;\\n\\n(cid:1)\\n\\n\\n\\nAppendix D. Selmer groups\\n\\nWith notation as in\\n\\n5 (see especially §\\n\\n5.2), define\\n\\n§\\n\\n[ǫ]/(ǫ2, mn)\\n\\nOn =\\n\\nO\\n\\nA REPORT ON WILES’ CAMBRIDGE LECTURES\\n\\n23\\n\\nwhere ǫ is an indeterminate. Then v\\n\\n1 + ǫv defines an isomorphism\\n\\n7→ On) : δ GL2(\\n\\n∼ ∈ → { HomO(pR/p2 R,\\n\\n(16)\\n\\n1 (mod ǫ) } /mn) there is a unique -algebra homomorphism → On whose restriction to pR is ǫα. Composing with the representation ρR On. (In particular ρ0 )-lifting obtained when α = 0.) Define a one-cocycle cα on GQ\\n\\nδ\\n\\n.\\n\\nVn\\n\\n≡\\n\\nFor every α\\n\\nO\\n\\nO\\n\\n∈\\n\\nψα : R of Theorem 4.1 gives a ( denotes the ( by\\n\\n,\\n\\n)-lifting ρα = ψα ◦\\n\\nρR of ¯ρ to\\n\\nD\\n\\nO\\n\\n,\\n\\nD\\n\\nO\\n\\ncα(g) = ρα(g)ρ0(g)−1.\\n\\nH 1(Q, Vn). This defines a\\n\\nSince ρα ≡ homomorphism\\n\\nρ0 (mod ǫ), using (16) we can view cα ∈\\n\\ns : HomO(pR/p2 R,\\n\\n/mn)\\n\\nH 1(Q, Vn),\\n\\nO and it is not difficult to see that s is injective. The fact that ρ0 and ρα are type- D gives information about the restrictions resq(cα) for various primes q, and using this H 1(Q, Vn) and verifies that s information Wiles defines a Selmer group SD(Vn) is an isomorphism onto SD(Vn).\\n\\n→\\n\\n⊂\\n\\nReferences\\n\\n[1] B. Birch and W. Kuyk, eds., Modular functions of one variable. IV, Lecture Notes in Math.,\\n\\nvol. 476, Springer-Verlag, New York, 1975, pp. 74–144.\\n\\n[2] J. Buhler, R. Crandall, R. Ernvall, and T. Mets¨ankyl¨a, Irregular primes and cyclotomic\\n\\ninvariants to four million, Math. Comp. 61 (1993), 151–153.\\n\\n[3] J. W. S. Cassels and A. Frohlich, Algebraic number theory, Academic Press, London, 1967. [4] P. Deligne and J.-P. Serre, Formes modulaires de poids 1, Ann. Sci. ´Ecole Norm. Sup. (4) 7\\n\\n(1974), 507–530.\\n\\n[5] L. E. Dickson, History of the theory of numbers (Vol. II), Chelsea Publ. Co., New York, 1971. [6] H. M. Edwards, Fermat’s Last Theorem. A genetic introduction to algebraic number theory,\\n\\nSpringer-Verlag, New York, 1977.\\n\\n[7] M. Eichler, Quatern¨are quadratische Formen und die Riemannsche Vermutung f¨ur die Kon-\\n\\ngruenzzetafunktion, Arch. Math. (Basel) 5 (1954), 355–366.\\n\\n[8] G. Faltings, p-adic Hodge theory, J. Amer. Math. Soc. 1 (1988), 255–299. [9]\\n\\n, Crystalline cohomology and p-adic Galois representations, Algebraic Analysis, Ge- ometry and Number Theory, Proceedings of the JAMI Inaugural Conference (J. I. Igusa, ed.), Johns Hopkins Univ. Press, Baltimore, MD, 1989, pp. 25–80.\\n\\n[10] M. Flach, A finiteness theorem for the symmetric square of an elliptic curve, Invent. Math.\\n\\n109 (1992), 307–327.\\n\\n[11] G. Frey, Links between solutions of A − B = C and elliptic curves, Number Theory, Ulm 1987, Proceedings, Lecture Notes in Math., vol. 1380, Springer-Verlag, New York, 1989, pp. 31–62.\\n\\n[12] S. Gelbart, Automorphic forms on adele groups, Ann. of Math. Stud., vol. 83, Princeton\\n\\nUniv. Press, Princeton, NJ, 1975.\\n\\n[13] B. Gross, Kolyvagin’s work on modular elliptic curves, L-functions and Arithmetic, London Math. Soc. Lecture Note Ser., vol. 153, Cambridge Univ. Press, Cambridge, 1991, pp. 235–256. [14] G. H. Hardy and E. M. Wright, An introduction to the theory of numbers, Fourth ed., Oxford\\n\\nUniv. Press, London, 1971.\\n\\n[15] Y. Hellegouarch, ´Etude des points d’ordre fini des vari´et´es de dimension un d´efinies sur un\\n\\nanneau principal, J. Reine Angew. Math. 244 (1970), 20–36.\\n\\n, Points d’ordre fini des vari´et´es ab´eliennes de dimension un, Colloque de Th´eorie des Nombres (Univ. Bordeaux, Bordeaux, 1969), Bull. Soc. Math. France, M´em. 25, Soc. Math. France, Paris, 1971, pp. 107–112.\\n\\n[16]\\n\\n, Points d’ordre fini sur les courbes elliptiques, C. R. Acad. Sci. Paris S´er. A-B 273\\n\\n[17]\\n\\n(1971), A540–A543.\\n\\n24\\n\\nK. RUBIN AND A. SILVERBERG\\n\\n, Points d’ordre 2ph sur les courbes elliptiques, Acta. Arith. 26 (1974/75), 253–263. [18] [19] V. A. Kolyvagin, Euler systems, The Grothendieck Festschrift (Vol. II) (P. Cartier et al.,\\n\\neds.), Birkh¨auser, Boston, 1990, pp. 435–483.\\n\\n[20] R. Langlands, Base change for GL(2), Ann. of Math. Stud., vol. 96, Princeton Univ. Press,\\n\\nPrinceton, NJ, 1980.\\n\\n[21] B. Mazur, Deforming Galois representations, Galois groups over Q (Y. Ihara, K. Ribet, and J.-P. Serre, eds.), Math. Sci. Res. Inst. Publ., vol. 16, Springer-Verlag, New York, 1989, pp. 385–437.\\n\\n, Number theory as gadfly, Amer. Math. Monthly 98 (1991), 593–610.\\n\\n[22] [23] B. Mazur and J. Tilouine, Repr´esentations galoisiennes, diff´erentielles de K¨ahler et “conjec-\\n\\ntures principales”, Inst. Hautes ´Etudes Sci. Publ. Math. 71 (1990), 65–103.\\n\\n[24] J. Oesterl´e, Nouvelles approches du “th´eor`eme” de Fermat, S´eminaire Bourbaki no. 694\\n\\n(1987–1988), Ast´erisque 161/162 (1988) 165–186.\\n\\n, On a variation of Mazur ’s deformation functor, Compositio Math. 87 (1993), 269–\\n\\n[25]\\n\\n286.\\n\\n[26] P. Ribenboim, 13 lectures on Fermat ’s Last Theorem, Springer-Verlag, New York, 1979. [27] K. Ribet, On modular representations of Gal( ¯Q/Q) arising from modular forms, Invent.\\n\\nMath. 100 (1990), 431–476.\\n\\n, Report on mod ℓ representations of Gal( ¯Q/Q), Motives (U. Jannsen, S. Kleiman, and J-P. Serre, eds.), Proc. Sympos. Pure Math., vol. 55 (Part 2), Amer. Math. Soc., Providence, RI, 1994 (to appear).\\n\\n[28]\\n\\n[29] K. Rubin, The main conjecture. (Appendix to Cyclotomic fields I and II, S. Lang), Graduate\\n\\nTexts in Math., vol. 121, Springer-Verlag, New York, 1990, pp. 397–419.\\n\\n, Kolyvagin’s system of Gauss sums, Arithmetic Algebraic Geometry (G. van der Geer, F. Oort, and J. Steenbrink, eds.), Progr. Math., vol. 89, Birkh¨auser, Boston, 1991, pp. 309–324.\\n\\n[30]\\n\\n, The “main conjectures” of Iwasawa theory for imaginary quadratic fields, Invent.\\n\\n[31]\\n\\nMath. 103 (1991), 25–68.\\n\\n[32] J.-P. Serre, Sur les repr´esentations modulaires de degr´e 2 de Gal( ¯Q/Q), Duke Math. J. 54\\n\\n(1987), 179–230.\\n\\n[33] G. Shimura, Correspondances modulaires et les fonctions ζ de courbes alg´ebriques, J. Math.\\n\\nSoc. Japan 10 (1958), 1–28.\\n\\n, Construction of class fields and zeta functions of algebraic curves, Ann. of Math.\\n\\n[34]\\n\\n85 (1967), 58–159.\\n\\n, Introduction to the arithmetic theory of automorphic functions, Princeton Univ.\\n\\n[35]\\n\\nPress, Princeton, NJ, 1971.\\n\\n, On elliptic curves with complex multiplication as factors of the Jacobians of modular\\n\\n[36]\\n\\nfunction fields, Nagoya Math. J. 43 (1971), 199–208.\\n\\n, On the factors of the jacobian variety of a modular function field, J. Math. Soc.\\n\\n[37]\\n\\nJapan 25 (1973), 523–544.\\n\\n, Yutaka Taniyama and his time. Very personal recollections, Bull. London Math.\\n\\n[38]\\n\\nSoc. 21 (1989), 186–196.\\n\\n[39] J. Silverman, The arithmetic of elliptic curves, Graduate Texts in Math., vol. 106, Springer-\\n\\nVerlag, New York, 1986.\\n\\n[40] F. Thaine, On the ideal class groups of real abelian number fields, Ann. of Math. (2) 128\\n\\n(1988), 1–18.\\n\\n[41] J. Tunnell, Artin’s conjecture for representations of octahedral type, Bull. Amer. Math. Soc.\\n\\n(N.S.) 5 (1981), 173–175.\\n\\n[42] A. Weil, ¨Uber die Bestimmung Dirichletscher Reihen durch Funktionalgleichungen, Math.\\n\\nAnn. 168 (1967), 149–156.\\n\\nDepartment of Mathematics, Ohio State University, Columbus, Ohio 43210 E-mail address: rubin@math.ohio-state.edu\\n\\nDepartment of Mathematics, Ohio State University, Columbus, Ohio 43210 E-mail address: silver@math.ohio-state.edu' metadata={'source': '/var/folders/l1/lphj87z16c3282pjwy91wtm80000gn/T/tmpdh5kk5yb/tmp.pdf'}\n", + "page_content='This is text file' metadata={'source': 'dropbox:///test.txt', 'title': 'test.txt'}\n" + ] + } + ], + "source": [ + "for document in documents:\n", + " print(document)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "langchain", + "language": "python", + "name": "langchain" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.4" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/extras/use_cases/agents/custom_agent_with_plugin_retrieval.ipynb b/docs/extras/use_cases/agents/custom_agent_with_plugin_retrieval.ipynb index 1a2a76886d0cb..a10ebf7eb33a4 100644 --- a/docs/extras/use_cases/agents/custom_agent_with_plugin_retrieval.ipynb +++ b/docs/extras/use_cases/agents/custom_agent_with_plugin_retrieval.ipynb @@ -10,7 +10,7 @@ "This notebook combines two concepts in order to build a custom agent that can interact with AI Plugins:\n", "\n", "1. [Custom Agent with Tool Retrieval](/docs/modules/agents/how_to/custom_agent_with_tool_retrieval.html): This introduces the concept of retrieving many tools, which is useful when trying to work with arbitrarily many plugins.\n", - "2. [Natural Language API Chains](/docs/modules/chains/additional/openapi.html): This creates Natural Language wrappers around OpenAPI endpoints. This is useful because (1) plugins use OpenAPI endpoints under the hood, (2) wrapping them in an NLAChain allows the router agent to call it more easily.\n", + "2. [Natural Language API Chains](/docs/use_cases/apis/openapi.html): This creates Natural Language wrappers around OpenAPI endpoints. This is useful because (1) plugins use OpenAPI endpoints under the hood, (2) wrapping them in an NLAChain allows the router agent to call it more easily.\n", "\n", "The novel idea introduced in this notebook is the idea of using retrieval to select not the tools explicitly, but the set of OpenAPI specs to use. We can then generate tools from those OpenAPI specs. The use case for this is when trying to get agents to use plugins. It may be more efficient to choose plugins first, then the endpoints, rather than the endpoints directly. This is because the plugins may contain more useful information for selection." ] diff --git a/docs/extras/use_cases/apis.mdx b/docs/extras/use_cases/apis/index.mdx similarity index 86% rename from docs/extras/use_cases/apis.mdx rename to docs/extras/use_cases/apis/index.mdx index 3500c16477e1a..c5f3c12932ea6 100644 --- a/docs/extras/use_cases/apis.mdx +++ b/docs/extras/use_cases/apis/index.mdx @@ -13,7 +13,7 @@ If you are just getting started, and you have relatively simple apis, you should Chains are a sequence of predetermined steps, so they are good to get started with as they give you more control and let you understand what is happening better. -- [API Chain](/docs/modules/chains/popular/api.html) +- [API Chain](/docs/use_cases/apis/api.html) ## Agents @@ -21,4 +21,4 @@ Agents are more complex, and involve multiple queries to the LLM to understand w The downside of agents are that you have less control. The upside is that they are more powerful, which allows you to use them on larger and more complex schemas. -- [OpenAPI Agent](/docs/modules/agents/toolkits/openapi.html) +- [OpenAPI Agent](/docs/integrations/toolkits/openapi.html) diff --git a/docs/extras/modules/chains/additional/llm_requests.ipynb b/docs/extras/use_cases/apis/llm_requests.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/llm_requests.ipynb rename to docs/extras/use_cases/apis/llm_requests.ipynb diff --git a/docs/extras/modules/chains/additional/openai_openapi.yaml b/docs/extras/use_cases/apis/openai_openapi.yaml similarity index 100% rename from docs/extras/modules/chains/additional/openai_openapi.yaml rename to docs/extras/use_cases/apis/openai_openapi.yaml diff --git a/docs/extras/modules/chains/additional/openapi.ipynb b/docs/extras/use_cases/apis/openapi.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/openapi.ipynb rename to docs/extras/use_cases/apis/openapi.ipynb diff --git a/docs/extras/modules/chains/additional/openapi_openai.ipynb b/docs/extras/use_cases/apis/openapi_openai.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/openapi_openai.ipynb rename to docs/extras/use_cases/apis/openapi_openai.ipynb diff --git a/docs/extras/use_cases/code/index.mdx b/docs/extras/use_cases/code/index.mdx index 30da409f00eaa..985025d852f48 100644 --- a/docs/extras/use_cases/code/index.mdx +++ b/docs/extras/use_cases/code/index.mdx @@ -2,7 +2,7 @@ sidebar_position: 6 --- -# Code Understanding +# Code understanding Overview diff --git a/docs/extras/modules/chains/additional/cpal.ipynb b/docs/extras/use_cases/code_writing/cpal.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/cpal.ipynb rename to docs/extras/use_cases/code_writing/cpal.ipynb diff --git a/docs/extras/use_cases/code_writing/index.mdx b/docs/extras/use_cases/code_writing/index.mdx new file mode 100644 index 0000000000000..218b43851590d --- /dev/null +++ b/docs/extras/use_cases/code_writing/index.mdx @@ -0,0 +1,14 @@ +# Code writing + +:::warning +All program-writing chains should be treated as *VERY* experimental and should not be used in any environment where sensitive/important data is stored, as there is arbitrary code execution involved in using these. +::: + +Much like humans, LLMs are great at writing out programs, but not always great at executing them. For example, they can write down complex mathematical equations far better than they can compute the results. In such cases, it is useful to combine an LLM with a program runtime, so that the LLM converts unstructured text to a program and then a simpler tool (like a calculator) actually executes the program. + +In other cases, only a program can be used to access the desired information (e.g., the contents of a directory on your computer). In such cases it is again useful to let an LLM generate the code and a separate tool to execute it. + +import DocCardList from "@theme/DocCardList"; + + + diff --git a/docs/extras/modules/chains/additional/llm_bash.ipynb b/docs/extras/use_cases/code_writing/llm_bash.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/llm_bash.ipynb rename to docs/extras/use_cases/code_writing/llm_bash.ipynb diff --git a/docs/extras/modules/chains/additional/llm_math.ipynb b/docs/extras/use_cases/code_writing/llm_math.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/llm_math.ipynb rename to docs/extras/use_cases/code_writing/llm_math.ipynb diff --git a/docs/extras/modules/chains/additional/llm_symbolic_math.ipynb b/docs/extras/use_cases/code_writing/llm_symbolic_math.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/llm_symbolic_math.ipynb rename to docs/extras/use_cases/code_writing/llm_symbolic_math.ipynb diff --git a/docs/extras/modules/chains/additional/pal.ipynb b/docs/extras/use_cases/code_writing/pal.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/pal.ipynb rename to docs/extras/use_cases/code_writing/pal.ipynb diff --git a/docs/extras/use_cases/extraction.mdx b/docs/extras/use_cases/extraction/index.mdx similarity index 100% rename from docs/extras/use_cases/extraction.mdx rename to docs/extras/use_cases/extraction/index.mdx diff --git a/docs/extras/use_cases/extraction/openai_extraction.ipynb b/docs/extras/use_cases/extraction/openai_extraction.ipynb new file mode 100644 index 0000000000000..2d39169dd68a1 --- /dev/null +++ b/docs/extras/use_cases/extraction/openai_extraction.ipynb @@ -0,0 +1,566 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "6605e7f7", + "metadata": {}, + "source": [ + "# Extraction with OpenAI Functions\n", + "\n", + "The extraction chain uses the OpenAI `functions` parameter to specify a schema to extract entities from a document. This helps us make sure that the model outputs exactly the schema of entities and properties that we want, with their appropriate types.\n", + "\n", + "The extraction chain is to be used when we want to extract several entities with their properties from the same passage (i.e. what people were mentioned in this passage?)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "34f04daf", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/harrisonchase/.pyenv/versions/3.9.1/envs/langchain/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.4) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "from langchain.chat_models import ChatOpenAI\n", + "from langchain.chains import create_extraction_chain, create_extraction_chain_pydantic\n", + "from langchain.prompts import ChatPromptTemplate" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "a2648974", + "metadata": {}, + "outputs": [], + "source": [ + "llm = ChatOpenAI(temperature=0, model=\"gpt-3.5-turbo-0613\")" + ] + }, + { + "cell_type": "markdown", + "id": "5ef034ce", + "metadata": {}, + "source": [ + "## Extracting entities" + ] + }, + { + "cell_type": "markdown", + "id": "78ff9df9", + "metadata": {}, + "source": [ + "To extract entities, we need to create a schema where we specify all the properties we want to find and the type we expect them to have. We can also specify which of these properties are required and which are optional." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "4ac43eba", + "metadata": {}, + "outputs": [], + "source": [ + "schema = {\n", + " \"properties\": {\n", + " \"name\": {\"type\": \"string\"},\n", + " \"height\": {\"type\": \"integer\"},\n", + " \"hair_color\": {\"type\": \"string\"},\n", + " },\n", + " \"required\": [\"name\", \"height\"],\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "640bd005", + "metadata": {}, + "outputs": [], + "source": [ + "inp = \"\"\"\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + " \"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "64313214", + "metadata": {}, + "outputs": [], + "source": [ + "chain = create_extraction_chain(schema, llm)" + ] + }, + { + "cell_type": "markdown", + "id": "17c48adb", + "metadata": {}, + "source": [ + "As we can see, we extracted the required entities and their properties in the required format (it even calculated Claudia's height before returning!)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "cc5436ed", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'name': 'Alex', 'height': 5, 'hair_color': 'blonde'},\n", + " {'name': 'Claudia', 'height': 6, 'hair_color': 'brunette'}]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chain.run(inp)" + ] + }, + { + "cell_type": "markdown", + "id": "8d51fcdc", + "metadata": {}, + "source": [ + "## Several entity types" + ] + }, + { + "cell_type": "markdown", + "id": "5813affe", + "metadata": {}, + "source": [ + "Notice that we are using OpenAI functions under the hood and thus the model can only call one function per request (with one, unique schema)" + ] + }, + { + "cell_type": "markdown", + "id": "511b9838", + "metadata": {}, + "source": [ + "If we want to extract more than one entity type, we need to introduce a little hack - we will define our properties with an included entity type. \n", + "\n", + "Following we have an example where we also want to extract dog attributes from the passage. Notice the 'person_' and 'dog_' prefixes we use for each property; this tells the model which entity type the property refers to. In this way, the model can return properties from several entity types in one single call." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "cf243a26", + "metadata": {}, + "outputs": [], + "source": [ + "schema = {\n", + " \"properties\": {\n", + " \"person_name\": {\"type\": \"string\"},\n", + " \"person_height\": {\"type\": \"integer\"},\n", + " \"person_hair_color\": {\"type\": \"string\"},\n", + " \"dog_name\": {\"type\": \"string\"},\n", + " \"dog_breed\": {\"type\": \"string\"},\n", + " },\n", + " \"required\": [\"person_name\", \"person_height\"],\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "52841fb3", + "metadata": {}, + "outputs": [], + "source": [ + "inp = \"\"\"\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", + " \"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "93f904ab", + "metadata": {}, + "outputs": [], + "source": [ + "chain = create_extraction_chain(schema, llm)" + ] + }, + { + "cell_type": "markdown", + "id": "eb074f7b", + "metadata": {}, + "source": [ + "People attributes and dog attributes were correctly extracted from the text in the same call" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "db3e9e17", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'person_name': 'Alex',\n", + " 'person_height': 5,\n", + " 'person_hair_color': 'blonde',\n", + " 'dog_name': 'Frosty',\n", + " 'dog_breed': 'labrador'},\n", + " {'person_name': 'Claudia',\n", + " 'person_height': 6,\n", + " 'person_hair_color': 'brunette'}]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chain.run(inp)" + ] + }, + { + "cell_type": "markdown", + "id": "0273e0e2", + "metadata": {}, + "source": [ + "## Unrelated entities" + ] + }, + { + "cell_type": "markdown", + "id": "c07b3480", + "metadata": {}, + "source": [ + "What if our entities are unrelated? In that case, the model will return the unrelated entities in different dictionaries, allowing us to successfully extract several unrelated entity types in the same call." + ] + }, + { + "cell_type": "markdown", + "id": "01d98af0", + "metadata": {}, + "source": [ + "Notice that we use `required: []`: we need to allow the model to return **only** person attributes or **only** dog attributes for a single entity (person or dog)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "e584c993", + "metadata": {}, + "outputs": [], + "source": [ + "schema = {\n", + " \"properties\": {\n", + " \"person_name\": {\"type\": \"string\"},\n", + " \"person_height\": {\"type\": \"integer\"},\n", + " \"person_hair_color\": {\"type\": \"string\"},\n", + " \"dog_name\": {\"type\": \"string\"},\n", + " \"dog_breed\": {\"type\": \"string\"},\n", + " },\n", + " \"required\": [],\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "ad6b105f", + "metadata": {}, + "outputs": [], + "source": [ + "inp = \"\"\"\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + "\n", + "Willow is a German Shepherd that likes to play with other dogs and can always be found playing with Milo, a border collie that lives close by.\n", + "\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "6bfe5a33", + "metadata": {}, + "outputs": [], + "source": [ + "chain = create_extraction_chain(schema, llm)" + ] + }, + { + "cell_type": "markdown", + "id": "24fe09af", + "metadata": {}, + "source": [ + "We have each entity in its own separate dictionary, with only the appropriate attributes being returned" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "f6e1fd89", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},\n", + " {'person_name': 'Claudia',\n", + " 'person_height': 6,\n", + " 'person_hair_color': 'brunette'},\n", + " {'dog_name': 'Willow', 'dog_breed': 'German Shepherd'},\n", + " {'dog_name': 'Milo', 'dog_breed': 'border collie'}]" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chain.run(inp)" + ] + }, + { + "cell_type": "markdown", + "id": "0ac466d1", + "metadata": {}, + "source": [ + "## Extra info for an entity" + ] + }, + { + "cell_type": "markdown", + "id": "d240ffc1", + "metadata": {}, + "source": [ + "What if.. _we don't know what we want?_ More specifically, say we know a few properties we want to extract for a given entity but we also want to know if there's any extra information in the passage. Fortunately, we don't need to structure everything - we can have unstructured extraction as well. \n", + "\n", + "We can do this by introducing another hack, namely the *extra_info* attribute - let's see an example." + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "id": "f19685f6", + "metadata": {}, + "outputs": [], + "source": [ + "schema = {\n", + " \"properties\": {\n", + " \"person_name\": {\"type\": \"string\"},\n", + " \"person_height\": {\"type\": \"integer\"},\n", + " \"person_hair_color\": {\"type\": \"string\"},\n", + " \"dog_name\": {\"type\": \"string\"},\n", + " \"dog_breed\": {\"type\": \"string\"},\n", + " \"dog_extra_info\": {\"type\": \"string\"},\n", + " },\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "id": "200c3477", + "metadata": {}, + "outputs": [], + "source": [ + "inp = \"\"\"\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + "\n", + "Willow is a German Shepherd that likes to play with other dogs and can always be found playing with Milo, a border collie that lives close by.\n", + "\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "id": "ddad7dc6", + "metadata": {}, + "outputs": [], + "source": [ + "chain = create_extraction_chain(schema, llm)" + ] + }, + { + "cell_type": "markdown", + "id": "e5c0dbbc", + "metadata": {}, + "source": [ + "It is nice to know more about Willow and Milo!" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "id": "c22cfd30", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},\n", + " {'person_name': 'Claudia',\n", + " 'person_height': 6,\n", + " 'person_hair_color': 'brunette'},\n", + " {'dog_name': 'Willow',\n", + " 'dog_breed': 'German Shepherd',\n", + " 'dog_extra_information': 'likes to play with other dogs'},\n", + " {'dog_name': 'Milo',\n", + " 'dog_breed': 'border collie',\n", + " 'dog_extra_information': 'lives close by'}]" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chain.run(inp)" + ] + }, + { + "cell_type": "markdown", + "id": "698b4c4d", + "metadata": {}, + "source": [ + "## Pydantic example" + ] + }, + { + "cell_type": "markdown", + "id": "6504a6d9", + "metadata": {}, + "source": [ + "We can also use a Pydantic schema to choose the required properties and types and we will set as 'Optional' those that are not strictly required.\n", + "\n", + "By using the `create_extraction_chain_pydantic` function, we can send a Pydantic schema as input and the output will be an instantiated object that respects our desired schema. \n", + "\n", + "In this way, we can specify our schema in the same manner that we would a new class or function in Python - with purely Pythonic types." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "6792866b", + "metadata": {}, + "outputs": [], + "source": [ + "from typing import Optional, List\n", + "from pydantic import BaseModel, Field" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "36a63761", + "metadata": {}, + "outputs": [], + "source": [ + "class Properties(BaseModel):\n", + " person_name: str\n", + " person_height: int\n", + " person_hair_color: str\n", + " dog_breed: Optional[str]\n", + " dog_name: Optional[str]" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "8ffd1e57", + "metadata": {}, + "outputs": [], + "source": [ + "chain = create_extraction_chain_pydantic(pydantic_schema=Properties, llm=llm)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "24baa954", + "metadata": { + "scrolled": false + }, + "outputs": [], + "source": [ + "inp = \"\"\"\n", + "Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.\n", + "Alex's dog Frosty is a labrador and likes to play hide and seek.\n", + " \"\"\"" + ] + }, + { + "cell_type": "markdown", + "id": "84e0a241", + "metadata": {}, + "source": [ + "As we can see, we extracted the required entities and their properties in the required format:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "f771df58", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Properties(person_name='Alex', person_height=5, person_hair_color='blonde', dog_breed='labrador', dog_name='Frosty'),\n", + " Properties(person_name='Claudia', person_height=6, person_hair_color='brunette', dog_breed=None, dog_name=None)]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "chain.run(inp)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0df61283", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/extras/modules/chains/additional/graph_arangodb_qa.ipynb b/docs/extras/use_cases/graph/graph_arangodb_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_arangodb_qa.ipynb rename to docs/extras/use_cases/graph/graph_arangodb_qa.ipynb diff --git a/docs/extras/modules/chains/additional/graph_cypher_qa.ipynb b/docs/extras/use_cases/graph/graph_cypher_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_cypher_qa.ipynb rename to docs/extras/use_cases/graph/graph_cypher_qa.ipynb diff --git a/docs/extras/modules/chains/additional/graph_hugegraph_qa.ipynb b/docs/extras/use_cases/graph/graph_hugegraph_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_hugegraph_qa.ipynb rename to docs/extras/use_cases/graph/graph_hugegraph_qa.ipynb diff --git a/docs/extras/modules/chains/additional/graph_kuzu_qa.ipynb b/docs/extras/use_cases/graph/graph_kuzu_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_kuzu_qa.ipynb rename to docs/extras/use_cases/graph/graph_kuzu_qa.ipynb diff --git a/docs/extras/modules/chains/additional/graph_nebula_qa.ipynb b/docs/extras/use_cases/graph/graph_nebula_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_nebula_qa.ipynb rename to docs/extras/use_cases/graph/graph_nebula_qa.ipynb diff --git a/docs/extras/modules/chains/additional/graph_qa.ipynb b/docs/extras/use_cases/graph/graph_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_qa.ipynb rename to docs/extras/use_cases/graph/graph_qa.ipynb diff --git a/docs/extras/modules/chains/additional/graph_sparql_qa.ipynb b/docs/extras/use_cases/graph/graph_sparql_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/graph_sparql_qa.ipynb rename to docs/extras/use_cases/graph/graph_sparql_qa.ipynb diff --git a/docs/extras/use_cases/graph/index.mdx b/docs/extras/use_cases/graph/index.mdx new file mode 100644 index 0000000000000..a9ae6d95a884f --- /dev/null +++ b/docs/extras/use_cases/graph/index.mdx @@ -0,0 +1,7 @@ +# Analyzing graph data + +Graph databases give us a powerful way to represent and query real-world relationships. There are a number of chains that make it easy to use LLMs to interact with various graph DBs. + +import DocCardList from "@theme/DocCardList"; + + \ No newline at end of file diff --git a/docs/extras/modules/chains/additional/neptune_cypher_qa.ipynb b/docs/extras/use_cases/graph/neptune_cypher_qa.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/neptune_cypher_qa.ipynb rename to docs/extras/use_cases/graph/neptune_cypher_qa.ipynb diff --git a/docs/extras/modules/chains/additional/tot.ipynb b/docs/extras/use_cases/graph/tot.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/tot.ipynb rename to docs/extras/use_cases/graph/tot.ipynb diff --git a/docs/extras/use_cases/question_answering/document-context-aware-QA.ipynb b/docs/extras/use_cases/question_answering/how_to/document-context-aware-QA.ipynb similarity index 99% rename from docs/extras/use_cases/question_answering/document-context-aware-QA.ipynb rename to docs/extras/use_cases/question_answering/how_to/document-context-aware-QA.ipynb index 498639df375ac..ece1dc235a1cf 100644 --- a/docs/extras/use_cases/question_answering/document-context-aware-QA.ipynb +++ b/docs/extras/use_cases/question_answering/how_to/document-context-aware-QA.ipynb @@ -5,7 +5,7 @@ "id": "88d7cc8c", "metadata": {}, "source": [ - "# Context aware text splitting and QA / Chat\n", + "# Perform context-aware text splitting\n", "\n", "Text splitting for vector storage often uses sentences or other delimiters [to keep related text together](https://www.pinecone.io/learn/chunking-strategies/). \n", "\n", @@ -327,7 +327,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.11.3" }, "vscode": { "interpreter": { diff --git a/docs/extras/modules/chains/additional/flare.ipynb b/docs/extras/use_cases/question_answering/how_to/flare.ipynb similarity index 99% rename from docs/extras/modules/chains/additional/flare.ipynb rename to docs/extras/use_cases/question_answering/how_to/flare.ipynb index 5687e06e2ecba..3c16bf695527a 100644 --- a/docs/extras/modules/chains/additional/flare.ipynb +++ b/docs/extras/use_cases/question_answering/how_to/flare.ipynb @@ -5,7 +5,7 @@ "id": "0f0b9afa", "metadata": {}, "source": [ - "# FLARE\n", + "# Retrieve as you generate with FLARE\n", "\n", "This notebook is an implementation of Forward-Looking Active REtrieval augmented generation (FLARE).\n", "\n", @@ -56,8 +56,7 @@ "source": [ "import os\n", "\n", - "os.environ[\"SERPER_API_KEY\"] = \"\"", - "os.environ[\"OPENAI_API_KEY\"] = \"\"" + "os.environ[\"SERPER_API_KEY\"] = \"\"os.environ[\"OPENAI_API_KEY\"] = \"\"" ] }, { @@ -490,7 +489,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.11.3" } }, "nbformat": 4, diff --git a/docs/extras/modules/chains/additional/hyde.ipynb b/docs/extras/use_cases/question_answering/how_to/hyde.ipynb similarity index 99% rename from docs/extras/modules/chains/additional/hyde.ipynb rename to docs/extras/use_cases/question_answering/how_to/hyde.ipynb index 257fc129eddff..c640e61637d9a 100644 --- a/docs/extras/modules/chains/additional/hyde.ipynb +++ b/docs/extras/use_cases/question_answering/how_to/hyde.ipynb @@ -5,7 +5,7 @@ "id": "ccb74c9b", "metadata": {}, "source": [ - "# Hypothetical Document Embeddings\n", + "# Improve document indexing with HyDE\n", "This notebook goes over how to use Hypothetical Document Embeddings (HyDE), as described in [this paper](https://arxiv.org/abs/2212.10496). \n", "\n", "At a high level, HyDE is an embedding technique that takes queries, generates a hypothetical answer, and then embeds that generated document and uses that as the final example. \n", @@ -255,7 +255,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.11.3" }, "vscode": { "interpreter": { diff --git a/docs/extras/use_cases/question_answering/local_retrieval_qa.ipynb b/docs/extras/use_cases/question_answering/how_to/local_retrieval_qa.ipynb similarity index 99% rename from docs/extras/use_cases/question_answering/local_retrieval_qa.ipynb rename to docs/extras/use_cases/question_answering/how_to/local_retrieval_qa.ipynb index 668b58166fa83..9eea135a66b4d 100644 --- a/docs/extras/use_cases/question_answering/local_retrieval_qa.ipynb +++ b/docs/extras/use_cases/question_answering/how_to/local_retrieval_qa.ipynb @@ -5,7 +5,7 @@ "id": "3ea857b1", "metadata": {}, "source": [ - "# Running LLMs locally\n", + "# Use local LLMs\n", "\n", "The popularity of projects like [PrivateGPT](https://github.com/imartinez/privateGPT), [llama.cpp](https://github.com/ggerganov/llama.cpp), and [GPT4All](https://github.com/nomic-ai/gpt4all) underscore the importance of running LLMs locally.\n", "\n", @@ -736,7 +736,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.11.3" } }, "nbformat": 4, diff --git a/docs/extras/modules/chains/additional/qa_citations.ipynb b/docs/extras/use_cases/question_answering/how_to/qa_citations.ipynb similarity index 98% rename from docs/extras/modules/chains/additional/qa_citations.ipynb rename to docs/extras/use_cases/question_answering/how_to/qa_citations.ipynb index 5eaf9e5d2a9c2..5c3ab831ca0d1 100644 --- a/docs/extras/modules/chains/additional/qa_citations.ipynb +++ b/docs/extras/use_cases/question_answering/how_to/qa_citations.ipynb @@ -5,7 +5,7 @@ "id": "9b5c258f", "metadata": {}, "source": [ - "# Question-Answering Citations\n", + "# Cite sources\n", "\n", "This notebook shows how to use OpenAI functions ability to extract citations from text." ] @@ -171,7 +171,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.11.3" } }, "nbformat": 4, diff --git a/docs/extras/modules/chains/additional/vector_db_text_generation.ipynb b/docs/extras/use_cases/question_answering/how_to/vector_db_text_generation.ipynb similarity index 99% rename from docs/extras/modules/chains/additional/vector_db_text_generation.ipynb rename to docs/extras/use_cases/question_answering/how_to/vector_db_text_generation.ipynb index 1ce3d529633b1..e183b5049cbd7 100644 --- a/docs/extras/modules/chains/additional/vector_db_text_generation.ipynb +++ b/docs/extras/use_cases/question_answering/how_to/vector_db_text_generation.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Vector store-augmented text generation\n", + "# Retrieve from vector stores directly\n", "\n", "This notebook walks through how to use LangChain for text generation over a vector index. This is useful if we want to generate text that is able to draw from a large body of custom text, for example, generating blog posts that have an understanding of previous blog posts written, or product tutorials that can refer to product documentation." ] diff --git a/docs/extras/use_cases/question_answering/index.mdx b/docs/extras/use_cases/question_answering/index.mdx index e3edb771209d0..d668fd70e5028 100644 --- a/docs/extras/use_cases/question_answering/index.mdx +++ b/docs/extras/use_cases/question_answering/index.mdx @@ -2,160 +2,116 @@ sidebar_position: 0 --- -# QA and Chat over Documents +# QA over Documents -Chat and Question-Answering (QA) over `data` are popular LLM use-cases. +## Use case +Suppose you have some text documents (PDF, blog, Notion pages, etc.) and want to ask questions related to the contents of those documents. LLMs, given their proficiency in understanding text, are a great tool for this. -`data` can include many things, including: - -* `Unstructured data` (e.g., PDFs) -* `Structured data` (e.g., SQL) -* `Code` (e.g., Python) - -LangChain supports Chat and QA on various `data` types: - -* See [here](https://python.langchain.com/docs/use_cases/code/) and [here](https://twitter.com/cristobal_dev/status/1675745314592915456?s=20) for `Code` -* See [here](https://python.langchain.com/docs/use_cases/tabular) for `Structured data` - -Below we will review Chat and QA on `Unstructured data`. +In this walkthrough we'll go over how to build a question-answering over documents application using LLMs. Two very related use cases which we cover elsewhere are: +- [QA over structured data](/docs/use_cases/tabular) (e.g., SQL) +- [QA over code](/docs/use_cases/code) (e.g., Python) ![intro.png](/img/qa_intro.png) -`Unstructured data` can be loaded from many sources. - -Use the [LangChain integration hub](https://integrations.langchain.com/) to browse the full set of loaders. - +## Overview +The pipeline for converting raw unstructured data into a QA chain looks like this: +1. `Loading`: First we need to load our data. Unstructured data can be loaded from many sources. Use the [LangChain integration hub](https://integrations.langchain.com/) to browse the full set of loaders. Each loader returns data as a LangChain [`Document`](https://docs.langchain.com/docs/components/schema/document). - -`Documents` are turned into a Chat or QA app following the general steps below: - -* `Splitting`: [Text splitters](https://python.langchain.com/docs/modules/data_connection/document_transformers/) break `Documents` into splits of specified size -* `Storage`: Storage (e.g., often a [vectorstore](https://python.langchain.com/docs/modules/data_connection/vectorstores/)) will house [and often embed](https://www.pinecone.io/learn/vector-embeddings/) the splits -* `Retrieval`: The app retrieves splits from storage (e.g., often [with similar embeddings](https://www.pinecone.io/learn/k-nearest-neighbor/) to the input question) -* `Output`: An [LLM](https://python.langchain.com/docs/modules/model_io/models/llms/) produces an answer using a prompt that includes the question and the retrieved splits +2. `Splitting`: [Text splitters](/docs/modules/data_connection/document_transformers/) break `Documents` into splits of specified size +3. `Storage`: Storage (e.g., often a [vectorstore](/docs/modules/data_connection/vectorstores/)) will house [and often embed](https://www.pinecone.io/learn/vector-embeddings/) the splits +4. `Retrieval`: The app retrieves splits from storage (e.g., often [with similar embeddings](https://www.pinecone.io/learn/k-nearest-neighbor/) to the input question) +5. `Generation`: An [LLM](/docs/modules/model_io/models/llms/) produces an answer using a prompt that includes the question and the retrieved data +6. `Conversation` (Extension): Hold a multi-turn conversation by adding [Memory](/docs/modules/memory/) to your QA chain. ![flow.jpeg](/img/qa_flow.jpeg) -## Quickstart - -The above pipeline can be wrapped with a `VectorstoreIndexCreator`. - -In particular: +## Quickstart +To give you a sneak preview, the above pipeline can be all be wrapped in a single object: `VectorstoreIndexCreator`. Suppose we want a QA app over this [blog post](https://lilianweng.github.io/posts/2023-06-23-agent/). We can create this in a few lines of code: -* Specify a `Document` loader -* The `splitting`, `storage`, `retrieval`, and `output` generation stages are wrapped - -Let's load this [blog post](https://lilianweng.github.io/posts/2023-06-23-agent/) on agents as an example `Document`. - -We have a QA app in a few lines of code. - -Set environment variables and get packages: -```python -pip install openai -pip install chromadb +First set environment variables and install packages: +```bash +pip install openai chromadb export OPENAI_API_KEY="..." ``` -Run: +Then run: ```python from langchain.document_loaders import WebBaseLoader from langchain.indexes import VectorstoreIndexCreator -# Document loader + loader = WebBaseLoader("https://lilianweng.github.io/posts/2023-06-23-agent/") -# Index that wraps above steps index = VectorstoreIndexCreator().from_loaders([loader]) -# Question-answering -question = "What is Task Decomposition?" -index.query(question) ``` - - +And now ask your questions: +```python +index.query("What is Task Decomposition?") +``` ' Task decomposition is a technique used to break down complex tasks into smaller and simpler steps. It can be done using LLM with simple prompting, task-specific instructions, or human inputs. Tree of Thoughts (Yao et al. 2023) is an example of a task decomposition technique that explores multiple reasoning possibilities at each step and generates multiple thoughts per step, creating a tree structure.' +Ok, but what's going on under the hood, and how could we customize this for our specific use case? For that, let's take a look at how we can construct this pipeline piece by piece. +## Step 1. Load -Of course, some users do not want this level of abstraction. - -Below, we will discuss each stage in more detail. - -## 1. Loading, Splitting, Storage - - - -### 1.1 Getting started - -Specify a `Document` loader. - +Specify a `DocumentLoader` to load in your unstructured data as `Documents`. A `Document` is a piece of text (the `page_content`) and associated metadata. ```python -# Document loader from langchain.document_loaders import WebBaseLoader + loader = WebBaseLoader("https://lilianweng.github.io/posts/2023-06-23-agent/") data = loader.load() ``` -Split the `Document` into chunks for embedding and vector storage. +### Go deeper +- Browse the > 120 data loader integrations [here](https://integrations.langchain.com/). +- See further documentation on loaders [here](/docs/modules/data_connection/document_loaders/). + +## Step 2. Split +Split the `Document` into chunks for embedding and vector storage. ```python -# Split from langchain.text_splitter import RecursiveCharacterTextSplitter + text_splitter = RecursiveCharacterTextSplitter(chunk_size = 500, chunk_overlap = 0) all_splits = text_splitter.split_documents(data) ``` -Embed and store the splits in a vector database ([Chroma](https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/chroma)). - - -```python -# Store -from langchain.vectorstores import Chroma -from langchain.embeddings import OpenAIEmbeddings -vectorstore = Chroma.from_documents(documents=all_splits,embedding=OpenAIEmbeddings()) -``` - -Here are the three pieces together: +### Go deeper -![lc.png](/img/qa_data_load.png) - -### 1.2 Going Deeper - -#### 1.2.1 Integrations - -`Document Loaders` - -* Browse the > 120 data loader integrations [here](https://integrations.langchain.com/). +- `DocumentSplitters` are just one type of the more generic `DocumentTransformers`, which can all be useful in this preprocessing step. +- See further documentation on transformers [here](/docs/modules/data_connection/document_transformers/). +- `Context-aware splitters` keep the location ("context") of each split in the original `Document`: + - [Markdown files](/docs/use_cases/question_answering/document-context-aware-QA) + - [Code (py or js)](/docs/modules/data_connection/document_loaders/integrations/source_code) + - [Documents](/docs/modules/data_connection/document_loaders/integrations/grobid) -* See further documentation on loaders [here](https://python.langchain.com/docs/modules/data_connection/document_loaders/). +## Step 3. Store -`Document Transformers` +To be able to look up our document splits, we first need to store them where we can later look them up. +The most common way to do this is to embed the contents of each document then store the embedding and document in a vector store, with the embedding being used to index the document. -* All can ingest loaded `Documents` and process them (e.g., split). - -* See further documentation on transformers [here](https://python.langchain.com/docs/modules/data_connection/document_transformers/). +```python +from langchain.embeddings import OpenAIEmbeddings +from langchain.vectorstores import Chroma -`Vectorstores` - -* Browse the > 35 vectorstores integrations [here](https://integrations.langchain.com/). - -* See further documentation on vectorstores [here](https://python.langchain.com/docs/modules/data_connection/vectorstores/). - -#### 1.2.2 Retaining metadata +vectorstore = Chroma.from_documents(documents=all_splits, embedding=OpenAIEmbeddings()) +``` -`Context-aware splitters` keep the location ("context") of each split in the original `Document`: +### Go deeper +- Browse the > 40 vectorstores integrations [here](https://integrations.langchain.com/). +- See further documentation on vectorstores [here](/docs/modules/data_connection/vectorstores/). +- Browse the > 30 text embedding integrations [here](https://integrations.langchain.com/). +- See further documentation on embedding models [here](/docs/modules/data_connection/text_embedding/). -* [Markdown files](https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA) -* [Code (py or js)](https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/source_code) -* [Documents](https://python.langchain.com/docs/modules/data_connection/document_loaders/integrations/grobid) + Here are Steps 1-3: -## 2. Retrieval +![lc.png](/img/qa_data_load.png) -### 2.1 Getting started - -Retrieve [relevant splits](https://www.pinecone.io/learn/what-is-similarity-search/) for any question using `similarity_search`. +## Step 4. Retrieve +Retrieve relevant splits for any question using [similarity search](https://www.pinecone.io/learn/what-is-similarity-search/). ```python question = "What are the approaches to Task Decomposition?" @@ -163,60 +119,39 @@ docs = vectorstore.similarity_search(question) len(docs) ``` - - - 4 +### Go deeper +Vectorstores are commonly used for retrieval, but they are not the only option. For example, SVMs (see thread [here](https://twitter.com/karpathy/status/1647025230546886658?s=20)) can also be used. -### 2.2 Going Deeper - -#### 2.2.1 Retrieval - -Vectorstores are commonly used for retrieval. - -But, they are not the only option. - -For example, SVMs (see thread [here](https://twitter.com/karpathy/status/1647025230546886658?s=20)) can also be used. - -LangChain [has many retrievers](https://python.langchain.com/docs/modules/data_connection/retrievers/) including, but not limited to, vectorstores. - -All retrievers implement some common methods, such as `get_relevant_documents()`. - +LangChain [has many retrievers](/docs/modules/data_connection/retrievers/) including, but not limited to, vectorstores. All retrievers implement a common method `get_relevant_documents()` (and its asynchronous variant `aget_relevant_documents()`). ```python from langchain.retrievers import SVMRetriever + svm_retriever = SVMRetriever.from_documents(all_splits,OpenAIEmbeddings()) docs_svm=svm_retriever.get_relevant_documents(question) len(docs_svm) ``` - - - 4 - - -#### 2.2.2 Advanced retrieval - -Improve on `similarity_search`: - -* `MultiQueryRetriever` [generates variants of the input question](https://python.langchain.com/docs/modules/data_connection/retrievers/how_to/MultiQueryRetriever) to improve retrieval. - -* `Max marginal relevance` selects for [relevance and diversity](https://www.cs.cmu.edu/~jgc/publication/The_Use_MMR_Diversity_Based_LTMIR_1998.pdf) among the retrieved documents. - -* Documents can be filtered during retrieval using [`metadata` filters](https://python.langchain.com/docs/use_cases/question_answering/document-context-aware-QA). +Some common ways to improve on vector similarity search include: +- `MultiQueryRetriever` [generates variants of the input question](/docs/modules/data_connection/retrievers/how_to/MultiQueryRetriever) to improve retrieval. +- `Max marginal relevance` selects for [relevance and diversity](https://www.cs.cmu.edu/~jgc/publication/The_Use_MMR_Diversity_Based_LTMIR_1998.pdf) among the retrieved documents. +- Documents can be filtered during retrieval using [`metadata` filters](/docs/use_cases/question_answering/document-context-aware-QA). ```python -# MultiQueryRetriever import logging + from langchain.chat_models import ChatOpenAI from langchain.retrievers.multi_query import MultiQueryRetriever + logging.basicConfig() logging.getLogger('langchain.retrievers.multi_query').setLevel(logging.INFO) + retriever_from_llm = MultiQueryRetriever.from_llm(retriever=vectorstore.as_retriever(), llm=ChatOpenAI(temperature=0)) unique_docs = retriever_from_llm.get_relevant_documents(query=question) @@ -226,79 +161,48 @@ len(unique_docs) INFO:langchain.retrievers.multi_query:Generated queries: ['1. How can Task Decomposition be approached?', '2. What are the different methods for Task Decomposition?', '3. What are the various approaches to decomposing tasks?'] 5 +## Step 5. Generate - - -## 3. QA - -### 3.1 Getting started - -Distill the retrieved documents into an answer using an LLM (e.g., `gpt-3.5-turbo`) with `RetrievalQA` chain. - +Distill the retrieved documents into an answer using an LLM/Chat model (e.g., `gpt-3.5-turbo`) with `RetrievalQA` chain. ```python -from langchain.chat_models import ChatOpenAI -llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0) from langchain.chains import RetrievalQA -qa_chain = RetrievalQA.from_chain_type(llm,retriever=vectorstore.as_retriever()) -qa_chain({"query": question}) -``` - - - - - {'query': 'What are the approaches to Task Decomposition?', - 'result': 'The approaches to task decomposition include:\n\n1. Simple prompting: This approach involves using simple prompts or questions to guide the agent in breaking down a task into smaller subgoals. For example, the agent can be prompted with "Steps for XYZ" and asked to list the subgoals for achieving XYZ.\n\n2. Task-specific instructions: In this approach, task-specific instructions are provided to the agent to guide the decomposition process. For example, if the task is to write a novel, the agent can be instructed to "Write a story outline" as a subgoal.\n\n3. Human inputs: This approach involves incorporating human inputs in the task decomposition process. Humans can provide guidance, feedback, and suggestions to help the agent break down complex tasks into manageable subgoals.\n\nThese approaches aim to enable efficient handling of complex tasks by breaking them down into smaller, more manageable parts.'} - - - -### 3.2 Going Deeper - -#### 3.2.1 Integrations - -`LLMs` - -* Browse the > 55 LLM integrations [here](https://integrations.langchain.com/). - -* See further documentation on LLMs [here](https://python.langchain.com/docs/modules/model_io/models/). - -#### 3.2.2 Running LLMs locally - -The popularity of [PrivateGPT](https://github.com/imartinez/privateGPT) and [GPT4All](https://github.com/nomic-ai/gpt4all) underscore the importance of running LLMs locally. - -LangChain has integrations with many open source LLMs that can be run locally. - -Using `GPT4All` is as simple as [downloading the binary]((https://python.langchain.com/docs/integrations/llms/gpt4all)) and then: - +from langchain.chat_models import ChatOpenAI -```python -from langchain.llms import GPT4All -from langchain.chains import RetrievalQA -llm = GPT4All(model="/Users/rlm/Desktop/Code/gpt4all/models/nous-hermes-13b.ggmlv3.q4_0.bin",max_tokens=2048) +llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0) qa_chain = RetrievalQA.from_chain_type(llm,retriever=vectorstore.as_retriever()) -``` - - -```python qa_chain({"query": question}) ``` + { + 'query': 'What are the approaches to Task Decomposition?', + 'result': 'The approaches to task decomposition include:\n\n1. Simple prompting: This approach involves using simple prompts or questions to guide the agent in breaking down a task into smaller subgoals. For example, the agent can be prompted with "Steps for XYZ" and asked to list the subgoals for achieving XYZ.\n\n2. Task-specific instructions: In this approach, task-specific instructions are provided to the agent to guide the decomposition process. For example, if the task is to write a novel, the agent can be instructed to "Write a story outline" as a subgoal.\n\n3. Human inputs: This approach involves incorporating human inputs in the task decomposition process. Humans can provide guidance, feedback, and suggestions to help the agent break down complex tasks into manageable subgoals.\n\nThese approaches aim to enable efficient handling of complex tasks by breaking them down into smaller, more manageable parts.' + } +Note, you can pass in an `LLM` or a `ChatModel` (like we did here) to the `RetrievalQA` chain. +### Go deeper - {'query': 'What are the approaches to Task Decomposition?', - 'result': ' There are three main approaches to task decomposition: (1) using language models like GPT-3 for simple prompting such as "Steps for XYZ.\\n1.", (2) using task-specific instructions, and (3) with human inputs.'} +#### Choosing LLMs +- Browse the > 55 LLM and chat model integrations [here](https://integrations.langchain.com/). +- See further documentation on LLMs and chat models [here](/docs/modules/model_io/models/). +- Use local LLMS: The popularity of [PrivateGPT](https://github.com/imartinez/privateGPT) and [GPT4All](https://github.com/nomic-ai/gpt4all) underscore the importance of running LLMs locally. +Using `GPT4All` is as simple as [downloading the binary]((/docs/integrations/llms/gpt4all)) and then: + from langchain.llms import GPT4All + from langchain.chains import RetrievalQA + llm = GPT4All(model="/Users/rlm/Desktop/Code/gpt4all/models/nous-hermes-13b.ggmlv3.q4_0.bin",max_tokens=2048) + qa_chain = RetrievalQA.from_chain_type(llm, retriever=vectorstore.as_retriever()) -#### 3.2.2 Customizing the prompt +#### Customizing the prompt The prompt in `RetrievalQA` chain can be easily customized. - ```python -# Build prompt +from langchain.chains import RetrievalQA from langchain.prompts import PromptTemplate + template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Use three sentences maximum and keep the answer as concise as possible. @@ -306,33 +210,28 @@ Always say "thanks for asking!" at the end of the answer. {context} Question: {question} Helpful Answer:""" -QA_CHAIN_PROMPT = PromptTemplate(input_variables=["context", "question"],template=template,) +QA_CHAIN_PROMPT = PromptTemplate.from_template(template) -# Run chain -from langchain.chains import RetrievalQA llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0) -qa_chain = RetrievalQA.from_chain_type(llm, - retriever=vectorstore.as_retriever(), - chain_type_kwargs={"prompt": QA_CHAIN_PROMPT}) - +qa_chain = RetrievalQA.from_chain_type( + llm, + retriever=vectorstore.as_retriever(), + chain_type_kwargs={"prompt": QA_CHAIN_PROMPT} +) result = qa_chain({"query": question}) result["result"] ``` - - - 'The approaches to Task Decomposition are (1) using simple prompting by LLM, (2) using task-specific instructions, and (3) with human inputs. Thanks for asking!' - -#### 3.2.3 Returning source documents +#### Return source documents The full set of retrieved documents used for answer distillation can be returned using `return_source_documents=True`. - ```python from langchain.chains import RetrievalQA + qa_chain = RetrievalQA.from_chain_type(llm,retriever=vectorstore.as_retriever(), return_source_documents=True) result = qa_chain({"query": question}) @@ -345,51 +244,46 @@ result['source_documents'][0] -#### 3.2.4 Citations +#### Return citations Answer citations can be returned using `RetrievalQAWithSourcesChain`. ```python from langchain.chains import RetrievalQAWithSourcesChain + qa_chain = RetrievalQAWithSourcesChain.from_chain_type(llm,retriever=vectorstore.as_retriever()) + result = qa_chain({"question": question}) result ``` + { + 'question': 'What are the approaches to Task Decomposition?', + 'answer': 'The approaches to Task Decomposition include (1) using LLM with simple prompting, (2) using task-specific instructions, and (3) incorporating human inputs.\n', + 'sources': 'https://lilianweng.github.io/posts/2023-06-23-agent/' + } - - - {'question': 'What are the approaches to Task Decomposition?', - 'answer': 'The approaches to Task Decomposition include (1) using LLM with simple prompting, (2) using task-specific instructions, and (3) incorporating human inputs.\n', - 'sources': 'https://lilianweng.github.io/posts/2023-06-23-agent/'} - - - -#### 3.2.5 Customizing retrieved docs in the LLM prompt +#### Customizing retrieved document processing Retrieved documents can be fed to an LLM for answer distillation in a few different ways. -`stuff`, `refine`, `map-reduce`, and `map-rerank` chains for passing documents to an LLM prompt are well summarized [here](https://python.langchain.com/docs/modules/chains/document/). +`stuff`, `refine`, `map-reduce`, and `map-rerank` chains for passing documents to an LLM prompt are well summarized [here](/docs/modules/chains/document/). `stuff` is commonly used because it simply "stuffs" all retrieved documents into the prompt. -The [load_qa_chain](https://python.langchain.com/docs/modules/chains/additional/question_answering.html) is an easy way to pass documents to an LLM using these various approaches (e.g., see `chain_type`). +The [load_qa_chain](/docs/use_cases/question_answering/how_to/question_answering.html) is an easy way to pass documents to an LLM using these various approaches (e.g., see `chain_type`). ```python from langchain.chains.question_answering import load_qa_chain + chain = load_qa_chain(llm, chain_type="stuff") chain({"input_documents": unique_docs, "question": question},return_only_outputs=True) ``` - - - {'output_text': 'The approaches to task decomposition include (1) using simple prompting to break down tasks into subgoals, (2) providing task-specific instructions to guide the decomposition process, and (3) incorporating human inputs for task decomposition.'} - - We can also pass the `chain_type` to `RetrievalQA`. @@ -403,55 +297,46 @@ In summary, the user can choose the desired level of abstraction for QA: ![summary_chains.png](/img/summary_chains.png) -## 4. Chat - -### 4.1 Getting started - -To keep chat history, first specify a `Memory buffer` to track the conversation inputs / outputs. +## Step 6. Converse (Extension) +To hold a conversation, a chain needs to be able to refer to past interactions. Chain `Memory` allows us to do this. To keep chat history, we can specify a Memory buffer to track the conversation inputs / outputs. ```python from langchain.memory import ConversationBufferMemory + memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True) ``` The `ConversationalRetrievalChain` uses chat in the `Memory buffer`. - ```python from langchain.chains import ConversationalRetrievalChain -retriever=vectorstore.as_retriever() -chat = ConversationalRetrievalChain.from_llm(llm,retriever=retriever,memory=memory) -``` +retriever = vectorstore.as_retriever() +chat = ConversationalRetrievalChain.from_llm(llm, retriever=retriever, memory=memory) +``` ```python result = chat({"question": "What are some of the main ideas in self-reflection?"}) result['answer'] ``` - - - "Some of the main ideas in self-reflection include:\n1. Iterative improvement: Self-reflection allows autonomous agents to improve by refining past action decisions and correcting mistakes.\n2. Trial and error: Self-reflection is crucial in real-world tasks where trial and error are inevitable.\n3. Two-shot examples: Self-reflection is created by showing pairs of failed trajectories and ideal reflections for guiding future changes in the plan.\n4. Working memory: Reflections are added to the agent's working memory, up to three, to be used as context for querying.\n5. Performance evaluation: Self-reflection involves continuously reviewing and analyzing actions, self-criticizing behavior, and reflecting on past decisions and strategies to refine approaches.\n6. Efficiency: Self-reflection encourages being smart and efficient, aiming to complete tasks in the least number of steps." - - -The `Memory buffer` has context to resolve `"it"` ("self-reflection") in the below question. - +The Memory buffer has context to resolve `"it"` ("self-reflection") in the below question. ```python result = chat({"question": "How does the Reflexion paper handle it?"}) result['answer'] ``` - - - "The Reflexion paper handles self-reflection by showing two-shot examples to the Learning Language Model (LLM). Each example consists of a failed trajectory and an ideal reflection that guides future changes in the agent's plan. These reflections are then added to the agent's working memory, up to a maximum of three, to be used as context for querying the LLM. This allows the agent to iteratively improve its reasoning skills by refining past action decisions and correcting previous mistakes." +### Go deeper +The [documentation](/docs/use_cases/question_answering/how_to/chat_vector_db) on `ConversationalRetrievalChain` offers a few extensions, such as streaming and source documents. -### 4.2 Going deeper -The [documentation](https://python.langchain.com/docs/modules/chains/popular/chat_vector_db) on `ConversationalRetrievalChain` offers a few extensions, such as streaming and source documents. +## Further reading +- Check out the [How to](/docs/use_cases/question_answer/how_to/) section for all the variations of chains that can be used for QA over docs in different settings. +- Check out the [Integrations-specific](/docs/use_cases/question_answer/integrations/) section for chains that use specific integrations. diff --git a/docs/extras/use_cases/question_answering/integrations/_category_.yml b/docs/extras/use_cases/question_answering/integrations/_category_.yml new file mode 100644 index 0000000000000..4a4b0b2f28a09 --- /dev/null +++ b/docs/extras/use_cases/question_answering/integrations/_category_.yml @@ -0,0 +1 @@ +label: 'Integration-specific' diff --git a/docs/extras/modules/chains/additional/openai_functions_retrieval_qa.ipynb b/docs/extras/use_cases/question_answering/integrations/openai_functions_retrieval_qa.ipynb similarity index 99% rename from docs/extras/modules/chains/additional/openai_functions_retrieval_qa.ipynb rename to docs/extras/use_cases/question_answering/integrations/openai_functions_retrieval_qa.ipynb index b3dcbdee5df3c..c64c3427f29c8 100644 --- a/docs/extras/modules/chains/additional/openai_functions_retrieval_qa.ipynb +++ b/docs/extras/use_cases/question_answering/integrations/openai_functions_retrieval_qa.ipynb @@ -5,7 +5,7 @@ "id": "71a43144", "metadata": {}, "source": [ - "# Retrieval QA using OpenAI functions\n", + "# Structure answers with OpenAI functions\n", "\n", "OpenAI functions allows for structuring of response output. This is often useful in question answering when you want to not only get the final answer but also supporting evidence, citations, etc.\n", "\n", @@ -337,7 +337,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "ac9e4626", "metadata": {}, @@ -431,7 +430,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -445,7 +444,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.5" + "version": "3.11.3" } }, "nbformat": 4, diff --git a/docs/extras/use_cases/question_answering/semantic-search-over-chat.ipynb b/docs/extras/use_cases/question_answering/integrations/semantic-search-over-chat.ipynb similarity index 95% rename from docs/extras/use_cases/question_answering/semantic-search-over-chat.ipynb rename to docs/extras/use_cases/question_answering/integrations/semantic-search-over-chat.ipynb index c877a2a524683..800866053b208 100644 --- a/docs/extras/use_cases/question_answering/semantic-search-over-chat.ipynb +++ b/docs/extras/use_cases/question_answering/integrations/semantic-search-over-chat.ipynb @@ -1,18 +1,16 @@ { "cells": [ { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "# Question answering over a group chat messages using Activeloop's DeepLake\n", + "# QA using Activeloop's DeepLake\n", "In this tutorial, we are going to use Langchain + Activeloop's Deep Lake with GPT4 to semantically search and ask questions over a group chat.\n", "\n", "View a working demo [here](https://twitter.com/thisissukh_/status/1647223328363679745)" ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -29,7 +27,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -37,7 +34,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [] @@ -73,7 +69,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -83,7 +78,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -124,7 +118,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -155,7 +148,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -213,7 +205,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.11.3" } }, "nbformat": 4, diff --git a/docs/extras/use_cases/self_check/index.mdx b/docs/extras/use_cases/self_check/index.mdx new file mode 100644 index 0000000000000..a424ea43701f1 --- /dev/null +++ b/docs/extras/use_cases/self_check/index.mdx @@ -0,0 +1,8 @@ +# Self-checking + +One of the main issues with using LLMs is that they can often hallucinate and make false claims. One of the surprisingly effective ways to remediate this is to use the LLM itself to check its own answers. + +import DocCardList from "@theme/DocCardList"; + + + diff --git a/docs/extras/modules/chains/additional/llm_checker.ipynb b/docs/extras/use_cases/self_check/llm_checker.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/llm_checker.ipynb rename to docs/extras/use_cases/self_check/llm_checker.ipynb diff --git a/docs/extras/modules/chains/additional/llm_summarization_checker.ipynb b/docs/extras/use_cases/self_check/llm_summarization_checker.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/llm_summarization_checker.ipynb rename to docs/extras/use_cases/self_check/llm_summarization_checker.ipynb diff --git a/docs/extras/use_cases/summarization.mdx b/docs/extras/use_cases/summarization/index.mdx similarity index 82% rename from docs/extras/use_cases/summarization.mdx rename to docs/extras/use_cases/summarization/index.mdx index 1e9a7e2f49330..7f5e97c7635d7 100644 --- a/docs/extras/use_cases/summarization.mdx +++ b/docs/extras/use_cases/summarization/index.mdx @@ -16,7 +16,7 @@ chain.run(docs) ``` The following resources exist: -- [Summarization notebook](/docs/modules/chains/popular/summarize.html): A notebook walking through how to accomplish this task. +- [Summarization notebook](/docs/use_cases/summarization/summarize.html): A notebook walking through how to accomplish this task. Additional related resources include: - [Modules for working with documents](/docs/modules/data_connection): Core components for working with documents. diff --git a/docs/extras/modules/chains/additional/elasticsearch_database.ipynb b/docs/extras/use_cases/tabular/elasticsearch_database.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/elasticsearch_database.ipynb rename to docs/extras/use_cases/tabular/elasticsearch_database.ipynb diff --git a/docs/extras/use_cases/tabular.mdx b/docs/extras/use_cases/tabular/index.mdx similarity index 80% rename from docs/extras/use_cases/tabular.mdx rename to docs/extras/use_cases/tabular/index.mdx index d642307632151..497acdc71df69 100644 --- a/docs/extras/use_cases/tabular.mdx +++ b/docs/extras/use_cases/tabular/index.mdx @@ -10,7 +10,7 @@ This page covers all resources available in LangChain for working with data in t ## Document loading If you have text data stored in a tabular format, you may want to load the data into a Document and then index it as you would other text/unstructured data. For this, you should use a document loader like the [CSVLoader](/docs/modules/data_connection/document_loaders/how_to/csv.html) -and then you should [create an index](/docs/modules/data_connection) over that data, and [query it that way](/docs/modules/chains/popular/vector_db_qa.html). +and then you should [create an index](/docs/modules/data_connection) over that data, and [query it that way](/docs/use_cases/question_answering/how_to/vector_db_qa.html). ## Querying If you have more numeric tabular data, or have a large amount of data and don't want to index it, you should get started @@ -22,7 +22,7 @@ If you are just getting started, and you have relatively small/simple tabular da Chains are a sequence of predetermined steps, so they are good to get started with as they give you more control and let you understand what is happening better. -- [SQL Database Chain](/docs/modules/chains/popular/sqlite.html) +- [SQL Database Chain](/docs/use_cases/tabular/sqlite.html) ### Agents @@ -30,6 +30,6 @@ Agents are more complex, and involve multiple queries to the LLM to understand w The downside of agents are that you have less control. The upside is that they are more powerful, which allows you to use them on larger databases and more complex schemas. -- [SQL Agent](/docs/modules/agents/toolkits/sql_database.html) -- [Pandas Agent](/docs/modules/agents/toolkits/pandas.html) -- [CSV Agent](/docs/modules/agents/toolkits/csv.html) +- [SQL Agent](/docs/integrations/toolkits/sql_database.html) +- [Pandas Agent](/docs/integrations/toolkits/pandas.html) +- [CSV Agent](/docs/integrations/toolkits/csv.html) diff --git a/docs/extras/modules/chains/additional/tagging.ipynb b/docs/extras/use_cases/tagging.ipynb similarity index 100% rename from docs/extras/modules/chains/additional/tagging.ipynb rename to docs/extras/use_cases/tagging.ipynb diff --git a/docs/snippets/modules/agents/how_to/custom_llm_agent.mdx b/docs/snippets/modules/agents/how_to/custom_llm_agent.mdx index eebf7429f0ed7..f6a4de83aea6a 100644 --- a/docs/snippets/modules/agents/how_to/custom_llm_agent.mdx +++ b/docs/snippets/modules/agents/how_to/custom_llm_agent.mdx @@ -10,7 +10,7 @@ The LLMAgent is used in an AgentExecutor. This AgentExecutor can largely be thou In this notebook we walk through how to create a custom LLM agent. - + ## Set up environment diff --git a/docs/snippets/modules/agents/how_to/custom_llm_chat_agent.mdx b/docs/snippets/modules/agents/how_to/custom_llm_chat_agent.mdx index 955fdf95571a8..a44fffae08b54 100644 --- a/docs/snippets/modules/agents/how_to/custom_llm_chat_agent.mdx +++ b/docs/snippets/modules/agents/how_to/custom_llm_chat_agent.mdx @@ -10,7 +10,7 @@ The LLMAgent is used in an AgentExecutor. This AgentExecutor can largely be thou In this notebook we walk through how to create a custom LLM agent. - + ## Set up environment diff --git a/docs/snippets/modules/chains/additional/moderation.mdx b/docs/snippets/modules/chains/additional/moderation.mdx index 04b6b15b46098..470d167d03c98 100644 --- a/docs/snippets/modules/chains/additional/moderation.mdx +++ b/docs/snippets/modules/chains/additional/moderation.mdx @@ -3,7 +3,7 @@ We'll show: 1. How to run any piece of text through a moderation chain. 2. How to append a Moderation chain to an LLMChain. - + ```python diff --git a/docs/snippets/modules/chains/additional/multi_prompt_router.mdx b/docs/snippets/modules/chains/additional/multi_prompt_router.mdx deleted file mode 100644 index 526469814b7c0..0000000000000 --- a/docs/snippets/modules/chains/additional/multi_prompt_router.mdx +++ /dev/null @@ -1,107 +0,0 @@ -```python -from langchain.chains.router import MultiPromptChain -from langchain.llms import OpenAI -``` - - -```python -physics_template = """You are a very smart physics professor. \ -You are great at answering questions about physics in a concise and easy to understand manner. \ -When you don't know the answer to a question you admit that you don't know. - -Here is a question: -{input}""" - - -math_template = """You are a very good mathematician. You are great at answering math questions. \ -You are so good because you are able to break down hard problems into their component parts, \ -answer the component parts, and then put them together to answer the broader question. - -Here is a question: -{input}""" -``` - - -```python -prompt_infos = [ - { - "name": "physics", - "description": "Good for answering questions about physics", - "prompt_template": physics_template - }, - { - "name": "math", - "description": "Good for answering math questions", - "prompt_template": math_template - } -] -``` - - -```python -chain = MultiPromptChain.from_prompts(OpenAI(), prompt_infos, verbose=True) -``` - - -```python -print(chain.run("What is black body radiation?")) -``` - - - -``` - - - > Entering new MultiPromptChain chain... - physics: {'input': 'What is black body radiation?'} - > Finished chain. - - - Black body radiation is the emission of electromagnetic radiation from a body due to its temperature. It is a type of thermal radiation that is emitted from the surface of all objects that are at a temperature above absolute zero. It is a spectrum of radiation that is influenced by the temperature of the body and is independent of the composition of the emitting material. -``` - - - - -```python -print(chain.run("What is the first prime number greater than 40 such that one plus the prime number is divisible by 3")) -``` - - - -``` - - - > Entering new MultiPromptChain chain... - math: {'input': 'What is the first prime number greater than 40 such that one plus the prime number is divisible by 3'} - > Finished chain. - ? - - The first prime number greater than 40 such that one plus the prime number is divisible by 3 is 43. To solve this problem, we can break down the question into two parts: finding the first prime number greater than 40, and then finding a number that is divisible by 3. - - The first step is to find the first prime number greater than 40. A prime number is a number that is only divisible by 1 and itself. The next prime number after 40 is 41. - - The second step is to find a number that is divisible by 3. To do this, we can add 1 to 41, which gives us 42. Now, we can check if 42 is divisible by 3. 42 divided by 3 is 14, so 42 is divisible by 3. - - Therefore, the answer to the question is 43. -``` - - - - -```python -print(chain.run("What is the name of the type of cloud that rins")) -``` - - - -``` - - - > Entering new MultiPromptChain chain... - None: {'input': 'What is the name of the type of cloud that rains?'} - > Finished chain. - The type of cloud that typically produces rain is called a cumulonimbus cloud. This type of cloud is characterized by its large vertical extent and can produce thunderstorms and heavy precipitation. Is there anything else you'd like to know? -``` - - diff --git a/docs/snippets/modules/memory/get_started.mdx b/docs/snippets/modules/memory/get_started.mdx index 8ac4b6278510d..0914adb127c93 100644 --- a/docs/snippets/modules/memory/get_started.mdx +++ b/docs/snippets/modules/memory/get_started.mdx @@ -5,7 +5,7 @@ One of the core utility classes underpinning most (if not all) memory modules is You may want to use this class directly if you are managing memory outside of a chain. - + ```python diff --git a/docs/snippets/modules/model_io/prompts/prompt_templates/few_shot_examples.mdx b/docs/snippets/modules/model_io/prompts/prompt_templates/few_shot_examples.mdx index d905280903b40..e14aafd2ff1b7 100644 --- a/docs/snippets/modules/model_io/prompts/prompt_templates/few_shot_examples.mdx +++ b/docs/snippets/modules/model_io/prompts/prompt_templates/few_shot_examples.mdx @@ -1,7 +1,7 @@ ### Use Case In this tutorial, we'll configure few shot examples for self-ask with search. - + ## Using an example set diff --git a/docs/snippets/modules/model_io/prompts/prompt_templates/get_started.mdx b/docs/snippets/modules/model_io/prompts/prompt_templates/get_started.mdx index aa3f803a466ac..47ba6c321ee70 100644 --- a/docs/snippets/modules/model_io/prompts/prompt_templates/get_started.mdx +++ b/docs/snippets/modules/model_io/prompts/prompt_templates/get_started.mdx @@ -77,7 +77,7 @@ For example, in OpenAI [Chat Completion API](https://platform.openai.com/docs/gu LangChain provides several prompt templates to make constructing and working with prompts easily. You are encouraged to use these chat related prompt templates instead of `PromptTemplate` when querying chat models to fully exploit the potential of underlying chat model. - + ```python diff --git a/docs/snippets/modules/model_io/prompts/prompt_templates/partial.mdx b/docs/snippets/modules/model_io/prompts/prompt_templates/partial.mdx index 8bbb13cc63247..b791a220f3a00 100644 --- a/docs/snippets/modules/model_io/prompts/prompt_templates/partial.mdx +++ b/docs/snippets/modules/model_io/prompts/prompt_templates/partial.mdx @@ -2,7 +2,7 @@ One common use case for wanting to partial a prompt template is if you get some of the variables before others. For example, suppose you have a prompt template that requires two variables, `foo` and `baz`. If you get the `foo` value early on in the chain, but the `baz` value later, it can be annoying to wait until you have both variables in the same place to pass them to the prompt template. Instead, you can partial the prompt template with the `foo` value, and then pass the partialed prompt template along and just use that. Below is an example of doing this: - + ```python diff --git a/libs/experimental/Makefile b/libs/experimental/Makefile index 1f025fc2cde7e..ede2c85b47f92 100644 --- a/libs/experimental/Makefile +++ b/libs/experimental/Makefile @@ -23,7 +23,7 @@ test_watch: # Define a variable for Python and notebook files. PYTHON_FILES=. lint format: PYTHON_FILES=. -lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') +lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/experimental --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') lint lint_diff: poetry run mypy $(PYTHON_FILES) diff --git a/libs/langchain/Makefile b/libs/langchain/Makefile index e81add90a861c..ba27b07f37690 100644 --- a/libs/langchain/Makefile +++ b/libs/langchain/Makefile @@ -70,7 +70,7 @@ docker_tests: # Define a variable for Python and notebook files. PYTHON_FILES=. lint format: PYTHON_FILES=. -lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') +lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/langchain --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') lint lint_diff: poetry run mypy $(PYTHON_FILES) diff --git a/libs/langchain/langchain/agents/mrkl/output_parser.py b/libs/langchain/langchain/agents/mrkl/output_parser.py index ca883fd131370..37c95f46f800f 100644 --- a/libs/langchain/langchain/agents/mrkl/output_parser.py +++ b/libs/langchain/langchain/agents/mrkl/output_parser.py @@ -6,6 +6,15 @@ from langchain.schema import AgentAction, AgentFinish, OutputParserException FINAL_ANSWER_ACTION = "Final Answer:" +MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE = ( + "Invalid Format: Missing 'Action:' after 'Thought:" +) +MISSING_ACTION_INPUT_AFTER_ACTION_ERROR_MESSAGE = ( + "Invalid Format: Missing 'Action Input:' after 'Action:'" +) +FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE = ( + "Parsing LLM output produced both a final answer and a parse-able action:" +) class MRKLOutputParser(AgentOutputParser): @@ -23,8 +32,7 @@ def parse(self, text: str) -> Union[AgentAction, AgentFinish]: if action_match: if includes_answer: raise OutputParserException( - "Parsing LLM output produced both a final answer " - f"and a parse-able action: {text}" + f"{FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE}: {text}" ) action = action_match.group(1).strip() action_input = action_match.group(2) @@ -43,7 +51,7 @@ def parse(self, text: str) -> Union[AgentAction, AgentFinish]: if not re.search(r"Action\s*\d*\s*:[\s]*(.*?)", text, re.DOTALL): raise OutputParserException( f"Could not parse LLM output: `{text}`", - observation="Invalid Format: Missing 'Action:' after 'Thought:'", + observation=MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE, llm_output=text, send_to_llm=True, ) @@ -52,8 +60,7 @@ def parse(self, text: str) -> Union[AgentAction, AgentFinish]: ): raise OutputParserException( f"Could not parse LLM output: `{text}`", - observation="Invalid Format:" - " Missing 'Action Input:' after 'Action:'", + observation=MISSING_ACTION_INPUT_AFTER_ACTION_ERROR_MESSAGE, llm_output=text, send_to_llm=True, ) diff --git a/libs/langchain/langchain/cache.py b/libs/langchain/langchain/cache.py index b589a29891713..16b6d659c2066 100644 --- a/libs/langchain/langchain/cache.py +++ b/libs/langchain/langchain/cache.py @@ -445,8 +445,10 @@ def _get_gptcache(self, llm_string: str) -> Any: """Get a cache object. When the corresponding llm model cache does not exist, it will be created.""" - - return self.gptcache_dict.get(llm_string, self._new_gptcache(llm_string)) + _gptcache = self.gptcache_dict.get(llm_string, None) + if not _gptcache: + _gptcache = self._new_gptcache(llm_string) + return _gptcache def lookup(self, prompt: str, llm_string: str) -> Optional[RETURN_VAL_TYPE]: """Look up the cache data. diff --git a/libs/langchain/langchain/callbacks/base.py b/libs/langchain/langchain/callbacks/base.py index dcf3766d8f63d..71025955f871b 100644 --- a/libs/langchain/langchain/callbacks/base.py +++ b/libs/langchain/langchain/callbacks/base.py @@ -242,6 +242,11 @@ def ignore_llm(self) -> bool: """Whether to ignore LLM callbacks.""" return False + @property + def ignore_retry(self) -> bool: + """Whether to ignore retry callbacks.""" + return False + @property def ignore_chain(self) -> bool: """Whether to ignore chain callbacks.""" diff --git a/libs/langchain/langchain/callbacks/manager.py b/libs/langchain/langchain/callbacks/manager.py index 3e2ba86b71e6e..1a0f6ac0a09c6 100644 --- a/libs/langchain/langchain/callbacks/manager.py +++ b/libs/langchain/langchain/callbacks/manager.py @@ -23,6 +23,8 @@ ) from uuid import UUID +from tenacity import RetryCallState + import langchain from langchain.callbacks.base import ( BaseCallbackHandler, @@ -475,6 +477,22 @@ def on_text( **kwargs, ) + def on_retry( + self, + retry_state: RetryCallState, + **kwargs: Any, + ) -> None: + _handle_event( + self.handlers, + "on_retry", + "ignore_retry", + retry_state, + run_id=self.run_id, + parent_run_id=self.parent_run_id, + tags=self.tags, + **kwargs, + ) + class ParentRunManager(RunManager): """Sync Parent Run Manager.""" @@ -525,6 +543,22 @@ async def on_text( **kwargs, ) + async def on_retry( + self, + retry_state: RetryCallState, + **kwargs: Any, + ) -> None: + await _ahandle_event( + self.handlers, + "on_retry", + "ignore_retry", + retry_state, + run_id=self.run_id, + parent_run_id=self.parent_run_id, + tags=self.tags, + **kwargs, + ) + class AsyncParentRunManager(AsyncRunManager): """Async Parent Run Manager.""" diff --git a/libs/langchain/langchain/callbacks/tracers/base.py b/libs/langchain/langchain/callbacks/tracers/base.py index db551277829da..b1244ff412f4f 100644 --- a/libs/langchain/langchain/callbacks/tracers/base.py +++ b/libs/langchain/langchain/callbacks/tracers/base.py @@ -7,6 +7,8 @@ from typing import Any, Dict, List, Optional, Sequence, Union, cast from uuid import UUID +from tenacity import RetryCallState + from langchain.callbacks.base import BaseCallbackHandler from langchain.callbacks.tracers.schemas import Run, RunTypeEnum from langchain.load.dump import dumpd @@ -138,6 +140,41 @@ def on_llm_new_token( }, ) + def on_retry( + self, + retry_state: RetryCallState, + *, + run_id: UUID, + **kwargs: Any, + ) -> None: + if not run_id: + raise TracerException("No run_id provided for on_retry callback.") + run_id_ = str(run_id) + llm_run = self.run_map.get(run_id_) + if llm_run is None: + raise TracerException("No Run found to be traced for on_retry") + retry_d: Dict[str, Any] = { + "slept": retry_state.idle_for, + "attempt": retry_state.attempt_number, + } + if retry_state.outcome is None: + retry_d["outcome"] = "N/A" + elif retry_state.outcome.failed: + retry_d["outcome"] = "failed" + exception = retry_state.outcome.exception() + retry_d["exception"] = str(exception) + retry_d["exception_type"] = exception.__class__.__name__ + else: + retry_d["outcome"] = "success" + retry_d["result"] = str(retry_state.outcome.result()) + llm_run.events.append( + { + "name": "retry", + "time": datetime.utcnow(), + "kwargs": retry_d, + }, + ) + def on_llm_end(self, response: LLMResult, *, run_id: UUID, **kwargs: Any) -> None: """End a trace for an LLM run.""" if not run_id: diff --git a/libs/langchain/langchain/chains/llm.py b/libs/langchain/langchain/chains/llm.py index bb24607a97c27..b1bbfae78a47e 100644 --- a/libs/langchain/langchain/chains/llm.py +++ b/libs/langchain/langchain/chains/llm.py @@ -20,8 +20,8 @@ BaseLLMOutputParser, BasePromptTemplate, LLMResult, - NoOpOutputParser, PromptValue, + StrOutputParser, ) from langchain.schema.language_model import BaseLanguageModel from langchain.utils.input import get_colored_text @@ -50,7 +50,7 @@ def lc_serializable(self) -> bool: llm: BaseLanguageModel """Language model to call.""" output_key: str = "text" #: :meta private: - output_parser: BaseLLMOutputParser = Field(default_factory=NoOpOutputParser) + output_parser: BaseLLMOutputParser = Field(default_factory=StrOutputParser) """Output parser to use. Defaults to one that takes the most likely string but does not change it otherwise.""" diff --git a/libs/langchain/langchain/chat_models/openai.py b/libs/langchain/langchain/chat_models/openai.py index 815e3011bbf8e..8d1137b6fb0b0 100644 --- a/libs/langchain/langchain/chat_models/openai.py +++ b/libs/langchain/langchain/chat_models/openai.py @@ -18,23 +18,14 @@ ) from pydantic import Field, root_validator -from tenacity import ( - before_sleep_log, - retry, - retry_if_exception_type, - stop_after_attempt, - wait_exponential, -) from langchain.callbacks.manager import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, ) from langchain.chat_models.base import BaseChatModel -from langchain.schema import ( - ChatGeneration, - ChatResult, -) +from langchain.llms.base import create_base_retry_decorator +from langchain.schema import ChatGeneration, ChatResult from langchain.schema.messages import ( AIMessage, AIMessageChunk, @@ -70,31 +61,33 @@ def _import_tiktoken() -> Any: return tiktoken -def _create_retry_decorator(llm: ChatOpenAI) -> Callable[[Any], Any]: +def _create_retry_decorator( + llm: ChatOpenAI, + run_manager: Optional[ + Union[AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun] + ] = None, +) -> Callable[[Any], Any]: import openai - min_seconds = 1 - max_seconds = 60 - # Wait 2^x * 1 second between each retry starting with - # 4 seconds, then up to 10 seconds, then 10 seconds afterwards - return retry( - reraise=True, - stop=stop_after_attempt(llm.max_retries), - wait=wait_exponential(multiplier=1, min=min_seconds, max=max_seconds), - retry=( - retry_if_exception_type(openai.error.Timeout) - | retry_if_exception_type(openai.error.APIError) - | retry_if_exception_type(openai.error.APIConnectionError) - | retry_if_exception_type(openai.error.RateLimitError) - | retry_if_exception_type(openai.error.ServiceUnavailableError) - ), - before_sleep=before_sleep_log(logger, logging.WARNING), + errors = [ + openai.error.Timeout, + openai.error.APIError, + openai.error.APIConnectionError, + openai.error.RateLimitError, + openai.error.ServiceUnavailableError, + ] + return create_base_retry_decorator( + error_types=errors, max_retries=llm.max_retries, run_manager=run_manager ) -async def acompletion_with_retry(llm: ChatOpenAI, **kwargs: Any) -> Any: +async def acompletion_with_retry( + llm: ChatOpenAI, + run_manager: Optional[AsyncCallbackManagerForLLMRun] = None, + **kwargs: Any, +) -> Any: """Use tenacity to retry the async completion call.""" - retry_decorator = _create_retry_decorator(llm) + retry_decorator = _create_retry_decorator(llm, run_manager=run_manager) @retry_decorator async def _completion_with_retry(**kwargs: Any) -> Any: @@ -322,9 +315,11 @@ def _default_params(self) -> Dict[str, Any]: **self.model_kwargs, } - def completion_with_retry(self, **kwargs: Any) -> Any: + def completion_with_retry( + self, run_manager: Optional[CallbackManagerForLLMRun] = None, **kwargs: Any + ) -> Any: """Use tenacity to retry the completion call.""" - retry_decorator = _create_retry_decorator(self) + retry_decorator = _create_retry_decorator(self, run_manager=run_manager) @retry_decorator def _completion_with_retry(**kwargs: Any) -> Any: @@ -357,7 +352,9 @@ def _stream( params = {**params, **kwargs, "stream": True} default_chunk_class = AIMessageChunk - for chunk in self.completion_with_retry(messages=message_dicts, **params): + for chunk in self.completion_with_retry( + messages=message_dicts, run_manager=run_manager, **params + ): if len(chunk["choices"]) == 0: continue delta = chunk["choices"][0]["delta"] @@ -388,7 +385,9 @@ def _generate( message_dicts, params = self._create_message_dicts(messages, stop) params = {**params, **kwargs} - response = self.completion_with_retry(messages=message_dicts, **params) + response = self.completion_with_retry( + messages=message_dicts, run_manager=run_manager, **params + ) return self._create_chat_result(response) def _create_message_dicts( @@ -427,7 +426,7 @@ async def _astream( default_chunk_class = AIMessageChunk async for chunk in await acompletion_with_retry( - self, messages=message_dicts, **params + self, messages=message_dicts, run_manager=run_manager, **params ): if len(chunk["choices"]) == 0: continue @@ -459,7 +458,9 @@ async def _agenerate( message_dicts, params = self._create_message_dicts(messages, stop) params = {**params, **kwargs} - response = await acompletion_with_retry(self, messages=message_dicts, **params) + response = await acompletion_with_retry( + self, messages=message_dicts, run_manager=run_manager, **params + ) return self._create_chat_result(response) @property diff --git a/libs/langchain/langchain/document_loaders/__init__.py b/libs/langchain/langchain/document_loaders/__init__.py index 6227d33064c92..bb285c1ef4822 100644 --- a/libs/langchain/langchain/document_loaders/__init__.py +++ b/libs/langchain/langchain/document_loaders/__init__.py @@ -38,6 +38,7 @@ from langchain.document_loaders.directory import DirectoryLoader from langchain.document_loaders.discord import DiscordChatLoader from langchain.document_loaders.docugami import DocugamiLoader +from langchain.document_loaders.dropbox import DropboxLoader from langchain.document_loaders.duckdb_loader import DuckDBLoader from langchain.document_loaders.email import ( OutlookMessageLoader, @@ -194,6 +195,7 @@ "DiscordChatLoader", "DocugamiLoader", "Docx2txtLoader", + "DropboxLoader", "DuckDBLoader", "EmbaasBlobLoader", "EmbaasLoader", diff --git a/libs/langchain/langchain/document_loaders/dropbox.py b/libs/langchain/langchain/document_loaders/dropbox.py new file mode 100644 index 0000000000000..1197ef59c04c7 --- /dev/null +++ b/libs/langchain/langchain/document_loaders/dropbox.py @@ -0,0 +1,172 @@ +"""Loads data from Dropbox.""" + +# Prerequisites: +# 1. Create a Dropbox app. +# 2. Give the app these scope permissions: `files.metadata.read` +# and `files.content.read`. +# 3. Generate access token: https://www.dropbox.com/developers/apps/create. +# 4. `pip install dropbox` (requires `pip install unstructured` for PDF filetype). + + +import os +import tempfile +from pathlib import Path +from typing import Any, Dict, List, Optional + +from pydantic import BaseModel, root_validator + +from langchain.docstore.document import Document +from langchain.document_loaders.base import BaseLoader + + +class DropboxLoader(BaseLoader, BaseModel): + """Loads files from Dropbox. + + In addition to common files such as text and PDF files, it also supports + *Dropbox Paper* files. + """ + + dropbox_access_token: str + """Dropbox access token.""" + dropbox_folder_path: Optional[str] = None + """The folder path to load from.""" + dropbox_file_paths: Optional[List[str]] = None + """The file paths to load from.""" + recursive: bool = False + """Flag to indicate whether to load files recursively from subfolders.""" + + @root_validator + def validate_inputs(cls, values: Dict[str, Any]) -> Dict[str, Any]: + """Validate that either folder_path or file_paths is set, but not both.""" + if ( + values.get("dropbox_folder_path") is not None + and values.get("dropbox_file_paths") is not None + ): + raise ValueError("Cannot specify both folder_path and file_paths") + if values.get("dropbox_folder_path") is None and not values.get( + "dropbox_file_paths" + ): + raise ValueError("Must specify either folder_path or file_paths") + + return values + + def _create_dropbox_client(self) -> Any: + """Create a Dropbox client.""" + try: + from dropbox import Dropbox, exceptions + except ImportError: + raise ImportError("You must run " "`pip install dropbox") + + try: + dbx = Dropbox(self.dropbox_access_token) + dbx.users_get_current_account() + except exceptions.AuthError as ex: + raise ValueError( + "Invalid Dropbox access token. Please verify your token and try again." + ) from ex + return dbx + + def _load_documents_from_folder(self, folder_path: str) -> List[Document]: + """Load documents from a Dropbox folder.""" + dbx = self._create_dropbox_client() + + try: + from dropbox import exceptions + from dropbox.files import FileMetadata + except ImportError: + raise ImportError("You must run " "`pip install dropbox") + + try: + results = dbx.files_list_folder(folder_path, recursive=self.recursive) + except exceptions.ApiError as ex: + raise ValueError( + f"Could not list files in the folder: {folder_path}. " + "Please verify the folder path and try again." + ) from ex + + files = [entry for entry in results.entries if isinstance(entry, FileMetadata)] + documents = [ + doc + for doc in (self._load_file_from_path(file.path_display) for file in files) + if doc is not None + ] + return documents + + def _load_file_from_path(self, file_path: str) -> Optional[Document]: + """Load a file from a Dropbox path.""" + dbx = self._create_dropbox_client() + + try: + from dropbox import exceptions + except ImportError: + raise ImportError("You must run " "`pip install dropbox") + + try: + file_metadata = dbx.files_get_metadata(file_path) + + if file_metadata.is_downloadable: + _, response = dbx.files_download(file_path) + + # Some types such as Paper, need to be exported. + elif file_metadata.export_info: + _, response = dbx.files_export(file_path, "markdown") + + except exceptions.ApiError as ex: + raise ValueError( + f"Could not load file: {file_path}. Please verify the file path" + "and try again." + ) from ex + + try: + text = response.content.decode("utf-8") + except UnicodeDecodeError: + print(f"File {file_path} could not be decoded as text. Skipping.") + + file_extension = os.path.splitext(file_path)[1].lower() + + if file_extension == ".pdf": + from langchain.document_loaders import UnstructuredPDFLoader + + # Download it to a temporary file. + temp_dir = tempfile.TemporaryDirectory() + temp_pdf = Path(temp_dir.name) / "tmp.pdf" + with open(temp_pdf, mode="wb") as f: + f.write(response.content) + + try: + loader = UnstructuredPDFLoader(str(temp_pdf)) + docs = loader.load() + if docs: + return docs[0] + except Exception as pdf_ex: + print(f"Error while trying to parse PDF {file_path}: {pdf_ex}") + return None + + return None + + metadata = { + "source": f"dropbox://{file_path}", + "title": os.path.basename(file_path), + } + return Document(page_content=text, metadata=metadata) + + def _load_documents_from_paths(self) -> List[Document]: + """Load documents from a list of Dropbox file paths.""" + if not self.dropbox_file_paths: + raise ValueError("file_paths must be set") + + return [ + doc + for doc in ( + self._load_file_from_path(file_path) + for file_path in self.dropbox_file_paths + ) + if doc is not None + ] + + def load(self) -> List[Document]: + """Load documents.""" + if self.dropbox_folder_path is not None: + return self._load_documents_from_folder(self.dropbox_folder_path) + else: + return self._load_documents_from_paths() diff --git a/libs/langchain/langchain/llms/base.py b/libs/langchain/langchain/llms/base.py index 10595e83191ea..a40b79de80269 100644 --- a/libs/langchain/langchain/llms/base.py +++ b/libs/langchain/langchain/llms/base.py @@ -2,6 +2,7 @@ from __future__ import annotations import asyncio +import functools import inspect import json import logging @@ -28,6 +29,7 @@ import yaml from pydantic import Field, root_validator, validator from tenacity import ( + RetryCallState, before_sleep_log, retry, retry_base, @@ -66,11 +68,36 @@ def _get_verbosity() -> bool: return langchain.verbose +@functools.lru_cache +def _log_error_once(msg: str) -> None: + """Log an error once.""" + logger.error(msg) + + def create_base_retry_decorator( - error_types: List[Type[BaseException]], max_retries: int = 1 + error_types: List[Type[BaseException]], + max_retries: int = 1, + run_manager: Optional[ + Union[AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun] + ] = None, ) -> Callable[[Any], Any]: """Create a retry decorator for a given LLM and provided list of error types.""" + _logging = before_sleep_log(logger, logging.WARNING) + + def _before_sleep(retry_state: RetryCallState) -> None: + _logging(retry_state) + if run_manager: + if isinstance(run_manager, AsyncCallbackManagerForLLMRun): + coro = run_manager.on_retry(retry_state) + try: + asyncio.run(coro) + except Exception as e: + _log_error_once(f"Error in on_retry: {e}") + else: + run_manager.on_retry(retry_state) + return None + min_seconds = 4 max_seconds = 10 # Wait 2^x * 1 second between each retry starting with @@ -83,7 +110,7 @@ def create_base_retry_decorator( stop=stop_after_attempt(max_retries), wait=wait_exponential(multiplier=1, min=min_seconds, max=max_seconds), retry=retry_instance, - before_sleep=before_sleep_log(logger, logging.WARNING), + before_sleep=_before_sleep, ) diff --git a/libs/langchain/langchain/llms/openai.py b/libs/langchain/langchain/llms/openai.py index 2c664a1c8742a..52741d7f53f0e 100644 --- a/libs/langchain/langchain/llms/openai.py +++ b/libs/langchain/langchain/llms/openai.py @@ -80,7 +80,12 @@ def _streaming_response_template() -> Dict[str, Any]: } -def _create_retry_decorator(llm: Union[BaseOpenAI, OpenAIChat]) -> Callable[[Any], Any]: +def _create_retry_decorator( + llm: Union[BaseOpenAI, OpenAIChat], + run_manager: Optional[ + Union[AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun] + ] = None, +) -> Callable[[Any], Any]: import openai errors = [ @@ -90,12 +95,18 @@ def _create_retry_decorator(llm: Union[BaseOpenAI, OpenAIChat]) -> Callable[[Any openai.error.RateLimitError, openai.error.ServiceUnavailableError, ] - return create_base_retry_decorator(error_types=errors, max_retries=llm.max_retries) + return create_base_retry_decorator( + error_types=errors, max_retries=llm.max_retries, run_manager=run_manager + ) -def completion_with_retry(llm: Union[BaseOpenAI, OpenAIChat], **kwargs: Any) -> Any: +def completion_with_retry( + llm: Union[BaseOpenAI, OpenAIChat], + run_manager: Optional[CallbackManagerForLLMRun] = None, + **kwargs: Any, +) -> Any: """Use tenacity to retry the completion call.""" - retry_decorator = _create_retry_decorator(llm) + retry_decorator = _create_retry_decorator(llm, run_manager=run_manager) @retry_decorator def _completion_with_retry(**kwargs: Any) -> Any: @@ -105,10 +116,12 @@ def _completion_with_retry(**kwargs: Any) -> Any: async def acompletion_with_retry( - llm: Union[BaseOpenAI, OpenAIChat], **kwargs: Any + llm: Union[BaseOpenAI, OpenAIChat], + run_manager: Optional[AsyncCallbackManagerForLLMRun] = None, + **kwargs: Any, ) -> Any: """Use tenacity to retry the async completion call.""" - retry_decorator = _create_retry_decorator(llm) + retry_decorator = _create_retry_decorator(llm, run_manager=run_manager) @retry_decorator async def _completion_with_retry(**kwargs: Any) -> Any: @@ -291,8 +304,10 @@ def _stream( **kwargs: Any, ) -> Iterator[GenerationChunk]: params = {**self._invocation_params, **kwargs, "stream": True} - self.get_sub_prompts(params, [prompt], stop) # this mutate params - for stream_resp in completion_with_retry(self, prompt=prompt, **params): + self.get_sub_prompts(params, [prompt], stop) # this mutates params + for stream_resp in completion_with_retry( + self, prompt=prompt, run_manager=run_manager, **params + ): chunk = _stream_response_to_generation_chunk(stream_resp) yield chunk if run_manager: @@ -314,7 +329,7 @@ async def _astream( params = {**self._invocation_params, **kwargs, "stream": True} self.get_sub_prompts(params, [prompt], stop) # this mutate params async for stream_resp in await acompletion_with_retry( - self, prompt=prompt, **params + self, prompt=prompt, run_manager=run_manager, **params ): chunk = _stream_response_to_generation_chunk(stream_resp) yield chunk @@ -381,7 +396,9 @@ def _generate( } ) else: - response = completion_with_retry(self, prompt=_prompts, **params) + response = completion_with_retry( + self, prompt=_prompts, run_manager=run_manager, **params + ) choices.extend(response["choices"]) update_token_usage(_keys, response, token_usage) return self.create_llm_result(choices, prompts, token_usage) @@ -428,7 +445,9 @@ async def _agenerate( } ) else: - response = await acompletion_with_retry(self, prompt=_prompts, **params) + response = await acompletion_with_retry( + self, prompt=_prompts, run_manager=run_manager, **params + ) choices.extend(response["choices"]) update_token_usage(_keys, response, token_usage) return self.create_llm_result(choices, prompts, token_usage) @@ -818,7 +837,9 @@ def _stream( ) -> Iterator[GenerationChunk]: messages, params = self._get_chat_params([prompt], stop) params = {**params, **kwargs, "stream": True} - for stream_resp in completion_with_retry(self, messages=messages, **params): + for stream_resp in completion_with_retry( + self, messages=messages, run_manager=run_manager, **params + ): token = stream_resp["choices"][0]["delta"].get("content", "") yield GenerationChunk(text=token) if run_manager: @@ -834,7 +855,7 @@ async def _astream( messages, params = self._get_chat_params([prompt], stop) params = {**params, **kwargs, "stream": True} async for stream_resp in await acompletion_with_retry( - self, messages=messages, **params + self, messages=messages, run_manager=run_manager, **params ): token = stream_resp["choices"][0]["delta"].get("content", "") yield GenerationChunk(text=token) @@ -860,7 +881,9 @@ def _generate( messages, params = self._get_chat_params(prompts, stop) params = {**params, **kwargs} - full_response = completion_with_retry(self, messages=messages, **params) + full_response = completion_with_retry( + self, messages=messages, run_manager=run_manager, **params + ) llm_output = { "token_usage": full_response["usage"], "model_name": self.model_name, @@ -891,7 +914,9 @@ async def _agenerate( messages, params = self._get_chat_params(prompts, stop) params = {**params, **kwargs} - full_response = await acompletion_with_retry(self, messages=messages, **params) + full_response = await acompletion_with_retry( + self, messages=messages, run_manager=run_manager, **params + ) llm_output = { "token_usage": full_response["usage"], "model_name": self.model_name, diff --git a/libs/langchain/langchain/prompts/loading.py b/libs/langchain/langchain/prompts/loading.py index 9e2371a4a2c4e..80f3c3ee33b10 100644 --- a/libs/langchain/langchain/prompts/loading.py +++ b/libs/langchain/langchain/prompts/loading.py @@ -10,7 +10,7 @@ from langchain.output_parsers.regex import RegexParser from langchain.prompts.few_shot import FewShotPromptTemplate from langchain.prompts.prompt import PromptTemplate -from langchain.schema import BaseLLMOutputParser, BasePromptTemplate, NoOpOutputParser +from langchain.schema import BaseLLMOutputParser, BasePromptTemplate, StrOutputParser from langchain.utilities.loading import try_load_from_hub URL_BASE = "https://raw.githubusercontent.com/hwchase17/langchain-hub/master/prompts/" @@ -80,7 +80,7 @@ def _load_output_parser(config: dict) -> dict: if output_parser_type == "regex_parser": output_parser: BaseLLMOutputParser = RegexParser(**_config) elif output_parser_type == "default": - output_parser = NoOpOutputParser(**_config) + output_parser = StrOutputParser(**_config) else: raise ValueError(f"Unsupported output parser {output_parser_type}") config["output_parser"] = output_parser diff --git a/libs/langchain/langchain/schema/__init__.py b/libs/langchain/langchain/schema/__init__.py index 818ff4113d787..e4235c85f7a8d 100644 --- a/libs/langchain/langchain/schema/__init__.py +++ b/libs/langchain/langchain/schema/__init__.py @@ -24,8 +24,8 @@ from langchain.schema.output_parser import ( BaseLLMOutputParser, BaseOutputParser, - NoOpOutputParser, OutputParserException, + StrOutputParser, ) from langchain.schema.prompt import PromptValue from langchain.schema.prompt_template import BasePromptTemplate, format_document @@ -62,7 +62,7 @@ "RUN_KEY", "Memory", "OutputParserException", - "NoOpOutputParser", + "StrOutputParser", "BaseOutputParser", "BaseLLMOutputParser", "BasePromptTemplate", diff --git a/libs/langchain/langchain/schema/output_parser.py b/libs/langchain/langchain/schema/output_parser.py index 2bc1cd5d72d1c..3215e1ff54d30 100644 --- a/libs/langchain/langchain/schema/output_parser.py +++ b/libs/langchain/langchain/schema/output_parser.py @@ -137,8 +137,8 @@ def dict(self, **kwargs: Any) -> Dict: return output_parser_dict -class NoOpOutputParser(BaseOutputParser[str]): - """'No operation' OutputParser that returns the text as is.""" +class StrOutputParser(BaseOutputParser[str]): + """OutputParser that parses LLMResult into the top likely string..""" @property def lc_serializable(self) -> bool: @@ -155,6 +155,10 @@ def parse(self, text: str) -> str: return text +# TODO: Deprecate +NoOpOutputParser = StrOutputParser + + class OutputParserException(ValueError): """Exception that output parsers should raise to signify a parsing error. diff --git a/libs/langchain/langchain/schema/runnable.py b/libs/langchain/langchain/schema/runnable.py index f04835297066e..19a3be143fb41 100644 --- a/libs/langchain/langchain/schema/runnable.py +++ b/libs/langchain/langchain/schema/runnable.py @@ -12,6 +12,7 @@ Generic, Iterator, List, + Mapping, Optional, TypedDict, TypeVar, @@ -71,7 +72,7 @@ def __or__( self, other: Union[ Runnable[Any, Other], - Dict[str, Union[Runnable[Any, Other], Callable[[Any], Other]]], + Mapping[str, Union[Runnable[Any, Other], Callable[[Any], Other]]], ], ) -> RunnableSequence[Input, Other]: return RunnableSequence(first=self, last=_coerce_to_runnable(other)) @@ -80,7 +81,7 @@ def __ror__( self, other: Union[ Runnable[Other, Any], - Dict[str, Union[Runnable[Other, Any], Callable[[Other], Any]]], + Mapping[str, Union[Runnable[Other, Any], Callable[[Other], Any]]], ], ) -> RunnableSequence[Other, Output]: return RunnableSequence(first=_coerce_to_runnable(other), last=self) @@ -130,6 +131,12 @@ async def astream( ) -> AsyncIterator[Output]: yield await self.ainvoke(input, config) + def bind(self, **kwargs: Any) -> Runnable[Input, Output]: + """ + Bind arguments to a Runnable, returning a new Runnable. + """ + return RunnableBinding(bound=self, kwargs=kwargs) + def _get_config_list( self, config: Optional[Union[RunnableConfig, List[RunnableConfig]]], length: int ) -> List[RunnableConfig]: @@ -194,7 +201,7 @@ def __or__( self, other: Union[ Runnable[Any, Other], - Dict[str, Union[Runnable[Any, Other], Callable[[Any], Other]]], + Mapping[str, Union[Runnable[Any, Other], Callable[[Any], Other]]], ], ) -> RunnableSequence[Input, Other]: if isinstance(other, RunnableSequence): @@ -214,7 +221,7 @@ def __ror__( self, other: Union[ Runnable[Other, Any], - Dict[str, Union[Runnable[Other, Any], Callable[[Other], Any]]], + Mapping[str, Union[Runnable[Other, Any], Callable[[Other], Any]]], ], ) -> RunnableSequence[Other, Output]: if isinstance(other, RunnableSequence): @@ -551,7 +558,22 @@ async def astream( class RunnableMap(Serializable, Runnable[Input, Dict[str, Any]]): - steps: Dict[str, Runnable[Input, Any]] + steps: Mapping[str, Runnable[Input, Any]] + + def __init__( + self, + steps: Mapping[ + str, + Union[ + Runnable[Input, Any], + Callable[[Input], Any], + Mapping[str, Union[Runnable[Input, Any], Callable[[Input], Any]]], + ], + ], + ) -> None: + super().__init__( + steps={key: _coerce_to_runnable(r) for key, r in steps.items()} + ) @property def lc_serializable(self) -> bool: @@ -582,7 +604,7 @@ def invoke( # gather results from all steps try: # copy to avoid issues from the caller mutating the steps during invoke() - steps = self.steps.copy() + steps = dict(self.steps) with ThreadPoolExecutor() as executor: futures = [ executor.submit( @@ -626,7 +648,7 @@ async def ainvoke( # gather results from all steps try: # copy to avoid issues from the caller mutating the steps during invoke() - steps = self.steps.copy() + steps = dict(self.steps) results = await asyncio.gather( *( step.ainvoke( @@ -676,6 +698,60 @@ def invoke(self, input: Input, config: Optional[RunnableConfig] = None) -> Input return self._call_with_config(lambda x: x, input, config) +class RunnableBinding(Serializable, Runnable[Input, Output]): + bound: Runnable[Input, Output] + + kwargs: Mapping[str, Any] + + class Config: + arbitrary_types_allowed = True + + @property + def lc_serializable(self) -> bool: + return True + + def invoke(self, input: Input, config: Optional[RunnableConfig] = None) -> Output: + return self.bound.invoke(input, config, **self.kwargs) + + async def ainvoke( + self, input: Input, config: Optional[RunnableConfig] = None + ) -> Output: + return await self.bound.ainvoke(input, config, **self.kwargs) + + def batch( + self, + inputs: List[Input], + config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, + *, + max_concurrency: Optional[int] = None, + ) -> List[Output]: + return self.bound.batch( + inputs, config, max_concurrency=max_concurrency, **self.kwargs + ) + + async def abatch( + self, + inputs: List[Input], + config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, + *, + max_concurrency: Optional[int] = None, + ) -> List[Output]: + return await self.bound.abatch( + inputs, config, max_concurrency=max_concurrency, **self.kwargs + ) + + def stream( + self, input: Input, config: Optional[RunnableConfig] = None + ) -> Iterator[Output]: + yield from self.bound.stream(input, config, **self.kwargs) + + async def astream( + self, input: Input, config: Optional[RunnableConfig] = None + ) -> AsyncIterator[Output]: + async for item in self.bound.astream(input, config, **self.kwargs): + yield item + + def _patch_config( config: RunnableConfig, callback_manager: BaseCallbackManager ) -> RunnableConfig: @@ -688,7 +764,7 @@ def _coerce_to_runnable( thing: Union[ Runnable[Input, Output], Callable[[Input], Output], - Dict[str, Union[Runnable[Input, Output], Callable[[Input], Output]]], + Mapping[str, Union[Runnable[Input, Output], Callable[[Input], Output]]], ] ) -> Runnable[Input, Output]: if isinstance(thing, Runnable): diff --git a/libs/langchain/pyproject.toml b/libs/langchain/pyproject.toml index c10f54d4cc92d..57bb94bc29427 100644 --- a/libs/langchain/pyproject.toml +++ b/libs/langchain/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain" -version = "0.0.244" +version = "0.0.245" description = "Building applications with LLMs through composability" authors = [] license = "MIT" diff --git a/libs/langchain/tests/integration_tests/llms/test_openai.py b/libs/langchain/tests/integration_tests/llms/test_openai.py index 0844faa6aa3a5..6b584ae154b82 100644 --- a/libs/langchain/tests/integration_tests/llms/test_openai.py +++ b/libs/langchain/tests/integration_tests/llms/test_openai.py @@ -1,7 +1,7 @@ """Test OpenAI API wrapper.""" - from pathlib import Path -from typing import Generator +from typing import Any, Generator +from unittest.mock import MagicMock, patch import pytest @@ -10,7 +10,10 @@ from langchain.llms.loading import load_llm from langchain.llms.openai import OpenAI, OpenAIChat from langchain.schema import LLMResult -from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler +from tests.unit_tests.callbacks.fake_callback_handler import ( + FakeAsyncCallbackHandler, + FakeCallbackHandler, +) def test_openai_call() -> None: @@ -334,3 +337,77 @@ def test_chat_openai_get_num_tokens(model: str) -> None: """Test get_tokens.""" llm = ChatOpenAI(model=model) assert llm.get_num_tokens("表情符号是\n🦜🔗") == _EXPECTED_NUM_TOKENS[model] + + +@pytest.fixture +def mock_completion() -> dict: + return { + "id": "cmpl-3evkmQda5Hu7fcZavknQda3SQ", + "object": "text_completion", + "created": 1689989000, + "model": "text-davinci-003", + "choices": [ + {"text": "Bar Baz", "index": 0, "logprobs": None, "finish_reason": "length"} + ], + "usage": {"prompt_tokens": 1, "completion_tokens": 2, "total_tokens": 3}, + } + + +@pytest.mark.requires("openai") +def test_openai_retries(mock_completion: dict) -> None: + llm = OpenAI() + mock_client = MagicMock() + completed = False + raised = False + import openai + + def raise_once(*args: Any, **kwargs: Any) -> Any: + nonlocal completed, raised + if not raised: + raised = True + raise openai.error.APIError + completed = True + return mock_completion + + mock_client.create = raise_once + callback_handler = FakeCallbackHandler() + with patch.object( + llm, + "client", + mock_client, + ): + res = llm.predict("bar", callbacks=[callback_handler]) + assert res == "Bar Baz" + assert completed + assert raised + assert callback_handler.retries == 1 + + +@pytest.mark.requires("openai") +async def test_openai_async_retries(mock_completion: dict) -> None: + llm = OpenAI() + mock_client = MagicMock() + completed = False + raised = False + import openai + + def raise_once(*args: Any, **kwargs: Any) -> Any: + nonlocal completed, raised + if not raised: + raised = True + raise openai.error.APIError + completed = True + return mock_completion + + mock_client.create = raise_once + callback_handler = FakeAsyncCallbackHandler() + with patch.object( + llm, + "client", + mock_client, + ): + res = llm.apredict("bar", callbacks=[callback_handler]) + assert res == "Bar Baz" + assert completed + assert raised + assert callback_handler.retries == 1 diff --git a/libs/langchain/tests/unit_tests/agents/test_mrkl_output_parser.py b/libs/langchain/tests/unit_tests/agents/test_mrkl_output_parser.py new file mode 100644 index 0000000000000..08a7f128a4f01 --- /dev/null +++ b/libs/langchain/tests/unit_tests/agents/test_mrkl_output_parser.py @@ -0,0 +1,66 @@ +import pytest + +from langchain.agents.mrkl.output_parser import ( + MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE, + MISSING_ACTION_INPUT_AFTER_ACTION_ERROR_MESSAGE, + MRKLOutputParser, +) +from langchain.schema import AgentAction, AgentFinish, OutputParserException + +mrkl_output_parser = MRKLOutputParser() + + +def test_valid_action_and_action_input_parse() -> None: + llm_output = """I can use the `foo` tool to achieve the goal. + Action: foo + Action Input: bar""" + + agent_action: AgentAction = mrkl_output_parser.parse(llm_output) # type: ignore + assert agent_action.tool == "foo" + assert agent_action.tool_input == "bar" + + +def test_valid_final_answer_parse() -> None: + llm_output = """Final Answer: The best pizza to eat is margaritta """ + + agent_finish: AgentFinish = mrkl_output_parser.parse(llm_output) # type: ignore + assert ( + agent_finish.return_values.get("output") + == "The best pizza to eat is margaritta" + ) + + +def test_missing_action() -> None: + llm_output = """I can use the `foo` tool to achieve the goal.""" + + with pytest.raises(OutputParserException) as exception_info: + mrkl_output_parser.parse(llm_output) + assert ( + exception_info.value.observation == MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE + ) + + +def test_missing_action_input() -> None: + llm_output = """I can use the `foo` tool to achieve the goal. + Action: foo""" + + with pytest.raises(OutputParserException) as exception_info: + mrkl_output_parser.parse(llm_output) + assert ( + exception_info.value.observation + == MISSING_ACTION_INPUT_AFTER_ACTION_ERROR_MESSAGE + ) + + +def test_final_answer_and_parsable_action() -> None: + llm_output = """Final Answer: The best pizza to eat is margaritta + I can use the `foo` tool to achieve the goal. + Action: foo + Action Input: bar + """ + with pytest.raises(OutputParserException) as exception_info: + mrkl_output_parser.parse(llm_output) + assert ( + "Parsing LLM output produced both a final answer and a parse-able action" + in exception_info.value.args[0] + ) diff --git a/libs/langchain/tests/unit_tests/callbacks/fake_callback_handler.py b/libs/langchain/tests/unit_tests/callbacks/fake_callback_handler.py index a5e3d3ef692c2..87b56a9bff200 100644 --- a/libs/langchain/tests/unit_tests/callbacks/fake_callback_handler.py +++ b/libs/langchain/tests/unit_tests/callbacks/fake_callback_handler.py @@ -39,6 +39,7 @@ class BaseFakeCallbackHandler(BaseModel): retriever_starts: int = 0 retriever_ends: int = 0 retriever_errors: int = 0 + retries: int = 0 class BaseFakeCallbackHandlerMixin(BaseFakeCallbackHandler): @@ -58,8 +59,10 @@ def on_llm_error_common(self) -> None: def on_llm_new_token_common(self) -> None: self.llm_streams += 1 + def on_retry_common(self) -> None: + self.retries += 1 + def on_chain_start_common(self) -> None: - ("CHAIN START") self.chain_starts += 1 self.starts += 1 @@ -82,7 +85,6 @@ def on_tool_error_common(self) -> None: self.errors += 1 def on_agent_action_common(self) -> None: - print("AGENT ACTION") self.agent_actions += 1 self.starts += 1 @@ -91,7 +93,6 @@ def on_agent_finish_common(self) -> None: self.ends += 1 def on_chat_model_start_common(self) -> None: - print("STARTING CHAT MODEL") self.chat_model_starts += 1 self.starts += 1 @@ -162,6 +163,13 @@ def on_llm_error( ) -> Any: self.on_llm_error_common() + def on_retry( + self, + *args: Any, + **kwargs: Any, + ) -> Any: + self.on_retry_common() + def on_chain_start( self, *args: Any, diff --git a/libs/langchain/tests/unit_tests/chat_models/test_openai.py b/libs/langchain/tests/unit_tests/chat_models/test_openai.py index ad05133f1874f..7719358d725a7 100644 --- a/libs/langchain/tests/unit_tests/chat_models/test_openai.py +++ b/libs/langchain/tests/unit_tests/chat_models/test_openai.py @@ -1,8 +1,12 @@ """Test OpenAI Chat API wrapper.""" - import json +from typing import Any +from unittest.mock import MagicMock, patch + +import pytest from langchain.chat_models.openai import ( + ChatOpenAI, _convert_dict_to_message, ) from langchain.schema.messages import FunctionMessage @@ -21,3 +25,67 @@ def test_function_message_dict_to_function_message() -> None: assert isinstance(result, FunctionMessage) assert result.name == name assert result.content == content + + +@pytest.fixture +def mock_completion() -> dict: + return { + "id": "chatcmpl-7fcZavknQda3SQ", + "object": "chat.completion", + "created": 1689989000, + "model": "gpt-3.5-turbo-0613", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Bar Baz", + }, + "finish_reason": "stop", + } + ], + } + + +@pytest.mark.requires("openai") +def test_openai_predict(mock_completion: dict) -> None: + llm = ChatOpenAI() + mock_client = MagicMock() + completed = False + + def mock_create(*args: Any, **kwargs: Any) -> Any: + nonlocal completed + completed = True + return mock_completion + + mock_client.create = mock_create + with patch.object( + llm, + "client", + mock_client, + ): + res = llm.predict("bar") + assert res == "Bar Baz" + assert completed + + +@pytest.mark.requires("openai") +async def test_openai_apredict(mock_completion: dict) -> None: + llm = ChatOpenAI() + mock_client = MagicMock() + completed = False + + def mock_create(*args: Any, **kwargs: Any) -> Any: + nonlocal completed + completed = True + return mock_completion + + mock_client.create = mock_create + with patch.object( + llm, + "client", + mock_client, + ): + res = llm.predict("bar") + assert res == "Bar Baz" + assert completed diff --git a/libs/langchain/tests/unit_tests/llms/test_openai.py b/libs/langchain/tests/unit_tests/llms/test_openai.py index ef311ea878846..cc0fc74c1f7fb 100644 --- a/libs/langchain/tests/unit_tests/llms/test_openai.py +++ b/libs/langchain/tests/unit_tests/llms/test_openai.py @@ -1,4 +1,6 @@ import os +from typing import Any +from unittest.mock import MagicMock, patch import pytest @@ -26,3 +28,61 @@ def test_openai_incorrect_field() -> None: with pytest.warns(match="not default parameter"): llm = OpenAI(foo="bar") assert llm.model_kwargs == {"foo": "bar"} + + +@pytest.fixture +def mock_completion() -> dict: + return { + "id": "cmpl-3evkmQda5Hu7fcZavknQda3SQ", + "object": "text_completion", + "created": 1689989000, + "model": "text-davinci-003", + "choices": [ + {"text": "Bar Baz", "index": 0, "logprobs": None, "finish_reason": "length"} + ], + "usage": {"prompt_tokens": 1, "completion_tokens": 2, "total_tokens": 3}, + } + + +@pytest.mark.requires("openai") +def test_openai_calls(mock_completion: dict) -> None: + llm = OpenAI() + mock_client = MagicMock() + completed = False + + def raise_once(*args: Any, **kwargs: Any) -> Any: + nonlocal completed + completed = True + return mock_completion + + mock_client.create = raise_once + with patch.object( + llm, + "client", + mock_client, + ): + res = llm.predict("bar") + assert res == "Bar Baz" + assert completed + + +@pytest.mark.requires("openai") +async def test_openai_async_retries(mock_completion: dict) -> None: + llm = OpenAI() + mock_client = MagicMock() + completed = False + + def raise_once(*args: Any, **kwargs: Any) -> Any: + nonlocal completed + completed = True + return mock_completion + + mock_client.create = raise_once + with patch.object( + llm, + "client", + mock_client, + ): + res = llm.apredict("bar") + assert res == "Bar Baz" + assert completed diff --git a/libs/langchain/tests/unit_tests/schema/__snapshots__/test_runnable.ambr b/libs/langchain/tests/unit_tests/schema/__snapshots__/test_runnable.ambr index fc93e69297f2d..ec985ee9d6e31 100644 --- a/libs/langchain/tests/unit_tests/schema/__snapshots__/test_runnable.ambr +++ b/libs/langchain/tests/unit_tests/schema/__snapshots__/test_runnable.ambr @@ -666,3 +666,167 @@ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string'}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string'}}}}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableMap'], 'kwargs': {'steps': {'chat': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'chat_models', 'fake', 'FakeListChatModel']}, 'llm': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'fake', 'FakeListLLM']}}}}}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'question': 'What is your name?'}, outputs={'chat': AIMessage(content="i'm a chatbot", additional_kwargs={}, example=False), 'llm': "i'm a textbot"}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=1, child_execution_order=6, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string'}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string'}}}}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'question': 'What is your name?'}, outputs={'output': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=[], execution_order=2, child_execution_order=2, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='RunnableLambda', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'input': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, outputs={'output': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=[], execution_order=3, child_execution_order=3, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='RunnableMap', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableMap'], 'kwargs': {'steps': {'chat': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'chat_models', 'fake', 'FakeListChatModel']}, 'llm': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'fake', 'FakeListLLM']}}}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'input': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, outputs={'chat': AIMessage(content="i'm a chatbot", additional_kwargs={}, example=False), 'llm': "i'm a textbot"}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=[], execution_order=4, child_execution_order=6, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={'invocation_params': {'responses': ["i'm a chatbot"], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'chat_models', 'fake', 'FakeListChatModel']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': "i'm a chatbot", 'generation_info': None, 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': "i'm a chatbot"}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=[], execution_order=5, child_execution_order=5, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={'invocation_params': {'responses': ["i'm a textbot"], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'fake', 'FakeListLLM']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': "i'm a textbot", 'generation_info': None}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=[], execution_order=6, child_execution_order=6, child_runs=[])])]), ]) # --- +# name: test_seq_prompt_map + ''' + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableSequence" + ], + "kwargs": { + "first": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "chat", + "ChatPromptTemplate" + ], + "kwargs": { + "messages": [ + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "chat", + "SystemMessagePromptTemplate" + ], + "kwargs": { + "prompt": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "prompt", + "PromptTemplate" + ], + "kwargs": { + "input_variables": [], + "template": "You are a nice assistant.", + "template_format": "f-string" + } + } + } + }, + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "chat", + "HumanMessagePromptTemplate" + ], + "kwargs": { + "prompt": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "prompt", + "PromptTemplate" + ], + "kwargs": { + "input_variables": [ + "question" + ], + "template": "{question}", + "template_format": "f-string" + } + } + } + } + ] + } + }, + "middle": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableLambda" + ] + } + ], + "last": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableMap" + ], + "kwargs": { + "steps": { + "chat": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableBinding" + ], + "kwargs": { + "bound": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain", + "chat_models", + "fake", + "FakeListChatModel" + ] + }, + "kwargs": { + "stop": [ + "Thought:" + ] + } + } + }, + "llm": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain", + "llms", + "fake", + "FakeListLLM" + ] + }, + "passthrough": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableLambda" + ] + } + } + } + } + } + } + ''' +# --- +# name: test_seq_prompt_map.1 + list([ + Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string'}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string'}}}}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableMap'], 'kwargs': {'steps': {'chat': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableBinding'], 'kwargs': {'bound': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'chat_models', 'fake', 'FakeListChatModel']}, 'kwargs': {'stop': ['Thought:']}}}, 'llm': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'fake', 'FakeListLLM']}, 'passthrough': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}}}}}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'question': 'What is your name?'}, outputs={'chat': AIMessage(content="i'm a chatbot", additional_kwargs={}, example=False), 'llm': "i'm a textbot", 'passthrough': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=1, child_execution_order=7, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string'}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string'}}}}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'question': 'What is your name?'}, outputs={'output': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=[], execution_order=2, child_execution_order=2, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='RunnableLambda', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'input': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, outputs={'output': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=[], execution_order=3, child_execution_order=3, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='RunnableMap', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableMap'], 'kwargs': {'steps': {'chat': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableBinding'], 'kwargs': {'bound': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'chat_models', 'fake', 'FakeListChatModel']}, 'kwargs': {'stop': ['Thought:']}}}, 'llm': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'fake', 'FakeListLLM']}, 'passthrough': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}}}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'input': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, outputs={'chat': AIMessage(content="i'm a chatbot", additional_kwargs={}, example=False), 'llm': "i'm a textbot", 'passthrough': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=[], execution_order=4, child_execution_order=7, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={'invocation_params': {'responses': ["i'm a chatbot"], '_type': 'fake-list-chat-model', 'stop': ['Thought:']}, 'options': {'stop': ['Thought:']}}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'chat_models', 'fake', 'FakeListChatModel']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': "i'm a chatbot", 'generation_info': None, 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': "i'm a chatbot"}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=[], execution_order=5, child_execution_order=5, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={'invocation_params': {'responses': ["i'm a textbot"], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'llms', 'fake', 'FakeListLLM']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': "i'm a textbot", 'generation_info': None}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=[], execution_order=6, child_execution_order=6, child_runs=[]), Run(id=UUID('00000000-0000-4000-8000-000000000006'), name='RunnableLambda', start_time=FakeDatetime(2023, 1, 1, 0, 0), run_type=, end_time=FakeDatetime(2023, 1, 1, 0, 0), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain', 'schema', 'runnable', 'RunnableLambda']}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0)}], inputs={'input': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, outputs={'output': ChatPromptValue(messages=[SystemMessage(content='You are a nice assistant.', additional_kwargs={}), HumanMessage(content='What is your name?', additional_kwargs={}, example=False)])}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=[], execution_order=7, child_execution_order=7, child_runs=[])])]), + ]) +# --- diff --git a/libs/langchain/tests/unit_tests/schema/test_runnable.py b/libs/langchain/tests/unit_tests/schema/test_runnable.py index 83881a6bdf7e4..23fda63f45eda 100644 --- a/libs/langchain/tests/unit_tests/schema/test_runnable.py +++ b/libs/langchain/tests/unit_tests/schema/test_runnable.py @@ -508,7 +508,7 @@ def test_seq_prompt_dict( chain = ( prompt | passthrough - | { # type: ignore + | { "chat": chat, "llm": llm, } @@ -545,3 +545,67 @@ def test_seq_prompt_dict( ] ) assert tracer.runs == snapshot + + +@freeze_time("2023-01-01") +def test_seq_prompt_map( + mocker: MockerFixture, snapshot: SnapshotAssertion, fixed_uuids: None +) -> None: + passthrough = mocker.Mock(side_effect=lambda x: x) + + prompt = ( + SystemMessagePromptTemplate.from_template("You are a nice assistant.") + + "{question}" + ) + + chat = FakeListChatModel(responses=["i'm a chatbot"]) + + llm = FakeListLLM(responses=["i'm a textbot"]) + + chain = ( + prompt + | passthrough + | { + "chat": chat.bind(stop=["Thought:"]), + "llm": llm, + "passthrough": passthrough, + } + ) + + assert isinstance(chain, RunnableSequence) + assert chain.first == prompt + assert chain.middle == [RunnableLambda(passthrough)] + assert isinstance(chain.last, RunnableMap) + assert dumps(chain, pretty=True) == snapshot + + # Test invoke + prompt_spy = mocker.spy(prompt.__class__, "invoke") + chat_spy = mocker.spy(chat.__class__, "invoke") + llm_spy = mocker.spy(llm.__class__, "invoke") + tracer = FakeTracer() + assert chain.invoke( + {"question": "What is your name?"}, dict(callbacks=[tracer]) + ) == { + "chat": AIMessage(content="i'm a chatbot"), + "llm": "i'm a textbot", + "passthrough": ChatPromptValue( + messages=[ + SystemMessage(content="You are a nice assistant."), + HumanMessage(content="What is your name?"), + ] + ), + } + assert prompt_spy.call_args.args[1] == {"question": "What is your name?"} + assert chat_spy.call_args.args[1] == ChatPromptValue( + messages=[ + SystemMessage(content="You are a nice assistant."), + HumanMessage(content="What is your name?"), + ] + ) + assert llm_spy.call_args.args[1] == ChatPromptValue( + messages=[ + SystemMessage(content="You are a nice assistant."), + HumanMessage(content="What is your name?"), + ] + ) + assert tracer.runs == snapshot