# Table of Contents - [Introduction | πŸ¦œοΈπŸ”— LangChain](#introduction-langchain) - [Providers | πŸ¦œοΈπŸ”— LangChain](#providers-langchain) - [LangChain Python API Reference β€” πŸ¦œπŸ”— LangChain documentation](#langchain-python-api-reference-langchain-documentation) - [Welcome Contributors | πŸ¦œοΈπŸ”— LangChain](#welcome-contributors-langchain) - [People | πŸ¦œοΈπŸ”— LangChain](#people-langchain) - [Error reference | πŸ¦œοΈπŸ”— LangChain](#error-reference-langchain) - [Introduction | πŸ¦œοΈπŸ”— LangChain](#introduction-langchain) - [Tutorials | πŸ¦œοΈπŸ”— LangChain](#tutorials-langchain) - [Introduction | πŸ¦œοΈπŸ”— LangChain](#introduction-langchain) - [LangChain Python API Reference β€” πŸ¦œπŸ”— LangChain documentation](#langchain-python-api-reference-langchain-documentation) - [Build a simple LLM application with chat models and prompt templates | πŸ¦œοΈπŸ”— LangChain](#build-a-simple-llm-application-with-chat-models-and-prompt-templates-langchain) - [Build a Question Answering application over a Graph Database | πŸ¦œοΈπŸ”— LangChain](#build-a-question-answering-application-over-a-graph-database-langchain) - [langchain-core: 0.3.28 β€” πŸ¦œπŸ”— LangChain documentation](#langchain-core-0-3-28-langchain-documentation) - [Build a Chatbot | πŸ¦œοΈπŸ”— LangChain](#build-a-chatbot-langchain) - [Anthropic | πŸ¦œοΈπŸ”— LangChain](#anthropic-langchain) - [langchain: 0.3.13 β€” πŸ¦œπŸ”— LangChain documentation](#langchain-0-3-13-langchain-documentation) - [Tutorials | πŸ¦œοΈπŸ”— LangChain](#tutorials-langchain) - [Build a Retrieval Augmented Generation (RAG) App: Part 2 | πŸ¦œοΈπŸ”— LangChain](#build-a-retrieval-augmented-generation-rag-app-part-2-langchain) - [langchain-text-splitters: 0.3.4 β€” πŸ¦œπŸ”— LangChain documentation](#langchain-text-splitters-0-3-4-langchain-documentation) - [Make your first docs PR | πŸ¦œοΈπŸ”— LangChain](#make-your-first-docs-pr-langchain) - [Build an Extraction Chain | πŸ¦œοΈπŸ”— LangChain](#build-an-extraction-chain-langchain) - [AWS | πŸ¦œοΈπŸ”— LangChain](#aws-langchain) - [Google | πŸ¦œοΈπŸ”— LangChain](#google-langchain) - [Build an Agent | πŸ¦œοΈπŸ”— LangChain](#build-an-agent-langchain) - [Hugging Face | πŸ¦œοΈπŸ”— LangChain](#hugging-face-langchain) - [langchain-experimental: 0.3.4 β€” πŸ¦œπŸ”— LangChain documentation](#langchain-experimental-0-3-4-langchain-documentation) - [How-to Guides | πŸ¦œοΈπŸ”— LangChain](#how-to-guides-langchain) - [Tagging | πŸ¦œοΈπŸ”— LangChain](#tagging-langchain) --- # Introduction | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/introduction.mdx) **LangChain** is a framework for developing applications powered by large language models (LLMs). LangChain simplifies every stage of the LLM application lifecycle: * **Development**: Build your applications using LangChain's open-source [components](/docs/concepts/) and [third-party integrations](/docs/integrations/providers/) . Use [LangGraph](/docs/concepts/architecture/#langgraph) to build stateful agents with first-class streaming and human-in-the-loop support. * **Productionization**: Use [LangSmith](https://docs.smith.langchain.com/) to inspect, monitor and evaluate your applications, so that you can continuously optimize and deploy with confidence. * **Deployment**: Turn your LangGraph applications into production-ready APIs and Assistants with [LangGraph Platform](https://langchain-ai.github.io/langgraph/cloud/) . ![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](/svg/langchain_stack_112024.svg "LangChain Framework Overview")![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](/svg/langchain_stack_112024_dark.svg "LangChain Framework Overview") LangChain implements a standard interface for large language models and related technologies, such as embedding models and vector stores, and integrates with hundreds of providers. See the [integrations](/docs/integrations/providers/) page for more. Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAImodel = ChatOpenAI(model="gpt-4o-mini") model.invoke("Hello, world!") note These docs focus on the Python LangChain library. [Head here](https://js.langchain.com) for docs on the JavaScript LangChain library. Architecture[​](#architecture "Direct link to Architecture") ------------------------------------------------------------- The LangChain framework consists of multiple open-source libraries. Read more in the [Architecture](/docs/concepts/architecture/) page. * **`langchain-core`**: Base abstractions for chat models and other components. * **Integration packages** (e.g. `langchain-openai`, `langchain-anthropic`, etc.): Important integrations have been split into lightweight packages that are co-maintained by the LangChain team and the integration developers. * **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. * **`langchain-community`**: Third-party integrations that are community maintained. * **`langgraph`**: Orchestration framework for combining LangChain components into production-ready applications with persistence, streaming, and other key features. See [LangGraph documentation](https://langchain-ai.github.io/langgraph/) . Guides[​](#guides "Direct link to Guides") ------------------------------------------- ### [Tutorials](/docs/tutorials/) [​](#tutorials "Direct link to tutorials") If you're looking to build something specific or are more of a hands-on learner, check out our [tutorials section](/docs/tutorials/) . This is the best place to get started. These are the best ones to get started with: * [Build a Simple LLM Application](/docs/tutorials/llm_chain/) * [Build a Chatbot](/docs/tutorials/chatbot/) * [Build an Agent](/docs/tutorials/agents/) * [Introduction to LangGraph](https://langchain-ai.github.io/langgraph/tutorials/introduction/) Explore the full list of LangChain tutorials [here](/docs/tutorials/) , and check out other [LangGraph tutorials here](https://langchain-ai.github.io/langgraph/tutorials/) . To learn more about LangGraph, check out our first LangChain Academy course, _Introduction to LangGraph_, available [here](https://academy.langchain.com/courses/intro-to-langgraph) . ### [How-to guides](/docs/how_to/) [​](#how-to-guides "Direct link to how-to-guides") [Here](/docs/how_to/) you’ll find short answers to β€œHow do I….?” types of questions. These how-to guides don’t cover topics in depth – you’ll find that material in the [Tutorials](/docs/tutorials/) and the [API Reference](https://python.langchain.com/api_reference/) . However, these guides will help you quickly accomplish common tasks using [chat models](/docs/how_to/#chat-models) , [vector stores](/docs/how_to/#vector-stores) , and other common LangChain components. Check out [LangGraph-specific how-tos here](https://langchain-ai.github.io/langgraph/how-tos/) . ### [Conceptual guide](/docs/concepts/) [​](#conceptual-guide "Direct link to conceptual-guide") Introductions to all the key parts of LangChain you’ll need to know! [Here](/docs/concepts/) you'll find high level explanations of all LangChain concepts. For a deeper dive into LangGraph concepts, check out [this page](https://langchain-ai.github.io/langgraph/concepts/) . ### [Integrations](/docs/integrations/providers/) [​](#integrations "Direct link to integrations") LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. If you're looking to get up and running quickly with [chat models](/docs/integrations/chat/) , [vector stores](/docs/integrations/vectorstores/) , or other LangChain components from a specific provider, check out our growing list of [integrations](/docs/integrations/providers/) . ### [API reference](https://python.langchain.com/api_reference/) [​](#api-reference "Direct link to api-reference") Head to the reference section for full documentation of all classes and methods in the LangChain Python packages. Ecosystem[​](#ecosystem "Direct link to Ecosystem") ---------------------------------------------------- ### [πŸ¦œπŸ› οΈ LangSmith](https://docs.smith.langchain.com) [​](#️-langsmith "Direct link to ️-langsmith") Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production. ### [πŸ¦œπŸ•ΈοΈ LangGraph](https://langchain-ai.github.io/langgraph) [​](#️-langgraph "Direct link to ️-langgraph") Build stateful, multi-actor applications with LLMs. Integrates smoothly with LangChain, but can be used without it. Additional resources[​](#additional-resources "Direct link to Additional resources") ------------------------------------------------------------------------------------- ### [Versions](/docs/versions/v0_3/) [​](#versions "Direct link to versions") See what changed in v0.3, learn how to migrate legacy code, read up on our versioning policies, and more. ### [Security](/docs/security/) [​](#security "Direct link to security") Read up on [security](/docs/security/) best practices to make sure you're developing safely with LangChain. ### [Contributing](/docs/contributing/) [​](#contributing "Direct link to contributing") Check out the developer's guide for guidelines on contributing and help getting your dev environment set up. * * * #### Was this page helpful? * [Architecture](#architecture) * [Guides](#guides) * [Tutorials](#tutorials) * [How-to guides](#how-to-guides) * [Conceptual guide](#conceptual-guide) * [Integrations](#integrations) * [API reference](#api-reference) * [Ecosystem](#ecosystem) * [πŸ¦œπŸ› οΈ LangSmith](#️-langsmith) * [πŸ¦œπŸ•ΈοΈ LangGraph](#️-langgraph) * [Additional resources](#additional-resources) * [Versions](#versions) * [Security](#security) * [Contributing](#contributing) --- # Providers | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/providers/index.mdx) info If you'd like to write your own integration, see [Extending LangChain](/docs/how_to/#custom) . If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing/how_to/integrations/) . LangChain integrates with many providers. Integration Packages[​](#integration-packages "Direct link to Integration Packages") ------------------------------------------------------------------------------------- These providers have standalone `langchain-{provider}` packages for improved versioning, dependency management and testing. | Provider | Package | Downloads | Latest | [JS](https://js.langchain.com/docs/integrations/providers/) | | --- | --- | --- | --- | --- | | [OpenAI](/docs/integrations/providers/openai/) | [langchain-openai](https://python.langchain.com/api_reference/openai/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-openai?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-openai?style=flat-square&label=%20&color=orange) | βœ… | | [Google VertexAI](/docs/integrations/providers/google/) | [langchain-google-vertexai](https://python.langchain.com/api_reference/google_vertexai/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-google-vertexai?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-google-vertexai?style=flat-square&label=%20&color=orange) | βœ… | | [Google Community](/docs/integrations/providers/google/) | [langchain-google-community](https://python.langchain.com/api_reference/google_community/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-google-community?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-google-community?style=flat-square&label=%20&color=orange) | ❌ | | [AWS](/docs/integrations/providers/aws/) | [langchain-aws](https://python.langchain.com/api_reference/aws/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-aws?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-aws?style=flat-square&label=%20&color=orange) | βœ… | | [Anthropic](/docs/integrations/providers/anthropic/) | [langchain-anthropic](https://python.langchain.com/api_reference/anthropic/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-anthropic?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-anthropic?style=flat-square&label=%20&color=orange) | βœ… | | [Google Generative AI](/docs/integrations/providers/google/) | [langchain-google-genai](https://python.langchain.com/api_reference/google_genai/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-google-genai?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-google-genai?style=flat-square&label=%20&color=orange) | βœ… | | [Cohere](/docs/integrations/providers/cohere/) | [langchain-cohere](https://python.langchain.com/api_reference/cohere/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-cohere?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-cohere?style=flat-square&label=%20&color=orange) | βœ… | | [Chroma](/docs/integrations/providers/chroma/) | [langchain-chroma](https://python.langchain.com/api_reference/chroma/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-chroma?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-chroma?style=flat-square&label=%20&color=orange) | ❌ | | [Huggingface](/docs/integrations/providers/huggingface/) | [langchain-huggingface](https://python.langchain.com/api_reference/huggingface/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-huggingface?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-huggingface?style=flat-square&label=%20&color=orange) | ❌ | | [Groq](/docs/integrations/providers/groq/) | [langchain-groq](https://python.langchain.com/api_reference/groq/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-groq?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-groq?style=flat-square&label=%20&color=orange) | βœ… | | [Pinecone](/docs/integrations/providers/pinecone/) | [langchain-pinecone](https://python.langchain.com/api_reference/pinecone/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-pinecone?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-pinecone?style=flat-square&label=%20&color=orange) | βœ… | | [Ollama](/docs/integrations/providers/ollama/) | [langchain-ollama](https://python.langchain.com/api_reference/ollama/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ollama?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ollama?style=flat-square&label=%20&color=orange) | βœ… | | [Postgres](/docs/integrations/providers/pgvector/) | [langchain-postgres](https://python.langchain.com/api_reference/postgres/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-postgres?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-postgres?style=flat-square&label=%20&color=orange) | ❌ | | [Ibm](/docs/integrations/providers/ibm/) | [langchain-ibm](https://python.langchain.com/api_reference/ibm/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ibm?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ibm?style=flat-square&label=%20&color=orange) | βœ… | | [MistralAI](/docs/integrations/providers/mistralai/) | [langchain-mistralai](https://python.langchain.com/api_reference/mistralai/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-mistralai?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-mistralai?style=flat-square&label=%20&color=orange) | βœ… | | [Nvidia AI Endpoints](/docs/integrations/providers/nvidia/) | [langchain-nvidia-ai-endpoints](https://python.langchain.com/api_reference/nvidia_ai_endpoints/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-nvidia-ai-endpoints?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-nvidia-ai-endpoints?style=flat-square&label=%20&color=orange) | ❌ | | [MongoDB](/docs/integrations/providers/mongodb_atlas/) | [langchain-mongodb](https://python.langchain.com/api_reference/mongodb/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-mongodb?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-mongodb?style=flat-square&label=%20&color=orange) | βœ… | | [Milvus](/docs/integrations/providers/milvus/) | [langchain-milvus](https://python.langchain.com/api_reference/milvus/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-milvus?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-milvus?style=flat-square&label=%20&color=orange) | ❌ | | [Elasticsearch](/docs/integrations/providers/elasticsearch/) | [langchain-elasticsearch](https://python.langchain.com/api_reference/elasticsearch/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-elasticsearch?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-elasticsearch?style=flat-square&label=%20&color=orange) | ❌ | | [Unstructured](/docs/integrations/providers/unstructured/) | [langchain-unstructured](https://python.langchain.com/api_reference/unstructured/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-unstructured?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-unstructured?style=flat-square&label=%20&color=orange) | ❌ | | [Qdrant](/docs/integrations/providers/qdrant/) | [langchain-qdrant](https://python.langchain.com/api_reference/qdrant/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-qdrant?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-qdrant?style=flat-square&label=%20&color=orange) | βœ… | | [Fireworks](/docs/integrations/providers/fireworks/) | [langchain-fireworks](https://python.langchain.com/api_reference/fireworks/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-fireworks?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-fireworks?style=flat-square&label=%20&color=orange) | ❌ | | [AstraDB](/docs/integrations/providers/astradb/) | [langchain-astradb](https://python.langchain.com/api_reference/astradb/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-astradb?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-astradb?style=flat-square&label=%20&color=orange) | ❌ | | [Together](/docs/integrations/providers/together/) | [langchain-together](https://python.langchain.com/api_reference/together/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-together?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-together?style=flat-square&label=%20&color=orange) | ❌ | | [Databricks](/docs/integrations/providers/databricks/) | [langchain-databricks](https://python.langchain.com/api_reference/databricks/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-databricks?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-databricks?style=flat-square&label=%20&color=orange) | ❌ | | [Weaviate](/docs/integrations/providers/weaviate/) | [langchain-weaviate](https://python.langchain.com/api_reference/weaviate/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-weaviate?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-weaviate?style=flat-square&label=%20&color=orange) | βœ… | | [Upstage](/docs/integrations/providers/upstage/) | [langchain-upstage](https://python.langchain.com/api_reference/upstage/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-upstage?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-upstage?style=flat-square&label=%20&color=orange) | ❌ | | [Redis](/docs/integrations/providers/redis/) | [langchain-redis](https://python.langchain.com/api_reference/redis/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-redis?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-redis?style=flat-square&label=%20&color=orange) | βœ… | | [VoyageAI](/docs/integrations/providers/voyageai/) | [langchain-voyageai](https://python.langchain.com/api_reference/voyageai/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-voyageai?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-voyageai?style=flat-square&label=%20&color=orange) | ❌ | | [Nomic](/docs/integrations/providers/nomic/) | [langchain-nomic](https://python.langchain.com/api_reference/nomic/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-nomic?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-nomic?style=flat-square&label=%20&color=orange) | βœ… | | [Cerebras](/docs/integrations/providers/cerebras/) | [langchain-cerebras](https://python.langchain.com/api_reference/cerebras/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-cerebras?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-cerebras?style=flat-square&label=%20&color=orange) | ❌ | | [Neo4J](/docs/integrations/providers/neo4j/) | [langchain-neo4j](https://python.langchain.com/api_reference/neo4j/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-neo4j?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-neo4j?style=flat-square&label=%20&color=orange) | ❌ | | [Azure Dynamic Sessions](/docs/integrations/providers/microsoft/) | [langchain-azure-dynamic-sessions](https://python.langchain.com/api_reference/azure_dynamic_sessions/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-azure-dynamic-sessions?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-azure-dynamic-sessions?style=flat-square&label=%20&color=orange) | βœ… | | [Exa](/docs/integrations/providers/exa_search/) | [langchain-exa](https://python.langchain.com/api_reference/exa/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-exa?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-exa?style=flat-square&label=%20&color=orange) | βœ… | | [AI21](/docs/integrations/providers/ai21/) | [langchain-ai21](https://python.langchain.com/api_reference/ai21/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-ai21?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-ai21?style=flat-square&label=%20&color=orange) | ❌ | | [Box](/docs/integrations/providers/box/) | [langchain-box](https://python.langchain.com/api_reference/box/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-box?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-box?style=flat-square&label=%20&color=orange) | ❌ | | [Snowflake](/docs/integrations/providers/snowflake/) | [langchain-snowflake](https://python.langchain.com/api_reference/snowflake/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-snowflake?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-snowflake?style=flat-square&label=%20&color=orange) | ❌ | | [Sqlserver](/docs/integrations/providers/microsoft/) | [langchain-sqlserver](https://python.langchain.com/api_reference/sqlserver/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-sqlserver?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-sqlserver?style=flat-square&label=%20&color=orange) | ❌ | | [Sema4](/docs/integrations/providers/robocorp/) | [langchain-sema4](https://python.langchain.com/api_reference/sema4/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-sema4?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-sema4?style=flat-square&label=%20&color=orange) | ❌ | | [Prompty](/docs/integrations/providers/microsoft/) | [langchain-prompty](https://python.langchain.com/api_reference/prompty/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-prompty?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-prompty?style=flat-square&label=%20&color=orange) | ❌ | | [Scrapegraph](/docs/integrations/providers/scrapegraph/) | [langchain-scrapegraph](https://python.langchain.com/api_reference/scrapegraph/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-scrapegraph?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-scrapegraph?style=flat-square&label=%20&color=orange) | ❌ | | [Linkup](/docs/integrations/providers/linkup/) | [langchain-linkup](https://python.langchain.com/api_reference/linkup/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-linkup?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-linkup?style=flat-square&label=%20&color=orange) | ❌ | | [LocalAI](/docs/integrations/providers/localai/) | [langchain-localai](https://python.langchain.com/api_reference/localai/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-localai?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-localai?style=flat-square&label=%20&color=orange) | ❌ | | [CrateDB](/docs/integrations/providers/cratedb/) | [langchain-cratedb](https://python.langchain.com/api_reference/cratedb/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-cratedb?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-cratedb?style=flat-square&label=%20&color=orange) | ❌ | | [Couchbase](/docs/integrations/providers/couchbase/) | [langchain-couchbase](https://python.langchain.com/api_reference/couchbase/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-couchbase?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-couchbase?style=flat-square&label=%20&color=orange) | ❌ | | [Oceanbase](/docs/integrations/providers/oceanbase/) | [langchain-oceanbase](https://python.langchain.com/api_reference/oceanbase/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-oceanbase?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-oceanbase?style=flat-square&label=%20&color=orange) | ❌ | | [Predictionguard](/docs/integrations/providers/predictionguard/) | [langchain-predictionguard](https://python.langchain.com/api_reference/predictionguard/) | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-predictionguard?style=flat-square&label=%20&color=blue) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-predictionguard?style=flat-square&label=%20&color=orange) | ❌ | All Providers[​](#all-providers "Direct link to All Providers") ---------------------------------------------------------------- Click [here](/docs/integrations/providers/all/) to see all providers. Or search for a provider using the Search field in the top-right corner of the screen. * * * #### Was this page helpful? * [Integration Packages](#integration-packages) * [All Providers](#all-providers) --- # LangChain Python API Reference β€” πŸ¦œπŸ”— LangChain documentation [Skip to main content](#main-content) Back to top Ctrl+K [Docs](https://python.langchain.com/) * [GitHub](https://github.com/langchain-ai/langchain "GitHub") * [X / Twitter](https://twitter.com/langchainai "X / Twitter") LangChain Python API Reference[#](#langchain-python-api-reference "Link to this heading") ========================================================================================== Welcome to the LangChain Python API reference. This is a reference for all `langchain-x` packages. For user guides see [https://python.langchain.com](https://python.langchain.com) . For the legacy API reference hosted on ReadTheDocs see [https://api.python.langchain.com/](https://api.python.langchain.com/) . Base packages[#](#base-packages "Link to this heading") -------------------------------------------------------- **Core** langchain-core: 0.3.28 [core/index.html](core/index.html) **Langchain** langchain: 0.3.13 [langchain/index.html](langchain/index.html) **Text Splitters** langchain-text-splitters: 0.3.4 [text\_splitters/index.html](text_splitters/index.html) **Community** langchain-community: 0.3.13 [community/index.html](community/index.html) **Experimental** langchain-experimental: 0.3.4 [experimental/index.html](experimental/index.html) Integrations[#](#integrations "Link to this heading") ------------------------------------------------------ **OpenAI** langchain-openai 0.2.14 [openai/index.html](openai/index.html) **Anthropic** langchain-anthropic 0.3.1 [anthropic/index.html](anthropic/index.html) **Google VertexAI** langchain-google-vertexai 2.0.10 [google\_vertexai/index.html](google_vertexai/index.html) **AWS** langchain-aws 0.2.10 [aws/index.html](aws/index.html) **Huggingface** langchain-huggingface 0.1.2 [huggingface/index.html](huggingface/index.html) **MistralAI** langchain-mistralai 0.2.4 [mistralai/index.html](mistralai/index.html) See the full list of integrations in the Section Navigation. On this page --- # Welcome Contributors | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/contributing/index.mdx) Hi there! Thank you for your interest in contributing to LangChain. As an open-source project in a fast developing field, we are extremely open to contributions, whether they involve new features, improved infrastructure, better documentation, or bug fixes. Tutorials[​](#tutorials "Direct link to Tutorials") ---------------------------------------------------- More coming soon! We are working on tutorials to help you make your first contribution to the project. * [**Make your first docs PR**](/docs/contributing/tutorials/docs/) How-to Guides[​](#how-to-guides "Direct link to How-to Guides") ---------------------------------------------------------------- * [**Documentation**](/docs/contributing/how_to/documentation/) : Help improve our docs, including this one! * [**Code**](/docs/contributing/how_to/code/) : Help us write code, fix bugs, or improve our infrastructure. * [**Integrations**](/docs/contributing/how_to/integrations/) : Help us integrate with your favorite vendors and tools. * [**Standard Tests**](/docs/contributing/how_to/integrations/standard_tests/) : Ensure your integration passes an expected set of tests. Reference[​](#reference "Direct link to Reference") ---------------------------------------------------- * [**Repository Structure**](/docs/contributing/reference/repo_structure/) : Understand the high level structure of the repository. * [**Review Process**](/docs/contributing/reference/review_process/) : Learn about the review process for pull requests. * [**Frequently Asked Questions (FAQ)**](/docs/contributing/reference/faq/) : Get answers to common questions about contributing. Community[​](#community "Direct link to Community") ---------------------------------------------------- ### πŸ’­ GitHub Discussions[​](#-github-discussions "Direct link to πŸ’­ GitHub Discussions") We have a [discussions](https://github.com/langchain-ai/langchain/discussions) page where users can ask usage questions, discuss design decisions, and propose new features. If you are able to help answer questions, please do so! This will allow the maintainers to spend more time focused on development and bug fixing. ### 🚩 GitHub Issues[​](#-github-issues "Direct link to 🚩 GitHub Issues") Our [issues](https://github.com/langchain-ai/langchain/issues) page is kept up to date with bugs, improvements, and feature requests. There is a [taxonomy of labels](https://github.com/langchain-ai/langchain/labels?sort=count-desc) to help with sorting and discovery of issues of interest. Please use these to help organize issues. Check out the [Help Wanted](https://github.com/langchain-ai/langchain/labels/help%20wanted) and [Good First Issue](https://github.com/langchain-ai/langchain/labels/good%20first%20issue) tags for recommendations. If you start working on an issue, please assign it to yourself. If you are adding an issue, please try to keep it focused on a single, modular bug/improvement/feature. If two issues are related, or blocking, please link them rather than combining them. We will try to keep these issues as up-to-date as possible, though with the rapid rate of development in this field some may get out of date. If you notice this happening, please let us know. ### πŸ“’ Community Slack[​](#-community-slack "Direct link to πŸ“’ Community Slack") We have a [community slack](https://www.langchain.com/join-community) where you can ask questions, get help, and discuss the project with other contributors and users. ### πŸ™‹ Getting Help[​](#-getting-help "Direct link to πŸ™‹ Getting Help") Our goal is to have the simplest developer setup possible. Should you experience any difficulty getting setup, please ask in [community slack](https://www.langchain.com/join-community) or open a [discussion on GitHub](https://github.com/langchain-ai/langchain/discussions) . In a similar vein, we do enforce certain linting, formatting, and documentation standards in the codebase. If you are finding these difficult (or even just annoying) to work with, feel free to ask in [community slack](https://www.langchain.com/join-community) ! * * * #### Was this page helpful? * [Tutorials](#tutorials) * [How-to Guides](#how-to-guides) * [Reference](#reference) * [Community](#community) * [πŸ’­ GitHub Discussions](#-github-discussions) * [🚩 GitHub Issues](#-github-issues) * [πŸ“’ Community Slack](#-community-slack) * [πŸ™‹ Getting Help](#-getting-help) --- # People | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/people.mdx) There are some incredible humans from all over the world who have been instrumental in helping the LangChain community flourish 🌐! This page highlights a few of those folks who have dedicated their time to the open-source repo in the form of direct contributions and reviews. Top reviewers[​](#top-reviewers "Direct link to Top reviewers") ---------------------------------------------------------------- As LangChain has grown, the amount of surface area that maintainers cover has grown as well. Thank you to the following folks who have gone above and beyond in reviewing incoming PRs πŸ™! [![](https://avatars.githubusercontent.com/u/2256422?v=4)](https://github.com/leo-gan) [@leo-gan](https://github.com/leo-gan) [![](https://avatars.githubusercontent.com/u/11633333?u=e13817e11b3fb8c3d209d747c77a0f0742d11138&v=4)](https://github.com/cbornet) [@cbornet](https://github.com/cbornet) [![](https://avatars.githubusercontent.com/u/11026406?v=4)](https://github.com/lkuligin) [@lkuligin](https://github.com/lkuligin) [![](https://avatars.githubusercontent.com/u/289369?u=80655eb5f9a4d03bf1a526b07a67adc6eacccc6b&v=4)](https://github.com/3coins) [@3coins](https://github.com/3coins) [![](https://avatars.githubusercontent.com/u/67427?v=4)](https://github.com/jexp) [@jexp](https://github.com/jexp) [![](https://avatars.githubusercontent.com/u/19948365?v=4)](https://github.com/tomasonjo) [@tomasonjo](https://github.com/tomasonjo) [![](https://avatars.githubusercontent.com/u/48236177?u=757490c6af76be0a8837dd5886991005a23c89c7&v=4)](https://github.com/liugddx) [@liugddx](https://github.com/liugddx) [![](https://avatars.githubusercontent.com/u/49480?u=4a9b7c8820211aae14da7f72f617d88019a06569&v=4)](https://github.com/joemcelroy) [@joemcelroy](https://github.com/joemcelroy) [![](https://avatars.githubusercontent.com/u/72488598?u=98dc24a63369cbae14913caff5f379f80f305aab&v=4)](https://github.com/Undertone0809) [@Undertone0809](https://github.com/Undertone0809) [![](https://avatars.githubusercontent.com/u/44113430?u=34bdaacaeb2880e40fb4b07897c481771c6de544&v=4)](https://github.com/mspronesti) [@mspronesti](https://github.com/mspronesti) [![](https://avatars.githubusercontent.com/u/8429627?u=d28653fbd93c966ac840f93a05f0ef949495851f&v=4)](https://github.com/JohnNay) [@JohnNay](https://github.com/JohnNay) [![](https://avatars.githubusercontent.com/u/749277?u=84aeb7b75146a67f8b18b389dc591ba72ef105e4&v=4)](https://github.com/tjaffri) [@tjaffri](https://github.com/tjaffri) [![](https://avatars.githubusercontent.com/u/6690839?u=e56c2161ddc98c58b01fb82da4076e5400fb1e6d&v=4)](https://github.com/sjwhitmore) [@sjwhitmore](https://github.com/sjwhitmore) [![](https://avatars.githubusercontent.com/u/13262395?u=430eff10dfbb7d3f27a35f1ea2c9ea6a61067c88&v=4)](https://github.com/holtskinner) [@holtskinner](https://github.com/holtskinner) [![](https://avatars.githubusercontent.com/u/62768671?u=279f772a5b8325a191a1a8bb623aa40f32a01856&v=4)](https://github.com/skcoirz) [@skcoirz](https://github.com/skcoirz) [![](https://avatars.githubusercontent.com/u/17039389?u=796226152becf82c4d7fd5cc49a24e58a73ce66f&v=4)](https://github.com/harupy) [@harupy](https://github.com/harupy) [![](https://avatars.githubusercontent.com/u/20304844?u=f00461bcedad6ba384a4e234a44c906802448b4e&v=4)](https://github.com/tylerhutcherson) [@tylerhutcherson](https://github.com/tylerhutcherson) [![](https://avatars.githubusercontent.com/u/45242107?u=bf122f1371d59c3ba69a87225255fbd00e894404&v=4)](https://github.com/keenborder786) [@keenborder786](https://github.com/keenborder786) [![](https://avatars.githubusercontent.com/u/46051506?u=026f5f140e8b7ba4744bf971f9ebdea9ebab67ca&v=4)](https://github.com/Anush008) [@Anush008](https://github.com/Anush008) [![](https://avatars.githubusercontent.com/u/55082429?v=4)](https://github.com/maang-h) [@maang-h](https://github.com/maang-h) [![](https://avatars.githubusercontent.com/u/13009163?u=c2b3a11cceaadbc9415f545b971250c9e2b2078b&v=4)](https://github.com/Spartee) [@Spartee](https://github.com/Spartee) [![](https://avatars.githubusercontent.com/u/17705063?v=4)](https://github.com/Raj725) [@Raj725](https://github.com/Raj725) [![](https://avatars.githubusercontent.com/u/1635179?u=0631cb84ca580089198114f94d9c27efe730220e&v=4)](https://github.com/MthwRobinson) [@MthwRobinson](https://github.com/MthwRobinson) [![](https://avatars.githubusercontent.com/u/23314389?u=2014e20e246530fa89bd902fe703b6f9e6ecf833&v=4)](https://github.com/nicoloboschi) [@nicoloboschi](https://github.com/nicoloboschi) [![](https://avatars.githubusercontent.com/u/2887713?u=7bb198c7d11d29a412dc836818f3da6666f643ee&v=4)](https://github.com/Jibola) [@Jibola](https://github.com/Jibola) [![](https://avatars.githubusercontent.com/u/5015933?u=80e339672a321cde25f4b484129bbddfefb2356d&v=4)](https://github.com/ShaneHarvey) [@ShaneHarvey](https://github.com/ShaneHarvey) [![](https://avatars.githubusercontent.com/u/19181718?u=79a9013dea28a7fa654431cd7e89b08dc76434dd&v=4)](https://github.com/sepiatone) [@sepiatone](https://github.com/sepiatone) [![](https://avatars.githubusercontent.com/u/123224380?v=4)](https://github.com/scadEfUr) [@scadEfUr](https://github.com/scadEfUr) [![](https://avatars.githubusercontent.com/u/891664?u=722172a0061f68ab22819fa88a354ec973f70a63&v=4)](https://github.com/jeffchuber) [@jeffchuber](https://github.com/jeffchuber) [![](https://avatars.githubusercontent.com/u/2649301?u=5e688d2b90ddcafd5028a9da292010144cad6d18&v=4)](https://github.com/kacperlukawski) [@kacperlukawski](https://github.com/kacperlukawski) [![](https://avatars.githubusercontent.com/u/25930426?v=4)](https://github.com/pranjaldoshi96) [@pranjaldoshi96](https://github.com/pranjaldoshi96) [![](https://avatars.githubusercontent.com/u/2096628?u=2a4822ff8dc6b4f1162c58716d48fdfac08c8601&v=4)](https://github.com/blink1073) [@blink1073](https://github.com/blink1073) [![](https://avatars.githubusercontent.com/u/31463517?u=635a36cf4e20a25b5bc8cdc3aa27c613fa701cfa&v=4)](https://github.com/B-Step62) [@B-Step62](https://github.com/B-Step62) [![](https://avatars.githubusercontent.com/u/13749212?u=b58700c3bd236e880223bccba53b7ad0dd4d7003&v=4)](https://github.com/eavanvalkenburg) [@eavanvalkenburg](https://github.com/eavanvalkenburg) [![](https://avatars.githubusercontent.com/u/1097932?u=0e9c1cc9e2c02469e52963322344af181464bf43&v=4)](https://github.com/gengliangwang) [@gengliangwang](https://github.com/gengliangwang) [![](https://avatars.githubusercontent.com/u/39497902?u=0c1597698c6f28da87d80ac0de9c8276d5ab63e9&v=4)](https://github.com/dbczumar) [@dbczumar](https://github.com/dbczumar) [![](https://avatars.githubusercontent.com/u/39283302?u=58e7bdcdc759fa1f823bd5af35641ca5ad2a6d15&v=4)](https://github.com/BenWilson2) [@BenWilson2](https://github.com/BenWilson2) [![](https://avatars.githubusercontent.com/u/251292?u=a7465aae734d2cbc12d26b885b07d466d969bf0c&v=4)](https://github.com/jmorganca) [@jmorganca](https://github.com/jmorganca) [![](https://avatars.githubusercontent.com/u/204694?u=c42de41cff108d35269dd2e8fac8977f1f4e471d&v=4)](https://github.com/pprados) [@pprados](https://github.com/pprados) [![](https://avatars.githubusercontent.com/u/14221764?u=47a1405343b4d92caed3744e82dda1d28d01a251&v=4)](https://github.com/hemidactylus) [@hemidactylus](https://github.com/hemidactylus) [![](https://avatars.githubusercontent.com/u/82586689?u=f10792bb4d6db272be85086ae5a8159f56d8a64f&v=4)](https://github.com/RafaelXokito) [@RafaelXokito](https://github.com/RafaelXokito) [![](https://avatars.githubusercontent.com/u/35960?v=4)](https://github.com/bjchambers) [@bjchambers](https://github.com/bjchambers) [![](https://avatars.githubusercontent.com/u/101075607?v=4)](https://github.com/andychenmagrathea-06e0a82f-34fc-48ca) [@andychenmagrathea-06e0a82f-34fc-48ca](https://github.com/andychenmagrathea-06e0a82f-34fc-48ca) [![](https://avatars.githubusercontent.com/u/43734688?u=78f139fa940620e301361a58821c9f56128f71d9&v=4)](https://github.com/sam-h-bean) [@sam-h-bean](https://github.com/sam-h-bean) [![](https://avatars.githubusercontent.com/u/20311743?u=29bf2391ae34297a12a88d813731b0bdf289e4a5&v=4)](https://github.com/nickscamara) [@nickscamara](https://github.com/nickscamara) [![](https://avatars.githubusercontent.com/u/89161683?u=4a59b199c77215fe3cb8c937797b909061ec49af&v=4)](https://github.com/naveentatikonda) [@naveentatikonda](https://github.com/naveentatikonda) [![](https://avatars.githubusercontent.com/u/24217337?u=09d0e274f382e264ef578e93b547fb55a5b179fe&v=4)](https://github.com/kylehh) [@kylehh](https://github.com/kylehh) [![](https://avatars.githubusercontent.com/u/1823547?u=ea9246b84dbc3886d96ba171aabb64d2470c8d60&v=4)](https://github.com/ofermend) [@ofermend](https://github.com/ofermend) [![](https://avatars.githubusercontent.com/u/6162415?u=637859605152bece4f99fdc13ef5b4f0027b00e1&v=4)](https://github.com/navneet1v) [@navneet1v](https://github.com/navneet1v) [![](https://avatars.githubusercontent.com/u/144115527?u=b881a61482b25b543dacd217d18fc5b98c38e7a3&v=4)](https://github.com/billytrend-cohere) [@billytrend-cohere](https://github.com/billytrend-cohere) [![](https://avatars.githubusercontent.com/u/91237924?u=76e7131a2ebbe9ef35061620286d6d06258e7a61&v=4)](https://github.com/openvino-dev-samples) [@openvino-dev-samples](https://github.com/openvino-dev-samples) [![](https://avatars.githubusercontent.com/u/82044803?u=451c2955f0862cccf64cac30e062570d208d6903&v=4)](https://github.com/serena-ruan) [@serena-ruan](https://github.com/serena-ruan) [![](https://avatars.githubusercontent.com/u/851520?u=21c6d8ef697fd32a8020d81269e155a24cb081ac&v=4)](https://github.com/maxjakob) [@maxjakob](https://github.com/maxjakob) Top recent contributors[​](#top-recent-contributors "Direct link to Top recent contributors") ---------------------------------------------------------------------------------------------- The list below contains contributors who have had the most PRs merged in the last three months, weighted (imperfectly) by impact. Thank you all so much for your time and efforts in making LangChain better ❀️! [![](https://avatars.githubusercontent.com/u/2256422?v=4)](https://github.com/leo-gan) [@leo-gan](https://github.com/leo-gan) [![](https://avatars.githubusercontent.com/u/11633333?u=e13817e11b3fb8c3d209d747c77a0f0742d11138&v=4)](https://github.com/cbornet) [@cbornet](https://github.com/cbornet) [![](https://avatars.githubusercontent.com/u/55082429?v=4)](https://github.com/maang-h) [@maang-h](https://github.com/maang-h) [![](https://avatars.githubusercontent.com/u/46051506?u=026f5f140e8b7ba4744bf971f9ebdea9ebab67ca&v=4)](https://github.com/Anush008) [@Anush008](https://github.com/Anush008) [![](https://avatars.githubusercontent.com/u/17705063?v=4)](https://github.com/Raj725) [@Raj725](https://github.com/Raj725) [![](https://avatars.githubusercontent.com/u/24444502?u=324d8acd5a220bfd93b1b46dac1d9d1d82d7d516&v=4)](https://github.com/ZhangShenao) [@ZhangShenao](https://github.com/ZhangShenao) [![](https://avatars.githubusercontent.com/u/886516?u=9ee4c1643932282abedaf432a5e39c76ca260700&v=4)](https://github.com/shurrey) [@shurrey](https://github.com/shurrey) [![](https://avatars.githubusercontent.com/u/35960?v=4)](https://github.com/bjchambers) [@bjchambers](https://github.com/bjchambers) [![](https://avatars.githubusercontent.com/u/19948365?v=4)](https://github.com/tomasonjo) [@tomasonjo](https://github.com/tomasonjo) [![](https://avatars.githubusercontent.com/u/31463517?u=635a36cf4e20a25b5bc8cdc3aa27c613fa701cfa&v=4)](https://github.com/B-Step62) [@B-Step62](https://github.com/B-Step62) [![](https://avatars.githubusercontent.com/u/14959173?u=87fcb0013440f648fb263168583695258b6dbf1c&v=4)](https://github.com/jhpiedrahitao) [@jhpiedrahitao](https://github.com/jhpiedrahitao) [![](https://avatars.githubusercontent.com/u/12782505?u=a3f1c6e7e68b96bb7be08ecd25f74f2396394597&v=4)](https://github.com/nithishr) [@nithishr](https://github.com/nithishr) [![](https://avatars.githubusercontent.com/u/737181?u=037bd3004f6c333108d7b32a4c8f96f2e8d57e78&v=4)](https://github.com/caseyclements) [@caseyclements](https://github.com/caseyclements) [![](https://avatars.githubusercontent.com/u/43506685?u=20e4be682f43988bd43b039a801856498e31c764&v=4)](https://github.com/Coniferish) [@Coniferish](https://github.com/Coniferish) [![](https://avatars.githubusercontent.com/u/17022025?u=ceee62d53f1c06bf9a014096b651ca0c42cfea3b&v=4)](https://github.com/zc277584121) [@zc277584121](https://github.com/zc277584121) [![](https://avatars.githubusercontent.com/u/82044803?u=451c2955f0862cccf64cac30e062570d208d6903&v=4)](https://github.com/serena-ruan) [@serena-ruan](https://github.com/serena-ruan) [![](https://avatars.githubusercontent.com/u/45242107?u=bf122f1371d59c3ba69a87225255fbd00e894404&v=4)](https://github.com/keenborder786) [@keenborder786](https://github.com/keenborder786) [![](https://avatars.githubusercontent.com/u/58721149?v=4)](https://github.com/dristysrivastava) [@dristysrivastava](https://github.com/dristysrivastava) [![](https://avatars.githubusercontent.com/u/34255899?u=05aba76f1912a56538c8a5141f8135d0e3b1e1bd&v=4)](https://github.com/gbaian10) [@gbaian10](https://github.com/gbaian10) [![](https://avatars.githubusercontent.com/u/87140293?v=4)](https://github.com/thedavgar) [@thedavgar](https://github.com/thedavgar) Core maintainers[​](#core-maintainers "Direct link to Core maintainers") ------------------------------------------------------------------------- Hello there πŸ‘‹! We're LangChain's core maintainers. If you've spent time in the community, you've probably crossed paths with at least one of us already. [![](https://avatars.githubusercontent.com/u/22008038?u=8e3d6bbd0adbe02f0bd259c44f2ddb8612f90d88&v=4)](https://github.com/baskaryan) [@baskaryan](https://github.com/baskaryan) [![](https://avatars.githubusercontent.com/u/26529506?u=528b1df1ba3ba4f21e3e1fb74b12766e5b04c487&v=4)](https://github.com/ccurme) [@ccurme](https://github.com/ccurme) [![](https://avatars.githubusercontent.com/u/13333726?u=82ebf1e0eb0663ebd49ba66f67a43f51bbf11442&v=4)](https://github.com/hinthornw) [@hinthornw](https://github.com/hinthornw) [![](https://avatars.githubusercontent.com/u/122662504?u=e88c472fba16a74332c550cc9707fd015738a0da&v=4)](https://github.com/rlancemartin) [@rlancemartin](https://github.com/rlancemartin) [![](https://avatars.githubusercontent.com/u/56902?u=fdb30e802c68bc338dd9c0820f713e4fdac75db7&v=4)](https://github.com/nfcampos) [@nfcampos](https://github.com/nfcampos) [![](https://avatars.githubusercontent.com/u/9536492?u=820809d60f4a720a4e1f507a1bf866dfb5f86614&v=4)](https://github.com/agola11) [@agola11](https://github.com/agola11) [![](https://avatars.githubusercontent.com/u/11986836?u=f4c4f21a82b2af6c9f91e1f1d99ea40062f7a101&v=4)](https://github.com/hwchase17) [@hwchase17](https://github.com/hwchase17) [![](https://avatars.githubusercontent.com/u/19161700?u=e76bcd472b51c9f07befd2654783d0a381f49005&v=4)](https://github.com/vbarda) [@vbarda](https://github.com/vbarda) [![](https://avatars.githubusercontent.com/u/9557659?u=44391f1f5f5e3a72acc9772ca30f28bfdcc25fac&v=4)](https://github.com/efriis) [@efriis](https://github.com/efriis) [![](https://avatars.githubusercontent.com/u/3205522?v=4)](https://github.com/eyurtsev) [@eyurtsev](https://github.com/eyurtsev) Top all-time contributors[​](#top-all-time-contributors "Direct link to Top all-time contributors") ---------------------------------------------------------------------------------------------------- And finally, this is an all-time list of all-stars who have made significant contributions to the framework 🌟: [![](https://avatars.githubusercontent.com/u/2256422?v=4)](https://github.com/leo-gan) [@leo-gan](https://github.com/leo-gan) [![](https://avatars.githubusercontent.com/u/11633333?u=e13817e11b3fb8c3d209d747c77a0f0742d11138&v=4)](https://github.com/cbornet) [@cbornet](https://github.com/cbornet) [![](https://avatars.githubusercontent.com/u/19948365?v=4)](https://github.com/tomasonjo) [@tomasonjo](https://github.com/tomasonjo) [![](https://avatars.githubusercontent.com/u/11026406?v=4)](https://github.com/lkuligin) [@lkuligin](https://github.com/lkuligin) [![](https://avatars.githubusercontent.com/u/55082429?v=4)](https://github.com/maang-h) [@maang-h](https://github.com/maang-h) [![](https://avatars.githubusercontent.com/u/1635179?u=0631cb84ca580089198114f94d9c27efe730220e&v=4)](https://github.com/MthwRobinson) [@MthwRobinson](https://github.com/MthwRobinson) [![](https://avatars.githubusercontent.com/u/2649301?u=5e688d2b90ddcafd5028a9da292010144cad6d18&v=4)](https://github.com/kacperlukawski) [@kacperlukawski](https://github.com/kacperlukawski) [![](https://avatars.githubusercontent.com/u/14221764?u=47a1405343b4d92caed3744e82dda1d28d01a251&v=4)](https://github.com/hemidactylus) [@hemidactylus](https://github.com/hemidactylus) [![](https://avatars.githubusercontent.com/u/289369?u=80655eb5f9a4d03bf1a526b07a67adc6eacccc6b&v=4)](https://github.com/3coins) [@3coins](https://github.com/3coins) [![](https://avatars.githubusercontent.com/u/48236177?u=757490c6af76be0a8837dd5886991005a23c89c7&v=4)](https://github.com/liugddx) [@liugddx](https://github.com/liugddx) [![](https://avatars.githubusercontent.com/u/707699?u=5af157e56c17bb694ed78f27ba313dcb576f00bd&v=4)](https://github.com/timothyasp) [@timothyasp](https://github.com/timothyasp) [![](https://avatars.githubusercontent.com/u/6690839?u=e56c2161ddc98c58b01fb82da4076e5400fb1e6d&v=4)](https://github.com/sjwhitmore) [@sjwhitmore](https://github.com/sjwhitmore) [![](https://avatars.githubusercontent.com/u/139469471?u=4f555a1c581194f9957bf95921d3ebec61da0f3c&v=4)](https://github.com/MateuszOssGit) [@MateuszOssGit](https://github.com/MateuszOssGit) [![](https://avatars.githubusercontent.com/u/45242107?u=bf122f1371d59c3ba69a87225255fbd00e894404&v=4)](https://github.com/keenborder786) [@keenborder786](https://github.com/keenborder786) [![](https://avatars.githubusercontent.com/u/6439365?u=51c4e9ea28b36473f21524fb68f7b717047e36f9&v=4)](https://github.com/mbchang) [@mbchang](https://github.com/mbchang) [![](https://avatars.githubusercontent.com/u/131175?u=332fe36f12d9ffe9e4414dc776b381fe801a9c53&v=4)](https://github.com/danielchalef) [@danielchalef](https://github.com/danielchalef) [![](https://avatars.githubusercontent.com/u/46051506?u=026f5f140e8b7ba4744bf971f9ebdea9ebab67ca&v=4)](https://github.com/Anush008) [@Anush008](https://github.com/Anush008) [![](https://avatars.githubusercontent.com/u/44113430?u=34bdaacaeb2880e40fb4b07897c481771c6de544&v=4)](https://github.com/mspronesti) [@mspronesti](https://github.com/mspronesti) [![](https://avatars.githubusercontent.com/u/15604894?u=420ab32f71fa4a6839da653b5a5d97381b087902&v=4)](https://github.com/chyroc) [@chyroc](https://github.com/chyroc) [![](https://avatars.githubusercontent.com/u/13749212?u=b58700c3bd236e880223bccba53b7ad0dd4d7003&v=4)](https://github.com/eavanvalkenburg) [@eavanvalkenburg](https://github.com/eavanvalkenburg) [![](https://avatars.githubusercontent.com/u/23517545?u=06757717778f7c2a0a092b78edfc242d356a2b3f&v=4)](https://github.com/shibuiwilliam) [@shibuiwilliam](https://github.com/shibuiwilliam) [![](https://avatars.githubusercontent.com/u/13262395?u=430eff10dfbb7d3f27a35f1ea2c9ea6a61067c88&v=4)](https://github.com/holtskinner) [@holtskinner](https://github.com/holtskinner) [![](https://avatars.githubusercontent.com/u/19181718?u=79a9013dea28a7fa654431cd7e89b08dc76434dd&v=4)](https://github.com/sepiatone) [@sepiatone](https://github.com/sepiatone) [![](https://avatars.githubusercontent.com/u/1823547?u=ea9246b84dbc3886d96ba171aabb64d2470c8d60&v=4)](https://github.com/ofermend) [@ofermend](https://github.com/ofermend) [![](https://avatars.githubusercontent.com/u/24279597?u=05e329b5fa4f95223f9fbb1daa07118f72e4a071&v=4)](https://github.com/fpingham) [@fpingham](https://github.com/fpingham) [![](https://avatars.githubusercontent.com/u/204694?u=c42de41cff108d35269dd2e8fac8977f1f4e471d&v=4)](https://github.com/pprados) [@pprados](https://github.com/pprados) [![](https://avatars.githubusercontent.com/u/10000925?u=7970fa7b01d133adfe533c4311b7963e22dc6766&v=4)](https://github.com/169) [@169](https://github.com/169) [![](https://avatars.githubusercontent.com/u/749277?u=84aeb7b75146a67f8b18b389dc591ba72ef105e4&v=4)](https://github.com/tjaffri) [@tjaffri](https://github.com/tjaffri) [![](https://avatars.githubusercontent.com/u/14959173?u=87fcb0013440f648fb263168583695258b6dbf1c&v=4)](https://github.com/jhpiedrahitao) [@jhpiedrahitao](https://github.com/jhpiedrahitao) [![](https://avatars.githubusercontent.com/u/17705063?v=4)](https://github.com/Raj725) [@Raj725](https://github.com/Raj725) [![](https://avatars.githubusercontent.com/u/144115527?u=b881a61482b25b543dacd217d18fc5b98c38e7a3&v=4)](https://github.com/billytrend-cohere) [@billytrend-cohere](https://github.com/billytrend-cohere) [![](https://avatars.githubusercontent.com/u/20311743?u=29bf2391ae34297a12a88d813731b0bdf289e4a5&v=4)](https://github.com/nickscamara) [@nickscamara](https://github.com/nickscamara) [![](https://avatars.githubusercontent.com/u/851520?u=21c6d8ef697fd32a8020d81269e155a24cb081ac&v=4)](https://github.com/maxjakob) [@maxjakob](https://github.com/maxjakob) [![](https://avatars.githubusercontent.com/u/142261444?u=23524d34d4d0dfce963a24131a3c28e89daa9fc7&v=4)](https://github.com/maks-operlejn-ds) [@maks-operlejn-ds](https://github.com/maks-operlejn-ds) [![](https://avatars.githubusercontent.com/u/57520563?v=4)](https://github.com/volodymyr-memsql) [@volodymyr-memsql](https://github.com/volodymyr-memsql) [![](https://avatars.githubusercontent.com/u/12782505?u=a3f1c6e7e68b96bb7be08ecd25f74f2396394597&v=4)](https://github.com/nithishr) [@nithishr](https://github.com/nithishr) [![](https://avatars.githubusercontent.com/u/2887713?u=7bb198c7d11d29a412dc836818f3da6666f643ee&v=4)](https://github.com/Jibola) [@Jibola](https://github.com/Jibola) [![](https://avatars.githubusercontent.com/u/31382824?u=6d105aac7d9644321baf32108937e70878593880&v=4)](https://github.com/Adi8885) [@Adi8885](https://github.com/Adi8885) [![](https://avatars.githubusercontent.com/u/31463517?u=635a36cf4e20a25b5bc8cdc3aa27c613fa701cfa&v=4)](https://github.com/B-Step62) [@B-Step62](https://github.com/B-Step62) [![](https://avatars.githubusercontent.com/u/64213648?u=a9a3c39e0277dcb74d102e73511df929d2a1ecc6&v=4)](https://github.com/sergerdn) [@sergerdn](https://github.com/sergerdn) [![](https://avatars.githubusercontent.com/u/91237924?u=76e7131a2ebbe9ef35061620286d6d06258e7a61&v=4)](https://github.com/openvino-dev-samples) [@openvino-dev-samples](https://github.com/openvino-dev-samples) [![](https://avatars.githubusercontent.com/u/6519888?u=fe0b0f093e8683bdac4f205b237d2e48d7c755d4&v=4)](https://github.com/averikitsch) [@averikitsch](https://github.com/averikitsch) [![](https://avatars.githubusercontent.com/u/89161683?u=4a59b199c77215fe3cb8c937797b909061ec49af&v=4)](https://github.com/naveentatikonda) [@naveentatikonda](https://github.com/naveentatikonda) [![](https://avatars.githubusercontent.com/u/56769451?u=088102b6160822bc68c25a2a5df170080d0b16a2&v=4)](https://github.com/tyumentsev4) [@tyumentsev4](https://github.com/tyumentsev4) [![](https://avatars.githubusercontent.com/u/40663591?u=d0a44575938f379eb414c15d9bdc0ecf6911f1b8&v=4)](https://github.com/UmerHA) [@UmerHA](https://github.com/UmerHA) [![](https://avatars.githubusercontent.com/u/84336755?u=35224f42916080bd7add99571a3132f5ef8217b8&v=4)](https://github.com/joshuasundance-swca) [@joshuasundance-swca](https://github.com/joshuasundance-swca) [![](https://avatars.githubusercontent.com/u/54854336?v=4)](https://github.com/adolkhan) [@adolkhan](https://github.com/adolkhan) [![](https://avatars.githubusercontent.com/u/8990777?u=9f7c4ab36aa10d7594748fdc9ddba6ff3f0a2f77&v=4)](https://github.com/jamesbraza) [@jamesbraza](https://github.com/jamesbraza) [![](https://avatars.githubusercontent.com/u/22579106?v=4)](https://github.com/seamusp) [@seamusp](https://github.com/seamusp) [![](https://avatars.githubusercontent.com/u/63565275?u=14db8a9a8d8164fd4973597296c3e015423706bc&v=4)](https://github.com/michaelfeil) [@michaelfeil](https://github.com/michaelfeil) [![](https://avatars.githubusercontent.com/u/9318457?u=3dbf765a07fee48e3dd171851b8417c002a41f49&v=4)](https://github.com/rahul-trip) [@rahul-trip](https://github.com/rahul-trip) [![](https://avatars.githubusercontent.com/u/901795?u=c8cd7391f649623258b5f5ea848550df9407107b&v=4)](https://github.com/virattt) [@virattt](https://github.com/virattt) [![](https://avatars.githubusercontent.com/u/39553475?u=919fcd626077055164ce97bf6cde0a47c54507de&v=4)](https://github.com/Josephasafg) [@Josephasafg](https://github.com/Josephasafg) [![](https://avatars.githubusercontent.com/u/210457?u=3f6ac4dcc1ec9f1b98cc62fd7095120da2accbc4&v=4)](https://github.com/blob42) [@blob42](https://github.com/blob42) [![](https://avatars.githubusercontent.com/u/3690240?v=4)](https://github.com/malandis) [@malandis](https://github.com/malandis) [![](https://avatars.githubusercontent.com/u/8456706?u=bc28d399a4ef7495eaa1e8a8a7b99dda98217260&v=4)](https://github.com/mpskex) [@mpskex](https://github.com/mpskex) [![](https://avatars.githubusercontent.com/u/7069390?u=c10e9b05119b96e82f03a807a2392f938a59f4ef&v=4)](https://github.com/davidbuniat) [@davidbuniat](https://github.com/davidbuniat) [![](https://avatars.githubusercontent.com/u/5787923?u=368596daa7442493d6c26725eb7d0ac5678c7e73&v=4)](https://github.com/ShreyaR) [@ShreyaR](https://github.com/ShreyaR) [![](https://avatars.githubusercontent.com/u/1296705?v=4)](https://github.com/lalanikarim) [@lalanikarim](https://github.com/lalanikarim) [![](https://avatars.githubusercontent.com/u/17022025?u=ceee62d53f1c06bf9a014096b651ca0c42cfea3b&v=4)](https://github.com/zc277584121) [@zc277584121](https://github.com/zc277584121) [![](https://avatars.githubusercontent.com/u/1825679?u=bc5db0325ef2a546c67e1e2ae1f7a0af7afe6803&v=4)](https://github.com/maiqingqiang) [@maiqingqiang](https://github.com/maiqingqiang) [![](https://avatars.githubusercontent.com/u/20304844?u=f00461bcedad6ba384a4e234a44c906802448b4e&v=4)](https://github.com/tylerhutcherson) [@tylerhutcherson](https://github.com/tylerhutcherson) [![](https://avatars.githubusercontent.com/u/62768671?u=279f772a5b8325a191a1a8bb623aa40f32a01856&v=4)](https://github.com/skcoirz) [@skcoirz](https://github.com/skcoirz) [![](https://avatars.githubusercontent.com/u/24444502?u=324d8acd5a220bfd93b1b46dac1d9d1d82d7d516&v=4)](https://github.com/ZhangShenao) [@ZhangShenao](https://github.com/ZhangShenao) [![](https://avatars.githubusercontent.com/u/17039389?u=796226152becf82c4d7fd5cc49a24e58a73ce66f&v=4)](https://github.com/harupy) [@harupy](https://github.com/harupy) [![](https://avatars.githubusercontent.com/u/66525873?u=71102c35b5c8d325d34c32a4f9a07b6f97d90836&v=4)](https://github.com/manuel-soria) [@manuel-soria](https://github.com/manuel-soria) [![](https://avatars.githubusercontent.com/u/94075036?u=b636b7e4d6abff66af96ccae00d539db4735eea1&v=4)](https://github.com/CG80499) [@CG80499](https://github.com/CG80499) [![](https://avatars.githubusercontent.com/u/60956360?u=5678f015273d23e2cbdacbe172bcf154de0f4f86&v=4)](https://github.com/outday29) [@outday29](https://github.com/outday29) [![](https://avatars.githubusercontent.com/u/127103098?v=4)](https://github.com/harry-cohere) [@harry-cohere](https://github.com/harry-cohere) [![](https://avatars.githubusercontent.com/u/1821407?u=0a24b0db8c1a9231ce1c347de92f57341defada2&v=4)](https://github.com/GMartin-dev) [@GMartin-dev](https://github.com/GMartin-dev) [![](https://avatars.githubusercontent.com/u/15918167?v=4)](https://github.com/ljeagle) [@ljeagle](https://github.com/ljeagle) [![](https://avatars.githubusercontent.com/u/49480?u=4a9b7c8820211aae14da7f72f617d88019a06569&v=4)](https://github.com/joemcelroy) [@joemcelroy](https://github.com/joemcelroy) [![](https://avatars.githubusercontent.com/u/10701973?u=866bdbf25a3759626815099ce480e2ffcff520fb&v=4)](https://github.com/IANTHEREAL) [@IANTHEREAL](https://github.com/IANTHEREAL) [![](https://avatars.githubusercontent.com/u/13748374?u=47b1f523342466ab97dd23e285418c5f5c9820c4&v=4)](https://github.com/wangxuqi) [@wangxuqi](https://github.com/wangxuqi) [![](https://avatars.githubusercontent.com/u/886516?u=9ee4c1643932282abedaf432a5e39c76ca260700&v=4)](https://github.com/shurrey) [@shurrey](https://github.com/shurrey) [![](https://avatars.githubusercontent.com/u/2212586?v=4)](https://github.com/mackong) [@mackong](https://github.com/mackong) [![](https://avatars.githubusercontent.com/u/1097932?u=0e9c1cc9e2c02469e52963322344af181464bf43&v=4)](https://github.com/gengliangwang) [@gengliangwang](https://github.com/gengliangwang) [![](https://avatars.githubusercontent.com/u/20971593?u=1574196bb286044d23a04aa5aa34203ada8f4309&v=4)](https://github.com/jzluo) [@jzluo](https://github.com/jzluo) [![](https://avatars.githubusercontent.com/u/58508471?u=74423e863298863bf5c7dd7d1bff0aa106a9cc75&v=4)](https://github.com/Anindyadeep) [@Anindyadeep](https://github.com/Anindyadeep) [![](https://avatars.githubusercontent.com/u/142883372?u=45481f472f5f89c4d8ca8788617ffac47c5ebd88&v=4)](https://github.com/mateusz-wosinski-ds) [@mateusz-wosinski-ds](https://github.com/mateusz-wosinski-ds) [![](https://avatars.githubusercontent.com/u/5013466?u=f46f9262437c7f899394561c2f2dcb7e4b669868&v=4)](https://github.com/Jped) [@Jped](https://github.com/Jped) [![](https://avatars.githubusercontent.com/u/24587702?u=bc1fe15724c747b755a5b3812e802d7cbdd134c2&v=4)](https://github.com/hughcrt) [@hughcrt](https://github.com/hughcrt) [![](https://avatars.githubusercontent.com/u/62176855?v=4)](https://github.com/cs0lar) [@cs0lar](https://github.com/cs0lar) [![](https://avatars.githubusercontent.com/u/141953346?u=ede12989daf498a2df632344378a57e4f2b4c317&v=4)](https://github.com/ShorthillsAI) [@ShorthillsAI](https://github.com/ShorthillsAI) [![](https://avatars.githubusercontent.com/u/35960?v=4)](https://github.com/bjchambers) [@bjchambers](https://github.com/bjchambers) [![](https://avatars.githubusercontent.com/u/24217337?u=09d0e274f382e264ef578e93b547fb55a5b179fe&v=4)](https://github.com/kylehh) [@kylehh](https://github.com/kylehh) [![](https://avatars.githubusercontent.com/u/22633385?u=29190f6c8aed91fa9574b064a9995f1e49944acf&v=4)](https://github.com/eltociear) [@eltociear](https://github.com/eltociear) [![](https://avatars.githubusercontent.com/u/53237856?u=656560c61bb540c9930574037126d2280ef0b4f8&v=4)](https://github.com/jeffvestal) [@jeffvestal](https://github.com/jeffvestal) [![](https://avatars.githubusercontent.com/u/32310964?u=56cd9386d632a330b8ecb180d7271b3d043c93a3&v=4)](https://github.com/VKudlay) [@VKudlay](https://github.com/VKudlay) [![](https://avatars.githubusercontent.com/u/25208228?u=a89453c38529259ef0ac9c6fd2a695311a680386&v=4)](https://github.com/conceptofmind) [@conceptofmind](https://github.com/conceptofmind) [![](https://avatars.githubusercontent.com/u/76683249?u=3f2d197d1391ab3d27cc8be37ac48e6912564204&v=4)](https://github.com/wenngong) [@wenngong](https://github.com/wenngong) [![](https://avatars.githubusercontent.com/u/154643880?u=3792a3c4581984a90f91ab05f720fd3d7b647d5b&v=4)](https://github.com/raveharpaz) [@raveharpaz](https://github.com/raveharpaz) [![](https://avatars.githubusercontent.com/u/22171838?u=a7c4ea3fcebeafc5e9857727974bf2a3362dafe4&v=4)](https://github.com/ruoccofabrizio) [@ruoccofabrizio](https://github.com/ruoccofabrizio) [![](https://avatars.githubusercontent.com/u/14010132?u=7b08fe21105fd9835fe7e7c55a2174f2ec4d0a91&v=4)](https://github.com/aayush3011) [@aayush3011](https://github.com/aayush3011) [![](https://avatars.githubusercontent.com/u/43506685?u=20e4be682f43988bd43b039a801856498e31c764&v=4)](https://github.com/Coniferish) [@Coniferish](https://github.com/Coniferish) [![](https://avatars.githubusercontent.com/u/67210837?u=7e6d3db8c71e8fdd631017b8c9f6b83248923007&v=4)](https://github.com/KyrianC) [@KyrianC](https://github.com/KyrianC) [![](https://avatars.githubusercontent.com/u/49201354?u=adef4744d1abcd52f751d21a30fbe52abddf9b94&v=4)](https://github.com/axiangcoding) [@axiangcoding](https://github.com/axiangcoding) [![](https://avatars.githubusercontent.com/u/73353463?u=b07dac98e10a359f1a21dc08e61144e3671ca22f&v=4)](https://github.com/hmasdev) [@hmasdev](https://github.com/hmasdev) [![](https://avatars.githubusercontent.com/u/2464556?u=4d6150c38daf305b43153112d1f2815d287273ea&v=4)](https://github.com/homanp) [@homanp](https://github.com/homanp) [![](https://avatars.githubusercontent.com/u/10434946?u=517fa2eeadb35b317ec479f813126cbd1c5cc86a&v=4)](https://github.com/yakigac) [@yakigac](https://github.com/yakigac) [![](https://avatars.githubusercontent.com/u/5001050?u=d5d0c24dc9566cec4b8e3cd376150c05b42c5210&v=4)](https://github.com/HunterGerlach) [@HunterGerlach](https://github.com/HunterGerlach) [![](https://avatars.githubusercontent.com/u/753206?u=911ac7819a0dcf86bd5fd8ad8e4f986e22b8579b&v=4)](https://github.com/gkorland) [@gkorland](https://github.com/gkorland) [![](https://avatars.githubusercontent.com/u/730013?v=4)](https://github.com/skozlovf) [@skozlovf](https://github.com/skozlovf) [![](https://avatars.githubusercontent.com/u/77560236?u=54a3bf63360d61f6571015dd46fa1d03460fbbc9&v=4)](https://github.com/Gordon-BP) [@Gordon-BP](https://github.com/Gordon-BP) [![](https://avatars.githubusercontent.com/u/18380243?u=746579a015b76842c0994cf04c623e683444fc90&v=4)](https://github.com/kzk-maeda) [@kzk-maeda](https://github.com/kzk-maeda) [![](https://avatars.githubusercontent.com/u/12809212?u=8c1f0baf8a29f3007e3a51f5cf7b4a8e04c5ca8d&v=4)](https://github.com/parambharat) [@parambharat](https://github.com/parambharat) [![](https://avatars.githubusercontent.com/u/737181?u=037bd3004f6c333108d7b32a4c8f96f2e8d57e78&v=4)](https://github.com/caseyclements) [@caseyclements](https://github.com/caseyclements) [![](https://avatars.githubusercontent.com/u/8893086?u=220ec6df446248eeb09a59230c017a2c57bf8e61&v=4)](https://github.com/saginawj) [@saginawj](https://github.com/saginawj) [![](https://avatars.githubusercontent.com/u/81822489?u=07badfd993685a278b1f929c1500a58837a6621d&v=4)](https://github.com/filip-halt) [@filip-halt](https://github.com/filip-halt) [![](https://avatars.githubusercontent.com/u/40636930?u=b1f3735dccd19433cc3aad1b673553bf7eb94723&v=4)](https://github.com/zachschillaci27) [@zachschillaci27](https://github.com/zachschillaci27) [![](https://avatars.githubusercontent.com/u/33070862?v=4)](https://github.com/cwlacewe) [@cwlacewe](https://github.com/cwlacewe) [![](https://avatars.githubusercontent.com/u/3032459?u=590f1489107c91803bbe75de26cfeeeb77b25f8d&v=4)](https://github.com/nelly-hateva) [@nelly-hateva](https://github.com/nelly-hateva) [![](https://avatars.githubusercontent.com/u/82044803?u=451c2955f0862cccf64cac30e062570d208d6903&v=4)](https://github.com/serena-ruan) [@serena-ruan](https://github.com/serena-ruan) [![](https://avatars.githubusercontent.com/u/38650638?u=2b526137f18a7c41934c8da0722f1fedb74c3422&v=4)](https://github.com/wemysschen) [@wemysschen](https://github.com/wemysschen) [![](https://avatars.githubusercontent.com/u/339166?u=9736b363a1200d66058ff83c58921b19d51c474f&v=4)](https://github.com/alexsherstinsky) [@alexsherstinsky](https://github.com/alexsherstinsky) [![](https://avatars.githubusercontent.com/u/22759784?v=4)](https://github.com/zanderchase) [@zanderchase](https://github.com/zanderchase) [![](https://avatars.githubusercontent.com/u/167348611?v=4)](https://github.com/dglogo) [@dglogo](https://github.com/dglogo) [![](https://avatars.githubusercontent.com/u/5894042?u=e34704516e5f58e932ce098a38747a9be8d614a5&v=4)](https://github.com/danielhjz) [@danielhjz](https://github.com/danielhjz) [![](https://avatars.githubusercontent.com/u/39944763?u=3074327b189542c2b47bb385b2d81d1e8ccb38e1&v=4)](https://github.com/os1ma) [@os1ma](https://github.com/os1ma) [![](https://avatars.githubusercontent.com/u/112245?u=c129f9b2439b082cca4a7a322e558fca514bb87d&v=4)](https://github.com/cevian) [@cevian](https://github.com/cevian) [![](https://avatars.githubusercontent.com/u/1309177?u=6328c998d93a48eba87c6b039783b8a7644c62c3&v=4)](https://github.com/charliermarsh) [@charliermarsh](https://github.com/charliermarsh) [![](https://avatars.githubusercontent.com/u/63123596?u=ae18d496d5a6ced90d57c147f102f7c5ecf8e63f&v=4)](https://github.com/maximeperrindev) [@maximeperrindev](https://github.com/maximeperrindev) [![](https://avatars.githubusercontent.com/u/3760?u=1dfde576ef286346afcc2a71eaf1fdb2857fb547&v=4)](https://github.com/bborn) [@bborn](https://github.com/bborn) [![](https://avatars.githubusercontent.com/u/34462078?u=20243a60ac608142887c14251502c2a975614ba3&v=4)](https://github.com/raghavdixit99) [@raghavdixit99](https://github.com/raghavdixit99) [![](https://avatars.githubusercontent.com/u/35945268?u=4379ecd5062eea0f6449c520ddde5fe1e3724500&v=4)](https://github.com/junkeon) [@junkeon](https://github.com/junkeon) [![](https://avatars.githubusercontent.com/u/129657162?u=353d87b0e8d4c628536e2e40a34a7622dc3c18ab&v=4)](https://github.com/jj701) [@jj701](https://github.com/jj701) [![](https://avatars.githubusercontent.com/u/26039352?v=4)](https://github.com/cauwulixuan) [@cauwulixuan](https://github.com/cauwulixuan) [![](https://avatars.githubusercontent.com/u/6406557?v=4)](https://github.com/markcusack) [@markcusack](https://github.com/markcusack) [![](https://avatars.githubusercontent.com/u/24482442?u=d6095b9533599b26d16fe6273d8f513206976a62&v=4)](https://github.com/rohanaggarwal7997) [@rohanaggarwal7997](https://github.com/rohanaggarwal7997) [![](https://avatars.githubusercontent.com/u/347398?v=4)](https://github.com/delip) [@delip](https://github.com/delip) [![](https://avatars.githubusercontent.com/u/757060?u=0c7583422d4c2b5572616f9e542e110bf5dd15f7&v=4)](https://github.com/ichernev) [@ichernev](https://github.com/ichernev) [![](https://avatars.githubusercontent.com/u/5794505?u=2f702037cd4ee069d1a3156d9521ce5dec25249f&v=4)](https://github.com/MartinKolbAtWork) [@MartinKolbAtWork](https://github.com/MartinKolbAtWork) [![](https://avatars.githubusercontent.com/u/1812592?v=4)](https://github.com/kennethchoe) [@kennethchoe](https://github.com/kennethchoe) [![](https://avatars.githubusercontent.com/u/70973560?u=1a40b7be391714894999b7412de2e281abad530e&v=4)](https://github.com/amiaxys) [@amiaxys](https://github.com/amiaxys) [![](https://avatars.githubusercontent.com/u/891664?u=722172a0061f68ab22819fa88a354ec973f70a63&v=4)](https://github.com/jeffchuber) [@jeffchuber](https://github.com/jeffchuber) [![](https://avatars.githubusercontent.com/u/1995599?v=4)](https://github.com/shane-huang) [@shane-huang](https://github.com/shane-huang) [![](https://avatars.githubusercontent.com/u/14149230?u=ca710ca2a64391470163ddef6b5ea7633ab26872&v=4)](https://github.com/cbh123) [@cbh123](https://github.com/cbh123) [![](https://avatars.githubusercontent.com/u/17517367?u=b745b5f2016fbf166a75ce6ec18853c2fe7bbf12&v=4)](https://github.com/sdelgadoc) [@sdelgadoc](https://github.com/sdelgadoc) [![](https://avatars.githubusercontent.com/u/63742054?u=befe4ae74b906698be965bad482d0e02fc7707ab&v=4)](https://github.com/Nutlope) [@Nutlope](https://github.com/Nutlope) [![](https://avatars.githubusercontent.com/u/951187?u=e80c215810058f57145042d12360d463e3a53443&v=4)](https://github.com/jirimoravcik) [@jirimoravcik](https://github.com/jirimoravcik) [![](https://avatars.githubusercontent.com/u/75213811?v=4)](https://github.com/kitrak-rev) [@kitrak-rev](https://github.com/kitrak-rev) [![](https://avatars.githubusercontent.com/u/3045965?u=3d3c34259d50723955dd92d1de5be21236989356&v=4)](https://github.com/chadj2) [@chadj2](https://github.com/chadj2) [![](https://avatars.githubusercontent.com/u/1157440?u=2f81a28298c1172e732898a1f8e800342434801d&v=4)](https://github.com/tazarov) [@tazarov](https://github.com/tazarov) [![](https://avatars.githubusercontent.com/u/57731498?u=fec622b37ca3dc04125144116ad5165f37f85823&v=4)](https://github.com/mattgotteiner) [@mattgotteiner](https://github.com/mattgotteiner) [![](https://avatars.githubusercontent.com/u/85610855?v=4)](https://github.com/am-kinetica) [@am-kinetica](https://github.com/am-kinetica) [![](https://avatars.githubusercontent.com/u/139942740?u=fa99ca083ccdc7322c7b24f8a3c001e71be347b4&v=4)](https://github.com/baichuan-assistant) [@baichuan-assistant](https://github.com/baichuan-assistant) [![](https://avatars.githubusercontent.com/u/22965499?u=36d1ebd75bca4cb50c578fef6faed9357cfef86a&v=4)](https://github.com/sfvaroglu) [@sfvaroglu](https://github.com/sfvaroglu) [![](https://avatars.githubusercontent.com/u/116604821?u=ec1518c27a7a15f33a138cf0b956ef1758edbaff&v=4)](https://github.com/sfc-gh-jcarroll) [@sfc-gh-jcarroll](https://github.com/sfc-gh-jcarroll) [![](https://avatars.githubusercontent.com/u/20006225?u=b5c543736384589fcb5b547f0d7700e545cb41ba&v=4)](https://github.com/jeffzwang) [@jeffzwang](https://github.com/jeffzwang) [![](https://avatars.githubusercontent.com/u/128378696?u=8c818bd39c9cd75b606f3b5b1479787e4e6845d9&v=4)](https://github.com/BeatrixCohere) [@BeatrixCohere](https://github.com/BeatrixCohere) [![](https://avatars.githubusercontent.com/u/1465768?u=642a7b963f24fd2caaa744eee90a7157322e22db&v=4)](https://github.com/mainred) [@mainred](https://github.com/mainred) [![](https://avatars.githubusercontent.com/u/57228345?v=4)](https://github.com/CahidArda) [@CahidArda](https://github.com/CahidArda) [![](https://avatars.githubusercontent.com/u/38215315?u=3985b6a3ecb0e8338c5912ea9e20787152d0ad7a&v=4)](https://github.com/P-E-B) [@P-E-B](https://github.com/P-E-B) [![](https://avatars.githubusercontent.com/u/43734688?u=78f139fa940620e301361a58821c9f56128f71d9&v=4)](https://github.com/sam-h-bean) [@sam-h-bean](https://github.com/sam-h-bean) [![](https://avatars.githubusercontent.com/u/60664495?u=ace0011a868848b48cdf9c199110dc8e5be5f433&v=4)](https://github.com/williamdevena) [@williamdevena](https://github.com/williamdevena) [![](https://avatars.githubusercontent.com/u/31483888?u=55359c6f832dfed3abf0e89ea9842ec88849341d&v=4)](https://github.com/filip-michalsky) [@filip-michalsky](https://github.com/filip-michalsky) [![](https://avatars.githubusercontent.com/u/3207674?v=4)](https://github.com/k8si) [@k8si](https://github.com/k8si) [![](https://avatars.githubusercontent.com/u/7287580?u=5fe01002eec3d9df91ce3cef0016916554379efd&v=4)](https://github.com/edwardzjl) [@edwardzjl](https://github.com/edwardzjl) [![](https://avatars.githubusercontent.com/u/26054637?u=edd1e4f54e91b549f2edb525d43210f4f04d7367&v=4)](https://github.com/paul-paliychuk) [@paul-paliychuk](https://github.com/paul-paliychuk) [![](https://avatars.githubusercontent.com/u/4133076?u=f3f783e0364abe955dbde6af80445ea27d948fdd&v=4)](https://github.com/gregnr) [@gregnr](https://github.com/gregnr) [![](https://avatars.githubusercontent.com/u/70665700?u=d7c78b0f3e6c5b1f359d574cd03bdb75bf6bf2da&v=4)](https://github.com/asamant21) [@asamant21](https://github.com/asamant21) [![](https://avatars.githubusercontent.com/u/12044110?v=4)](https://github.com/sudranga) [@sudranga](https://github.com/sudranga) [![](https://avatars.githubusercontent.com/u/5168949?v=4)](https://github.com/sseide) [@sseide](https://github.com/sseide) [![](https://avatars.githubusercontent.com/u/216931?u=a8ca27d75e1765295ea9d23c191d8db834951066&v=4)](https://github.com/scottnath) [@scottnath](https://github.com/scottnath) [![](https://avatars.githubusercontent.com/u/125713079?u=d42f76da6ffe0be48277c5ebdec4684ff1b38415&v=4)](https://github.com/AI-Bassem) [@AI-Bassem](https://github.com/AI-Bassem) [![](https://avatars.githubusercontent.com/u/32453863?v=4)](https://github.com/BeautyyuYanli) [@BeautyyuYanli](https://github.com/BeautyyuYanli) [![](https://avatars.githubusercontent.com/u/1074525?v=4)](https://github.com/gradenr) [@gradenr](https://github.com/gradenr) [![](https://avatars.githubusercontent.com/u/4787922?u=dd4c7a18d86a6ad56455aa13e66daedbbbcf31b7&v=4)](https://github.com/zhaoshengbo) [@zhaoshengbo](https://github.com/zhaoshengbo) [![](https://avatars.githubusercontent.com/u/14350521?u=4d5e9bb44d41a1ff30f2efbb2959a21e33644e81&v=4)](https://github.com/hakantekgul) [@hakantekgul](https://github.com/hakantekgul) [![](https://avatars.githubusercontent.com/u/142571618?v=4)](https://github.com/eryk-dsai) [@eryk-dsai](https://github.com/eryk-dsai) [![](https://avatars.githubusercontent.com/u/3469711?u=6962798c0280caa0d0260ccb8be1b18fb3ea44b2&v=4)](https://github.com/mrtj) [@mrtj](https://github.com/mrtj) [![](https://avatars.githubusercontent.com/u/5069448?u=6b0ba426b68777f4935399013b7c2c112635c0df&v=4)](https://github.com/pcliupc) [@pcliupc](https://github.com/pcliupc) [![](https://avatars.githubusercontent.com/u/36760800?u=12735f9035294180cb0b83446bdf7d8ac1a3fef9&v=4)](https://github.com/alvarobartt) [@alvarobartt](https://github.com/alvarobartt) [![](https://avatars.githubusercontent.com/u/124558887?u=843f9f9de97097d85d0f685e0916d58196554421&v=4)](https://github.com/rogerserper) [@rogerserper](https://github.com/rogerserper) [![](https://avatars.githubusercontent.com/u/320302?u=657574cdbadd4bfb4c8ed65f8646d4983d7ca5f0&v=4)](https://github.com/ekzhu) [@ekzhu](https://github.com/ekzhu) [![](https://avatars.githubusercontent.com/u/139821907?u=f6f9648457adc2c15f407bb06d29089ae7e6f4cf&v=4)](https://github.com/ashleyxuu) [@ashleyxuu](https://github.com/ashleyxuu) [![](https://avatars.githubusercontent.com/u/4036753?u=c6732c896b41c1ecec917bfae38aa6900585c632&v=4)](https://github.com/bhalder) [@bhalder](https://github.com/bhalder) [![](https://avatars.githubusercontent.com/u/17904229?u=3c9fa8237a9d29136d3bd1dd2a380ff6dddb5d94&v=4)](https://github.com/ZixinYang) [@ZixinYang](https://github.com/ZixinYang) [![](https://avatars.githubusercontent.com/u/48101485?u=dcf140777416a7d86a450964fc53ec5b17668603&v=4)](https://github.com/nikhilkjha) [@nikhilkjha](https://github.com/nikhilkjha) [![](https://avatars.githubusercontent.com/u/43818888?u=0c01fad081c0abd23d2d49ea4496890ffbc22325&v=4)](https://github.com/Dominastorm) [@Dominastorm](https://github.com/Dominastorm) [![](https://avatars.githubusercontent.com/u/13537446?v=4)](https://github.com/raunakshrivastava7) [@raunakshrivastava7](https://github.com/raunakshrivastava7) [![](https://avatars.githubusercontent.com/u/121117945?v=4)](https://github.com/rodrigo-f-nogueira) [@rodrigo-f-nogueira](https://github.com/rodrigo-f-nogueira) [![](https://avatars.githubusercontent.com/u/1585539?u=654a21985c875f78a20eda7e4884e8d64de86fba&v=4)](https://github.com/benjibc) [@benjibc](https://github.com/benjibc) [![](https://avatars.githubusercontent.com/u/53276514?u=d08fad4653e8d1b89382507a07f6990437730433&v=4)](https://github.com/hoyungcher) [@hoyungcher](https://github.com/hoyungcher) [![](https://avatars.githubusercontent.com/u/41710527?u=788f651d9933b36523feb431811a6531ecd994f1&v=4)](https://github.com/OwenPendrighElliott) [@OwenPendrighElliott](https://github.com/OwenPendrighElliott) [![](https://avatars.githubusercontent.com/u/8142467?u=a62a20762c7fd841b470efc0ebdf5e1a01816f87&v=4)](https://github.com/Mikelarg) [@Mikelarg](https://github.com/Mikelarg) [![](https://avatars.githubusercontent.com/u/10937540?u=fcc094d7dfef2d3778c989def06199d9dc84fb61&v=4)](https://github.com/freemso) [@freemso](https://github.com/freemso) [![](https://avatars.githubusercontent.com/u/8862797?u=1856f20a3ac7425e75df7860bfd8934278fbdd53&v=4)](https://github.com/netoferraz) [@netoferraz](https://github.com/netoferraz) [![](https://avatars.githubusercontent.com/u/3625100?u=b219abaae5763632a0edf8d79b46dca035f166a4&v=4)](https://github.com/zizhong) [@zizhong](https://github.com/zizhong) [![](https://avatars.githubusercontent.com/u/81076998?v=4)](https://github.com/amicus-veritatis) [@amicus-veritatis](https://github.com/amicus-veritatis) [![](https://avatars.githubusercontent.com/u/18572161?u=a09c7a053aa54cfc62ff8530c81486441215a09c&v=4)](https://github.com/MikeNitsenko) [@MikeNitsenko](https://github.com/MikeNitsenko) [![](https://avatars.githubusercontent.com/u/7851093?u=ab3c2c9c6ebd0cd1cd3ff2f83f8618ab9b2550ad&v=4)](https://github.com/liangz1) [@liangz1](https://github.com/liangz1) [![](https://avatars.githubusercontent.com/u/7953259?u=a451fad7ad197a8920651cf89aaf5d950734d0a8&v=4)](https://github.com/mikelambert) [@mikelambert](https://github.com/mikelambert) [![](https://avatars.githubusercontent.com/u/23314389?u=2014e20e246530fa89bd902fe703b6f9e6ecf833&v=4)](https://github.com/nicoloboschi) [@nicoloboschi](https://github.com/nicoloboschi) [![](https://avatars.githubusercontent.com/u/136885?u=9a42f56ad8055a03a5ae8a0272e66d1ae4ac083c&v=4)](https://github.com/mkorpela) [@mkorpela](https://github.com/mkorpela) [![](https://avatars.githubusercontent.com/u/31125281?u=1bc56191c789906c2a11a4183c108b2784609015&v=4)](https://github.com/linancn) [@linancn](https://github.com/linancn) [![](https://avatars.githubusercontent.com/u/101817?u=39f31ff29d2589046148c6ed1c1c923982d86b1a&v=4)](https://github.com/tsg) [@tsg](https://github.com/tsg) [![](https://avatars.githubusercontent.com/u/51159628?u=5aec3cf0263e77234dd83f8e6bf4955e39acd472&v=4)](https://github.com/anar2706) [@anar2706](https://github.com/anar2706) [![](https://avatars.githubusercontent.com/u/79988483?u=7b1cf8516362448115fc68870ad006a37a99d549&v=4)](https://github.com/yifeis7) [@yifeis7](https://github.com/yifeis7) [![](https://avatars.githubusercontent.com/u/908389?v=4)](https://github.com/whitead) [@whitead](https://github.com/whitead) [![](https://avatars.githubusercontent.com/u/89472452?u=47bcc0d72d51f2f914a759a0fde9ef3d1c677b98&v=4)](https://github.com/benitoThree) [@benitoThree](https://github.com/benitoThree) [![](https://avatars.githubusercontent.com/u/3300000?v=4)](https://github.com/ruze00) [@ruze00](https://github.com/ruze00) [![](https://avatars.githubusercontent.com/u/53417823?v=4)](https://github.com/HeChangHaoGary) [@HeChangHaoGary](https://github.com/HeChangHaoGary) [![](https://avatars.githubusercontent.com/u/2851934?u=01c0d440fcb7fdb3159a7b641c58b5595028e9bc&v=4)](https://github.com/xiaoyuxee) [@xiaoyuxee](https://github.com/xiaoyuxee) [![](https://avatars.githubusercontent.com/u/15706966?u=f6dd024f1fc955b7d411eb13ebcae7334b527063&v=4)](https://github.com/jerwelborn) [@jerwelborn](https://github.com/jerwelborn) [![](https://avatars.githubusercontent.com/u/65446134?u=a292659bc2611825b65a56a7ee6bfe6fdbfa033b&v=4)](https://github.com/vairodp) [@vairodp](https://github.com/vairodp) [![](https://avatars.githubusercontent.com/u/23406704?u=ac10555099789a8423dbc205ab4257b40aaf3860&v=4)](https://github.com/aletna) [@aletna](https://github.com/aletna) [![](https://avatars.githubusercontent.com/u/2398765?u=0c438bd074b242c5896334e6da1f0801c2f581e4&v=4)](https://github.com/hsm207) [@hsm207](https://github.com/hsm207) [![](https://avatars.githubusercontent.com/u/34411969?u=ae4aac513e377777fd6e46980e0e9414cdcd6f96&v=4)](https://github.com/DayuanJiang) [@DayuanJiang](https://github.com/DayuanJiang) [![](https://avatars.githubusercontent.com/u/7080882?u=f985127fd58fa96b886d591ce104f29f3bd7f81f&v=4)](https://github.com/rigazilla) [@rigazilla](https://github.com/rigazilla) [![](https://avatars.githubusercontent.com/u/4726889?u=1db838ee4066c26d5c0fa02311c7895c36969fb7&v=4)](https://github.com/apepkuss) [@apepkuss](https://github.com/apepkuss) [![](https://avatars.githubusercontent.com/u/69025547?u=97202d8501d38ed5015cfb3c40cf0ba2daeb795c&v=4)](https://github.com/gadhagod) [@gadhagod](https://github.com/gadhagod) [![](https://avatars.githubusercontent.com/u/839799?u=e12646ad6aa244d58cf5fa624dc2933c95acaad9&v=4)](https://github.com/LastMonopoly) [@LastMonopoly](https://github.com/LastMonopoly) [![](https://avatars.githubusercontent.com/u/91019033?u=30944d2fcb8759eefe2efa26c4d07b218d25ae33&v=4)](https://github.com/matthewdeguzman) [@matthewdeguzman](https://github.com/matthewdeguzman) [![](https://avatars.githubusercontent.com/u/13414571?u=c5490c987e1bcf8d47d7ecc4dca3812a21713f3a&v=4)](https://github.com/Tokkiu) [@Tokkiu](https://github.com/Tokkiu) [![](https://avatars.githubusercontent.com/u/100361543?u=f022d60888add75594372c5e8ebb32fc7fdc2794&v=4)](https://github.com/softboyjimbo) [@softboyjimbo](https://github.com/softboyjimbo) [![](https://avatars.githubusercontent.com/u/56953648?v=4)](https://github.com/Dobiichi-Origami) [@Dobiichi-Origami](https://github.com/Dobiichi-Origami) [![](https://avatars.githubusercontent.com/u/96572405?u=7784695f37788fb8048f6ce213bf1df3d4713f2d&v=4)](https://github.com/zhanghexian) [@zhanghexian](https://github.com/zhanghexian) [![](https://avatars.githubusercontent.com/u/117737297?u=0adf0f84cc345cc6e2ca3e4ad3c27a9ca8f53472&v=4)](https://github.com/rajtilakjee) [@rajtilakjee](https://github.com/rajtilakjee) [![](https://avatars.githubusercontent.com/u/1983160?u=536f2558c6ac33b74a6d89520dcb27ba46954070&v=4)](https://github.com/ashvardanian) [@ashvardanian](https://github.com/ashvardanian) [![](https://avatars.githubusercontent.com/u/4983896?u=4a0ba92f5b46b0c805a3c4715748f042a8c769a0&v=4)](https://github.com/plv) [@plv](https://github.com/plv) [![](https://avatars.githubusercontent.com/u/872712?u=c6e76fb451e3a0c1528a8d0e95ef3ed669483690&v=4)](https://github.com/TomTom101) [@TomTom101](https://github.com/TomTom101) [![](https://avatars.githubusercontent.com/u/47258766?u=4d98445aff6d752476aaf6ec88ec000496db7677&v=4)](https://github.com/lucas-tucker) [@lucas-tucker](https://github.com/lucas-tucker) [![](https://avatars.githubusercontent.com/u/19825685?u=c9346281a8534aeaf9f112c0f7ca749de5cb8e23&v=4)](https://github.com/JoanFM) [@JoanFM](https://github.com/JoanFM) [![](https://avatars.githubusercontent.com/u/829644?u=56a7fd939b2d15ed21011497db77ad3f569e8a60&v=4)](https://github.com/mengxr) [@mengxr](https://github.com/mengxr) [![](https://avatars.githubusercontent.com/u/110841617?u=e473cda5a87ca1dae11082c11db9c1ed1f4c7032&v=4)](https://github.com/erika-cardenas) [@erika-cardenas](https://github.com/erika-cardenas) [![](https://avatars.githubusercontent.com/u/43986145?u=3d15192e4d6ae36696e49e6c061d29f074f5ba77&v=4)](https://github.com/juliuslipp) [@juliuslipp](https://github.com/juliuslipp) [![](https://avatars.githubusercontent.com/u/1078320?u=786a976f97c3b9a75bd7467579d77e303d2acc8d&v=4)](https://github.com/pors) [@pors](https://github.com/pors) [![](https://avatars.githubusercontent.com/u/22906652?u=bee195145bb46c722da707939100f3a5a46fc8b9&v=4)](https://github.com/shivanimodi16) [@shivanimodi16](https://github.com/shivanimodi16) [![](https://avatars.githubusercontent.com/u/11373553?u=cebc40130d1da9f7ac666a2f6237a3c1148f65ef&v=4)](https://github.com/thomas0809) [@thomas0809](https://github.com/thomas0809) [![](https://avatars.githubusercontent.com/u/55012400?u=0a53d356ee0f3babed5fd7b3aec73a9e6b1724e6&v=4)](https://github.com/azamiftikhar1000) [@azamiftikhar1000](https://github.com/azamiftikhar1000) [![](https://avatars.githubusercontent.com/u/135340?v=4)](https://github.com/alecf) [@alecf](https://github.com/alecf) [![](https://avatars.githubusercontent.com/u/1555858?v=4)](https://github.com/prakul) [@prakul](https://github.com/prakul) [![](https://avatars.githubusercontent.com/u/54161268?v=4)](https://github.com/Oscilloscope98) [@Oscilloscope98](https://github.com/Oscilloscope98) [![](https://avatars.githubusercontent.com/u/6756744?u=f576bd2ad9bb2ebfc8d45feb4a49e8add9ae79dc&v=4)](https://github.com/ecneladis) [@ecneladis](https://github.com/ecneladis) [![](https://avatars.githubusercontent.com/u/72488598?u=98dc24a63369cbae14913caff5f379f80f305aab&v=4)](https://github.com/Undertone0809) [@Undertone0809](https://github.com/Undertone0809) [![](https://avatars.githubusercontent.com/u/45447813?u=6d1f8b455599848e6cd9c2410ba5f4f02d2d368c&v=4)](https://github.com/hetaoBackend) [@hetaoBackend](https://github.com/hetaoBackend) [![](https://avatars.githubusercontent.com/u/16384755?v=4)](https://github.com/RichmondAlake) [@RichmondAlake](https://github.com/RichmondAlake) [![](https://avatars.githubusercontent.com/u/1636116?u=617e8ebbd68598aada3a04642e7801c6b1dda152&v=4)](https://github.com/yackermann) [@yackermann](https://github.com/yackermann) [![](https://avatars.githubusercontent.com/u/5798036?u=4eba31d63c3818d17fb8f9aa923599ac63ebfea8&v=4)](https://github.com/lesters) [@lesters](https://github.com/lesters) [![](https://avatars.githubusercontent.com/u/115359769?v=4)](https://github.com/max-arthurai) [@max-arthurai](https://github.com/max-arthurai) [![](https://avatars.githubusercontent.com/u/98474633?u=32ebf212dfc4d68c87f864c7d5bb9967ac85c96e&v=4)](https://github.com/philipkiely-baseten) [@philipkiely-baseten](https://github.com/philipkiely-baseten) [![](https://avatars.githubusercontent.com/u/58721149?v=4)](https://github.com/dristysrivastava) [@dristysrivastava](https://github.com/dristysrivastava) [![](https://avatars.githubusercontent.com/u/45048633?v=4)](https://github.com/schadem) [@schadem](https://github.com/schadem) [![](https://avatars.githubusercontent.com/u/127325395?u=9e47d0d3ab45b1601c17f258229098681bb78911&v=4)](https://github.com/Aratako) [@Aratako](https://github.com/Aratako) [![](https://avatars.githubusercontent.com/u/4067380?u=2776e796abeb0dfa8371dd528165ff0d96024a83&v=4)](https://github.com/anubhav94N) [@anubhav94N](https://github.com/anubhav94N) [![](https://avatars.githubusercontent.com/u/81988348?v=4)](https://github.com/rithwik-db) [@rithwik-db](https://github.com/rithwik-db) [![](https://avatars.githubusercontent.com/u/50788154?u=f924ef4e8d2b47be96f7a4b4357d17b6fafaea80&v=4)](https://github.com/kartheekyakkala) [@kartheekyakkala](https://github.com/kartheekyakkala) [![](https://avatars.githubusercontent.com/u/105399924?u=e69e8f1af87a33af3ecbdd5b5d4327c6dc254df6&v=4)](https://github.com/jiayini1119) [@jiayini1119](https://github.com/jiayini1119) [![](https://avatars.githubusercontent.com/u/11540660?u=efe357bf4cbe05c882528cc3ad78214776b80158&v=4)](https://github.com/shufanhao) [@shufanhao](https://github.com/shufanhao) [![](https://avatars.githubusercontent.com/u/13724617?v=4)](https://github.com/zcgeng) [@zcgeng](https://github.com/zcgeng) [![](https://avatars.githubusercontent.com/u/93145909?u=38b3ccf07a613963e9897627f940912128b7a83a&v=4)](https://github.com/ash0ts) [@ash0ts](https://github.com/ash0ts) [![](https://avatars.githubusercontent.com/u/119620994?u=ac3dfad90764c69144f593023fce93080586702e&v=4)](https://github.com/Honkware) [@Honkware](https://github.com/Honkware) [![](https://avatars.githubusercontent.com/u/4524535?u=6a41acd9f233fa9e62294d5534d1f2f52faa6b78&v=4)](https://github.com/dwhitena) [@dwhitena](https://github.com/dwhitena) [![](https://avatars.githubusercontent.com/u/21286981?v=4)](https://github.com/SagarBM396) [@SagarBM396](https://github.com/SagarBM396) [![](https://avatars.githubusercontent.com/u/88007022?u=1d49b0aa10dcff5b6661b211331334c165c56f28&v=4)](https://github.com/jamie256) [@jamie256](https://github.com/jamie256) [![](https://avatars.githubusercontent.com/u/2283778?u=0c5a2a583bc77b138b346c5974551ac459059026&v=4)](https://github.com/yanghua) [@yanghua](https://github.com/yanghua) [![](https://avatars.githubusercontent.com/u/160584887?v=4)](https://github.com/miri-bar) [@miri-bar](https://github.com/miri-bar) [![](https://avatars.githubusercontent.com/u/62718109?u=ab38af3009ae3adcff49a309580e55bc6f586ba2&v=4)](https://github.com/klein-t) [@klein-t](https://github.com/klein-t) [![](https://avatars.githubusercontent.com/u/13636019?v=4)](https://github.com/Ayan-Bandyopadhyay) [@Ayan-Bandyopadhyay](https://github.com/Ayan-Bandyopadhyay) [![](https://avatars.githubusercontent.com/u/27293258?u=3349429e2b89bb75f144bb22c4015d9b676f3fca&v=4)](https://github.com/tugot17) [@tugot17](https://github.com/tugot17) [![](https://avatars.githubusercontent.com/u/841146?v=4)](https://github.com/DaveDeCaprio) [@DaveDeCaprio](https://github.com/DaveDeCaprio) [![](https://avatars.githubusercontent.com/u/13009163?u=c2b3a11cceaadbc9415f545b971250c9e2b2078b&v=4)](https://github.com/Spartee) [@Spartee](https://github.com/Spartee) [![](https://avatars.githubusercontent.com/u/22459070?u=c541f86a16a5b46ae138a7bf1efdce36dd413f24&v=4)](https://github.com/Jflick58) [@Jflick58](https://github.com/Jflick58) [![](https://avatars.githubusercontent.com/u/20140126?u=d1b9220a46efe488dc3db52e5d92774d85d38dfc&v=4)](https://github.com/JuHyung-Son) [@JuHyung-Son](https://github.com/JuHyung-Son) [![](https://avatars.githubusercontent.com/u/949393?u=66d8768dc44519c956069acd88cfb1b0dca646f8&v=4)](https://github.com/stewartjarod) [@stewartjarod](https://github.com/stewartjarod) [![](https://avatars.githubusercontent.com/u/807522?u=03c5551457e21c3c3a2dd8cbbe35eb6183feb3ed&v=4)](https://github.com/mkhludnev) [@mkhludnev](https://github.com/mkhludnev) [![](https://avatars.githubusercontent.com/u/8279655?v=4)](https://github.com/cxumol) [@cxumol](https://github.com/cxumol) [![](https://avatars.githubusercontent.com/u/31288628?u=acdfcef703b0d07b69e70e32e20130c05a56a549&v=4)](https://github.com/rihardsgravis) [@rihardsgravis](https://github.com/rihardsgravis) [![](https://avatars.githubusercontent.com/u/31483498?u=aa8561cc1055386d7753a7f82bf823bbdbae4919&v=4)](https://github.com/kouroshHakha) [@kouroshHakha](https://github.com/kouroshHakha) [![](https://avatars.githubusercontent.com/u/6432132?v=4)](https://github.com/samnoyes) [@samnoyes](https://github.com/samnoyes) [![](https://avatars.githubusercontent.com/u/24364830?u=5e3cbf0c6171ba947d65fc9fa6fdff6612ae4af5&v=4)](https://github.com/ByronHsu) [@ByronHsu](https://github.com/ByronHsu) [![](https://avatars.githubusercontent.com/u/28208564?u=ab938a1030cc6d630609a6d76b1ada65a3009020&v=4)](https://github.com/O-Roma) [@O-Roma](https://github.com/O-Roma) [![](https://avatars.githubusercontent.com/u/808798?u=8a25786f1b28a0ddf171299eee7c14d9e9f2939b&v=4)](https://github.com/rowillia) [@rowillia](https://github.com/rowillia) [![](https://avatars.githubusercontent.com/u/13447955?v=4)](https://github.com/lesterpjy) [@lesterpjy](https://github.com/lesterpjy) [![](https://avatars.githubusercontent.com/u/19216250?u=85921f52a4be080e3529d87d3e3e75bf83847b24&v=4)](https://github.com/junefish) [@junefish](https://github.com/junefish) [![](https://avatars.githubusercontent.com/u/107998986?u=70520f8a4ad962c0fc2706649ec401b274681927&v=4)](https://github.com/2jimoo) [@2jimoo](https://github.com/2jimoo) [![](https://avatars.githubusercontent.com/u/55656?u=b9b6aa80966abd617ffed498f3a15b20d3644604&v=4)](https://github.com/petervandenabeele) [@petervandenabeele](https://github.com/petervandenabeele) [![](https://avatars.githubusercontent.com/u/17451563?v=4)](https://github.com/shahrin014) [@shahrin014](https://github.com/shahrin014) [![](https://avatars.githubusercontent.com/u/3849275?u=5de71c0b6eaea94c0460c1dc18a1a346168f8720&v=4)](https://github.com/shoelsch) [@shoelsch](https://github.com/shoelsch) [![](https://avatars.githubusercontent.com/u/45851384?u=c9c158b6040b1fd8ae5543bad513260e157d5892&v=4)](https://github.com/h0rv) [@h0rv](https://github.com/h0rv) [![](https://avatars.githubusercontent.com/u/18037290?u=dc663a40d4767317b6ab61e88221609e58e9371e&v=4)](https://github.com/asai95) [@asai95](https://github.com/asai95) [![](https://avatars.githubusercontent.com/u/3195154?u=baa3820b95103662bc2aca01959e41aa651764b5&v=4)](https://github.com/mgoin) [@mgoin](https://github.com/mgoin) [![](https://avatars.githubusercontent.com/u/23445657?u=84dda94e9330c5538ea94099b5cae699c88586f8&v=4)](https://github.com/Blaizzy) [@Blaizzy](https://github.com/Blaizzy) [![](https://avatars.githubusercontent.com/u/38002468?u=dd6ba12322fa2ee0d88e83a3773c8abc13ec37af&v=4)](https://github.com/akmhmgc) [@akmhmgc](https://github.com/akmhmgc) [![](https://avatars.githubusercontent.com/u/4693180?u=8cf781d9099d6e2f2d2caf7612a5c2811ba13ef8&v=4)](https://github.com/gmpetrov) [@gmpetrov](https://github.com/gmpetrov) [![](https://avatars.githubusercontent.com/u/29749331?u=a7f4d7db2faa6af42af8d43b2737b5547d36154d&v=4)](https://github.com/aarnphm) [@aarnphm](https://github.com/aarnphm) [![](https://avatars.githubusercontent.com/u/43019056?u=9066bb1f7b39a46309c387650c0ce5b7423f79da&v=4)](https://github.com/aMahanna) [@aMahanna](https://github.com/aMahanna) [![](https://avatars.githubusercontent.com/u/39014459?u=122f72136fae112def3f40455aec55a5b99920f8&v=4)](https://github.com/hp0404) [@hp0404](https://github.com/hp0404) [![](https://avatars.githubusercontent.com/u/2098020?u=0e1ecc0cc5eab98d93c0eaa7e210a1de937d95d9&v=4)](https://github.com/liushuaikobe) [@liushuaikobe](https://github.com/liushuaikobe) [![](https://avatars.githubusercontent.com/u/115371133?u=a032d8cc4a47b9a25bc7a1699a73506bdb752ea2&v=4)](https://github.com/fserv) [@fserv](https://github.com/fserv) [![](https://avatars.githubusercontent.com/u/5289083?u=d663551cd0b6e74091abd6272c35c9e02e82d6c0&v=4)](https://github.com/seanmavley) [@seanmavley](https://github.com/seanmavley) [![](https://avatars.githubusercontent.com/u/37284105?u=be61bf8a5cef1060aeeb63a9bdd0a18f2edfe8d1&v=4)](https://github.com/cloudscool) [@cloudscool](https://github.com/cloudscool) [![](https://avatars.githubusercontent.com/u/243665?u=4f7f2b3bbc666f530bf0e61bf6a4b32f5fcec433&v=4)](https://github.com/Lothiraldan) [@Lothiraldan](https://github.com/Lothiraldan) [![](https://avatars.githubusercontent.com/u/2106106?u=e59f1d37d627161dc1739d290d1aedfb7348f1ab&v=4)](https://github.com/Ather23) [@Ather23](https://github.com/Ather23) [![](https://avatars.githubusercontent.com/u/143642606?u=83091119b6b84c82b741298e9c9252161868bae7&v=4)](https://github.com/mogith-pn) [@mogith-pn](https://github.com/mogith-pn) [![](https://avatars.githubusercontent.com/u/6266815?v=4)](https://github.com/JohnnyDeuss) [@JohnnyDeuss](https://github.com/JohnnyDeuss) [![](https://avatars.githubusercontent.com/u/2021971?v=4)](https://github.com/eunhye1kim) [@eunhye1kim](https://github.com/eunhye1kim) [![](https://avatars.githubusercontent.com/u/43149077?u=26d40f875b701db58f54af0441501c12e86dec6f&v=4)](https://github.com/dakinggg) [@dakinggg](https://github.com/dakinggg) [![](https://avatars.githubusercontent.com/u/32113413?u=069f880e88a96db6ad955e3cc9fc7f9dfcf2beef&v=4)](https://github.com/jackwotherspoon) [@jackwotherspoon](https://github.com/jackwotherspoon) [![](https://avatars.githubusercontent.com/u/79466298?u=875baabba4c879efd68332024a98fa093bdab2f2&v=4)](https://github.com/klaudialemiec) [@klaudialemiec](https://github.com/klaudialemiec) [![](https://avatars.githubusercontent.com/u/4492530?u=142efae122e461996caa5cc6d41b9b5f0549c047&v=4)](https://github.com/philippe2803) [@philippe2803](https://github.com/philippe2803) [![](https://avatars.githubusercontent.com/u/2644049?v=4)](https://github.com/wnleao) [@wnleao](https://github.com/wnleao) [![](https://avatars.githubusercontent.com/u/160063452?v=4)](https://github.com/fzowl) [@fzowl](https://github.com/fzowl) [![](https://avatars.githubusercontent.com/u/99611484?u=f421fe8a2917ae3ea24d83f056646055a00d3174&v=4)](https://github.com/kdcokenny) [@kdcokenny](https://github.com/kdcokenny) [![](https://avatars.githubusercontent.com/u/3761730?u=287b813c1046e929d420e4aee8f4a27f9f816f60&v=4)](https://github.com/qtangs) [@qtangs](https://github.com/qtangs) [![](https://avatars.githubusercontent.com/u/1651790?u=5a5ea37c495f7787f35172f0f86569daf5a5a65e&v=4)](https://github.com/wey-gu) [@wey-gu](https://github.com/wey-gu) [![](https://avatars.githubusercontent.com/u/54905519?u=9818cccb258351fd0abec07b4acfb414a0383823&v=4)](https://github.com/Sukitly) [@Sukitly](https://github.com/Sukitly) [![](https://avatars.githubusercontent.com/u/2951285?u=571c795227b4edbd29f027478346834f83a95076&v=4)](https://github.com/samber) [@samber](https://github.com/samber) [![](https://avatars.githubusercontent.com/u/601530?u=ab242d6500886c4f8799101543d5b1f7841f1104&v=4)](https://github.com/Atry) [@Atry](https://github.com/Atry) [![](https://avatars.githubusercontent.com/u/2700370?u=421c7cd75c8f7f1a28e6f6c19a5d587a6d478ed0&v=4)](https://github.com/chosh0615) [@chosh0615](https://github.com/chosh0615) [![](https://avatars.githubusercontent.com/u/3009596?u=bbc154ae159c938e6e0c4045dc1b7980696b402a&v=4)](https://github.com/avsolatorio) [@avsolatorio](https://github.com/avsolatorio) [![](https://avatars.githubusercontent.com/u/90301759?v=4)](https://github.com/19374242) [@19374242](https://github.com/19374242) [![](https://avatars.githubusercontent.com/u/4491983?u=9265a9310ce2fa08b9429dc5d68da5b8677058ba&v=4)](https://github.com/leedotpang) [@leedotpang](https://github.com/leedotpang) [![](https://avatars.githubusercontent.com/u/39889?u=bd28816c18beaddc4da762d61d842547fdb271d9&v=4)](https://github.com/yarikoptic) [@yarikoptic](https://github.com/yarikoptic) [![](https://avatars.githubusercontent.com/u/52778543?u=504d8eb452ab2103a86ab469dd793eab49c8a437&v=4)](https://github.com/Jofthomas) [@Jofthomas](https://github.com/Jofthomas) [![](https://avatars.githubusercontent.com/u/57748216?u=e2029e1262ee9c9d9f5825b2d28952758a628f28&v=4)](https://github.com/marlenezw) [@marlenezw](https://github.com/marlenezw) [![](https://avatars.githubusercontent.com/u/23070692?u=bc8389d4c965994dee5b8cbadc420f8b4bcd5f0b&v=4)](https://github.com/rancomp) [@rancomp](https://github.com/rancomp) [![](https://avatars.githubusercontent.com/u/1540803?v=4)](https://github.com/morganda) [@morganda](https://github.com/morganda) [![](https://avatars.githubusercontent.com/u/1302641?u=643198eed0646ee2e18e22d6b6dab509bf9b2505&v=4)](https://github.com/atroyn) [@atroyn](https://github.com/atroyn) [![](https://avatars.githubusercontent.com/u/48685774?v=4)](https://github.com/dmenini) [@dmenini](https://github.com/dmenini) [![](https://avatars.githubusercontent.com/u/987457?u=a0dcd7b2cac59237d1ac2b43ca67a328ea7c437a&v=4)](https://github.com/brotchie) [@brotchie](https://github.com/brotchie) [![](https://avatars.githubusercontent.com/u/32129522?u=a6fc430ee58b3ebe776dec5fce16b686f81c8e12&v=4)](https://github.com/angeligareta) [@angeligareta](https://github.com/angeligareta) [![](https://avatars.githubusercontent.com/u/75265893?u=7f11152d07f1719da22084388c09b5fc64ab6c89&v=4)](https://github.com/ovuruska) [@ovuruska](https://github.com/ovuruska) [![](https://avatars.githubusercontent.com/u/5279578?u=ce483437f50a425eab4b1f6f635ac49159f31576&v=4)](https://github.com/mmajewsk) [@mmajewsk](https://github.com/mmajewsk) [![](https://avatars.githubusercontent.com/u/15167330?u=2d472fe5c7f09140dc62daac84d45a001b9de94f&v=4)](https://github.com/haydeniw) [@haydeniw](https://github.com/haydeniw) [![](https://avatars.githubusercontent.com/u/3480154?u=f69c138e15366ba9c15cafd3c753a7ba7da44ad5&v=4)](https://github.com/wangwei1237) [@wangwei1237](https://github.com/wangwei1237) [![](https://avatars.githubusercontent.com/u/116048415?v=4)](https://github.com/nimimeht) [@nimimeht](https://github.com/nimimeht) [![](https://avatars.githubusercontent.com/u/5055697?v=4)](https://github.com/alexiri) [@alexiri](https://github.com/alexiri) [![](https://avatars.githubusercontent.com/u/12781611?v=4)](https://github.com/rjanardhan3) [@rjanardhan3](https://github.com/rjanardhan3) [![](https://avatars.githubusercontent.com/u/136875?u=611195240df6f68e816214bb865174384b74437e&v=4)](https://github.com/msaelices) [@msaelices](https://github.com/msaelices) [![](https://avatars.githubusercontent.com/u/21985684?u=96e4830f5dfb5a4a6fcb504fddec997a50b56413&v=4)](https://github.com/SimFG) [@SimFG](https://github.com/SimFG) [![](https://avatars.githubusercontent.com/u/16047967?v=4)](https://github.com/StankoKuveljic) [@StankoKuveljic](https://github.com/StankoKuveljic) [![](https://avatars.githubusercontent.com/u/40655746?u=3c10115601fd5b032c3f274e79fd68dc5bb03921&v=4)](https://github.com/quchuyuan) [@quchuyuan](https://github.com/quchuyuan) [![](https://avatars.githubusercontent.com/u/151817113?v=4)](https://github.com/sirjan-ws-ext) [@sirjan-ws-ext](https://github.com/sirjan-ws-ext) [![](https://avatars.githubusercontent.com/u/147840?v=4)](https://github.com/anentropic) [@anentropic](https://github.com/anentropic) [![](https://avatars.githubusercontent.com/u/65639964?u=6a48b9ecb8e188fee4117bffb055afb54566ba97&v=4)](https://github.com/EricLiclair) [@EricLiclair](https://github.com/EricLiclair) [![](https://avatars.githubusercontent.com/u/23413676?u=b5bef760f9d067457f460d4dd5036f7e5f50d197&v=4)](https://github.com/hsuyuming) [@hsuyuming](https://github.com/hsuyuming) [![](https://avatars.githubusercontent.com/u/1751809?u=b247b34fa5ccf9bb276ae318d57af47680994600&v=4)](https://github.com/asofter) [@asofter](https://github.com/asofter) [![](https://avatars.githubusercontent.com/u/16456186?u=b9b30585eb3ddd0c8819bda9694636303c510233&v=4)](https://github.com/ThatsJustCheesy) [@ThatsJustCheesy](https://github.com/ThatsJustCheesy) [![](https://avatars.githubusercontent.com/u/1621509?u=e54d671ddef5ac7580003427246fc2247964c9ed&v=4)](https://github.com/MacanPN) [@MacanPN](https://github.com/MacanPN) [![](https://avatars.githubusercontent.com/u/31998003?u=0d91cde56e2c25d8ee7447bc55099e3dad047e99&v=4)](https://github.com/kristapratico) [@kristapratico](https://github.com/kristapratico) [![](https://avatars.githubusercontent.com/u/7942293?u=6d5e295620df234b697f25d94659ae85d2dd2060&v=4)](https://github.com/imeckr) [@imeckr](https://github.com/imeckr) [![](https://avatars.githubusercontent.com/u/8013575?u=13891ea430c3534079de533ea11aa92111300d0d&v=4)](https://github.com/christeefy) [@christeefy](https://github.com/christeefy) [![](https://avatars.githubusercontent.com/u/7935430?v=4)](https://github.com/rc19) [@rc19](https://github.com/rc19) [![](https://avatars.githubusercontent.com/u/3982077?u=8bbebac42cb84a25c629f83f212b2d099ffa3964&v=4)](https://github.com/anthonychu) [@anthonychu](https://github.com/anthonychu) [![](https://avatars.githubusercontent.com/u/1664952?u=38196f73e9e69e2cc4f6d2e1207647af87bc440a&v=4)](https://github.com/h3l) [@h3l](https://github.com/h3l) [![](https://avatars.githubusercontent.com/u/6726111?u=57f5f48085f552366bc8cf19ecd1d4ad0c66cd48&v=4)](https://github.com/JensMadsen) [@JensMadsen](https://github.com/JensMadsen) [![](https://avatars.githubusercontent.com/u/61808204?v=4)](https://github.com/akiradev0x) [@akiradev0x](https://github.com/akiradev0x) [![](https://avatars.githubusercontent.com/u/1385510?u=b3066560b9122fc5db6d2e80adf9d5c84113be15&v=4)](https://github.com/JonZeolla) [@JonZeolla](https://github.com/JonZeolla) [![](https://avatars.githubusercontent.com/u/5136688?u=471ef01a31cc054f84abbe1b9e77ce07b2ac6853&v=4)](https://github.com/mlejva) [@mlejva](https://github.com/mlejva) [![](https://avatars.githubusercontent.com/u/5564852?u=bb4393ab0f6ea892733e5fa10294207c1cf157f7&v=4)](https://github.com/msetbar) [@msetbar](https://github.com/msetbar) [![](https://avatars.githubusercontent.com/u/120141355?u=c114874e969ef4e38c54d042fe1b9a69bc634483&v=4)](https://github.com/j-space-b) [@j-space-b](https://github.com/j-space-b) [![](https://avatars.githubusercontent.com/u/50950969?u=f0c166782c1b8f63eb983383729b5d109d7bed0a&v=4)](https://github.com/chrispy-snps) [@chrispy-snps](https://github.com/chrispy-snps) [![](https://avatars.githubusercontent.com/u/1863868?u=b00a9408d1433919780ea3248b3fc21258172152&v=4)](https://github.com/amosjyng) [@amosjyng](https://github.com/amosjyng) [![](https://avatars.githubusercontent.com/u/38786?u=10a7cbcfb424bf45b3858017dc8cffae82adde29&v=4)](https://github.com/ninjapenguin) [@ninjapenguin](https://github.com/ninjapenguin) [![](https://avatars.githubusercontent.com/u/12752197?u=f4f5d6c5b040422eaa987d0c7f441c65a1266db5&v=4)](https://github.com/dvonthenen) [@dvonthenen](https://github.com/dvonthenen) [![](https://avatars.githubusercontent.com/u/51022808?u=15abba69b0bbc1e4b03d97769c37a58af637bd81&v=4)](https://github.com/Joffref) [@Joffref](https://github.com/Joffref) [![](https://avatars.githubusercontent.com/u/56083056?v=4)](https://github.com/HamJaw1432) [@HamJaw1432](https://github.com/HamJaw1432) [![](https://avatars.githubusercontent.com/u/171019460?v=4)](https://github.com/Anirudh31415926535) [@Anirudh31415926535](https://github.com/Anirudh31415926535) [![](https://avatars.githubusercontent.com/u/538203?u=b3a13cce34acb23a3ef2808ee54c3461f2fa85bb&v=4)](https://github.com/cristobalcl) [@cristobalcl](https://github.com/cristobalcl) [![](https://avatars.githubusercontent.com/u/17561003?u=76de0b85da74806eaad024ebc3315201ba49e867&v=4)](https://github.com/krrishdholakia) [@krrishdholakia](https://github.com/krrishdholakia) [![](https://avatars.githubusercontent.com/u/27777173?u=4490be52549d8b6d2a662f35068b9a0d625b4b66&v=4)](https://github.com/samhita-alla) [@samhita-alla](https://github.com/samhita-alla) [![](https://avatars.githubusercontent.com/u/3906177?u=3e7cb909eded61c3a35cb0e11336a70d0bc05534&v=4)](https://github.com/ralewis85) [@ralewis85](https://github.com/ralewis85) [![](https://avatars.githubusercontent.com/u/6785029?v=4)](https://github.com/finnless) [@finnless](https://github.com/finnless) [![](https://avatars.githubusercontent.com/u/45704090?u=fe471820f7f3939783ddea78efa0ef1f0d86288e&v=4)](https://github.com/felixocker) [@felixocker](https://github.com/felixocker) [![](https://avatars.githubusercontent.com/u/433221?u=714ae935eadb460e1a7d41d7d29e26c7fed0bbbf&v=4)](https://github.com/brendancol) [@brendancol](https://github.com/brendancol) [![](https://avatars.githubusercontent.com/u/34255899?u=05aba76f1912a56538c8a5141f8135d0e3b1e1bd&v=4)](https://github.com/gbaian10) [@gbaian10](https://github.com/gbaian10) [![](https://avatars.githubusercontent.com/u/22055188?u=779840a35ef12f6734b630b1bdedd694132ec68f&v=4)](https://github.com/juliensalinas) [@juliensalinas](https://github.com/juliensalinas) [![](https://avatars.githubusercontent.com/u/69706702?u=4fe850984b0956793de0a67c7ed9141168942eef&v=4)](https://github.com/muntaqamahmood) [@muntaqamahmood](https://github.com/muntaqamahmood) [![](https://avatars.githubusercontent.com/u/11441526?u=bbd26dd43cf43212b0b05601ed5aaf29727f5d9f&v=4)](https://github.com/Fei-Wang) [@Fei-Wang](https://github.com/Fei-Wang) [![](https://avatars.githubusercontent.com/u/45267439?u=d2ad5da7ef06e928644321e7a1cfd16842a897db&v=4)](https://github.com/jupyterjazz) [@jupyterjazz](https://github.com/jupyterjazz) [![](https://avatars.githubusercontent.com/u/17061663?u=bee0295d999ddb902a98872fac6009bb88950132&v=4)](https://github.com/kooyunmo) [@kooyunmo](https://github.com/kooyunmo) [![](https://avatars.githubusercontent.com/u/7340008?u=9473b1cdea8b9929771b32f14a28ad702237900c&v=4)](https://github.com/donbr) [@donbr](https://github.com/donbr) [![](https://avatars.githubusercontent.com/u/22361806?u=c6b2eec689b859aeb182654e5e67936886d860bb&v=4)](https://github.com/jdogmcsteezy) [@jdogmcsteezy](https://github.com/jdogmcsteezy) [![](https://avatars.githubusercontent.com/u/367522?u=2b439b16d48aaea7f17d1b3b0b24a9cb0b8712ed&v=4)](https://github.com/borisdev) [@borisdev](https://github.com/borisdev) [![](https://avatars.githubusercontent.com/u/87140293?v=4)](https://github.com/thedavgar) [@thedavgar](https://github.com/thedavgar) [![](https://avatars.githubusercontent.com/u/14931371?u=2f570f7591396a1ab8b58777746e2412e154fbfa&v=4)](https://github.com/jasonwcfan) [@jasonwcfan](https://github.com/jasonwcfan) [![](https://avatars.githubusercontent.com/u/46003469?u=4f64d04035d962af0f72d20bffd6ea61635e728e&v=4)](https://github.com/yilmaz-burak) [@yilmaz-burak](https://github.com/yilmaz-burak) [![](https://avatars.githubusercontent.com/u/8552242?v=4)](https://github.com/yessenzhar) [@yessenzhar](https://github.com/yessenzhar) [![](https://avatars.githubusercontent.com/u/84070455?v=4)](https://github.com/pjb157) [@pjb157](https://github.com/pjb157) [![](https://avatars.githubusercontent.com/u/202907?u=a1060b9fd298fd84b1adb7f6874c5c2012e782dc&v=4)](https://github.com/krasserm) [@krasserm](https://github.com/krasserm) [![](https://avatars.githubusercontent.com/u/8673939?v=4)](https://github.com/NickL77) [@NickL77](https://github.com/NickL77) [![](https://avatars.githubusercontent.com/u/10400064?u=52b50611d587317f397a96f898753099d65931f1&v=4)](https://github.com/mishushakov) [@mishushakov](https://github.com/mishushakov) [![](https://avatars.githubusercontent.com/u/1508364?u=e75aca2de6de1a1e57329fc0c6430e1341904318&v=4)](https://github.com/flash1293) [@flash1293](https://github.com/flash1293) [![](https://avatars.githubusercontent.com/u/6500104?u=c11cdf2671e89749d7d8c01f0d85494cce8d9f84&v=4)](https://github.com/Code-Hex) [@Code-Hex](https://github.com/Code-Hex) [![](https://avatars.githubusercontent.com/u/22690160?u=50f2d8aa99bd7b12c01df29e8ffe519ed1cff1d5&v=4)](https://github.com/jnis23) [@jnis23](https://github.com/jnis23) [![](https://avatars.githubusercontent.com/u/36752715?u=5137581b52bcbb8466b394f3ba40f97f9e273f52&v=4)](https://github.com/cgalo5758) [@cgalo5758](https://github.com/cgalo5758) [![](https://avatars.githubusercontent.com/u/17325195?u=dadc287a6784258704affce9bf91e03e1bb967b4&v=4)](https://github.com/raymond-yuan) [@raymond-yuan](https://github.com/raymond-yuan) [![](https://avatars.githubusercontent.com/u/5621432?u=bc4551beb3e89dda87d2f475b8652aacb20dabc8&v=4)](https://github.com/sunishsheth2009) [@sunishsheth2009](https://github.com/sunishsheth2009) [![](https://avatars.githubusercontent.com/u/101966044?v=4)](https://github.com/klae01) [@klae01](https://github.com/klae01) [![](https://avatars.githubusercontent.com/u/38317983?u=b169467874aeaf478132e46998ca895accfc008e&v=4)](https://github.com/LunarECL) [@LunarECL](https://github.com/LunarECL) [![](https://avatars.githubusercontent.com/u/12080578?v=4)](https://github.com/whiskyboy) [@whiskyboy](https://github.com/whiskyboy) [![](https://avatars.githubusercontent.com/u/66191792?v=4)](https://github.com/yuskhan) [@yuskhan](https://github.com/yuskhan) [![](https://avatars.githubusercontent.com/u/62583018?v=4)](https://github.com/akashAD98) [@akashAD98](https://github.com/akashAD98) [![](https://avatars.githubusercontent.com/u/45953733?u=b907b96d62f8cb2e75f3bba4f137d296d0d8a87f&v=4)](https://github.com/Shrined) [@Shrined](https://github.com/Shrined) [![](https://avatars.githubusercontent.com/u/17435126?u=62bec61ef256194a3bb3ab238ab71d1792decd08&v=4)](https://github.com/DavidLMS) [@DavidLMS](https://github.com/DavidLMS) [![](https://avatars.githubusercontent.com/u/4956442?u=fee6c76ff991cc9c12c4d703a1ad007e7634f58e&v=4)](https://github.com/rmkraus) [@rmkraus](https://github.com/rmkraus) [![](https://avatars.githubusercontent.com/u/20266953?u=32853a0ed47a83525f3f21b4baf63891e0e3de15&v=4)](https://github.com/rawwar) [@rawwar](https://github.com/rawwar) [![](https://avatars.githubusercontent.com/u/413669?u=25b5563194493db00c227a98e23f460adb13c9ea&v=4)](https://github.com/pmcfadin) [@pmcfadin](https://github.com/pmcfadin) [![](https://avatars.githubusercontent.com/u/25740077?u=1c3b2b59a52f332dc22ef1787f2cdc67dc9fea5e&v=4)](https://github.com/tricktreat) [@tricktreat](https://github.com/tricktreat) [![](https://avatars.githubusercontent.com/u/6334158?u=1d02d8cc173b20c7d18e11ac20a6f40081025fc3&v=4)](https://github.com/fzliu) [@fzliu](https://github.com/fzliu) [![](https://avatars.githubusercontent.com/u/15992114?u=39c8ea0ffb9f48cec04f9b473f2801327e716ba1&v=4)](https://github.com/dongreenberg) [@dongreenberg](https://github.com/dongreenberg) [![](https://avatars.githubusercontent.com/u/54540938?u=77dbfd10b709e203865f99668a4c79db04a69661&v=4)](https://github.com/aledelunap) [@aledelunap](https://github.com/aledelunap) [![](https://avatars.githubusercontent.com/u/1155052?v=4)](https://github.com/stonekim) [@stonekim](https://github.com/stonekim) [![](https://avatars.githubusercontent.com/u/62909360?v=4)](https://github.com/chip-davis) [@chip-davis](https://github.com/chip-davis) [![](https://avatars.githubusercontent.com/u/6690727?u=d5742c8e658fe211a8987d9716838c34122485d0&v=4)](https://github.com/tonyabracadabra) [@tonyabracadabra](https://github.com/tonyabracadabra) [![](https://avatars.githubusercontent.com/u/2857712?u=6809bef8bf07c46b39cd2fcd6027ed86e76372cd&v=4)](https://github.com/machulav) [@machulav](https://github.com/machulav) [![](https://avatars.githubusercontent.com/u/12604876?u=a441926ef7f4dbc48fc3a1511f3ae5cb4279c464&v=4)](https://github.com/shauryr) [@shauryr](https://github.com/shauryr) [![](https://avatars.githubusercontent.com/u/42373772?v=4)](https://github.com/PawelFaron) [@PawelFaron](https://github.com/PawelFaron) [![](https://avatars.githubusercontent.com/u/104267837?u=762d6b00291c68379d66260d7b644942e3bab891&v=4)](https://github.com/lvliang-intel) [@lvliang-intel](https://github.com/lvliang-intel) [![](https://avatars.githubusercontent.com/u/1909351?u=26bf36601ef34e0aa8a846ff3c98eb077987e882&v=4)](https://github.com/balvisio) [@balvisio](https://github.com/balvisio) [![](https://avatars.githubusercontent.com/u/8972416?u=8cef7c30a819e5157bece1f1e06a50beab52845f&v=4)](https://github.com/xinqiu) [@xinqiu](https://github.com/xinqiu) [![](https://avatars.githubusercontent.com/u/30035387?u=38717fe5778531ee96e5fc6e4a350668b5024d1c&v=4)](https://github.com/MikeMcGarry) [@MikeMcGarry](https://github.com/MikeMcGarry) [![](https://avatars.githubusercontent.com/u/20807672?u=f2efe9788ce26442bb3319da1a56081d64c359e5&v=4)](https://github.com/robcaulk) [@robcaulk](https://github.com/robcaulk) [![](https://avatars.githubusercontent.com/u/37783831?u=5697294c9a0c5bcca4df1aafd22cf8ab64081f2f&v=4)](https://github.com/jagilley) [@jagilley](https://github.com/jagilley) [![](https://avatars.githubusercontent.com/u/35005448?u=4b6efd3d2dcdc2acde843cff4183b59087f35a9b&v=4)](https://github.com/prrao87) [@prrao87](https://github.com/prrao87) [![](https://avatars.githubusercontent.com/u/31956487?u=4693ce4d533d97386b62851f6790881306cb88bc&v=4)](https://github.com/lujingxuansc) [@lujingxuansc](https://github.com/lujingxuansc) [![](https://avatars.githubusercontent.com/u/15329913?u=d6a01e3a63eb3ef04e5917f994fc2f809f28dd13&v=4)](https://github.com/mplachter) [@mplachter](https://github.com/mplachter) [![](https://avatars.githubusercontent.com/u/46458320?u=f752991f6c37b213ad11fdae5bf7820aa59b93d0&v=4)](https://github.com/jvelezmagic) [@jvelezmagic](https://github.com/jvelezmagic) [![](https://avatars.githubusercontent.com/u/50772274?u=5d63cb1b53e5702ea3dd12f865c3b9b252f37a02&v=4)](https://github.com/patrickloeber) [@patrickloeber](https://github.com/patrickloeber) [![](https://avatars.githubusercontent.com/u/16231195?u=cb98dd7c537280ed31b53108f31286bd50989aea&v=4)](https://github.com/trancethehuman) [@trancethehuman](https://github.com/trancethehuman) [![](https://avatars.githubusercontent.com/u/68764?v=4)](https://github.com/vadimgu) [@vadimgu](https://github.com/vadimgu) [![](https://avatars.githubusercontent.com/u/146365078?v=4)](https://github.com/hulitaitai) [@hulitaitai](https://github.com/hulitaitai) [![](https://avatars.githubusercontent.com/u/6885889?u=0b15031859ad908eb11af83878000ab09bed5609&v=4)](https://github.com/cjcjameson) [@cjcjameson](https://github.com/cjcjameson) [![](https://avatars.githubusercontent.com/u/69208727?u=132c8ca18143866b79253a6fcbc10f58984f61ab&v=4)](https://github.com/aymeric-roucher) [@aymeric-roucher](https://github.com/aymeric-roucher) [![](https://avatars.githubusercontent.com/u/24295927?u=27eee7ea85bd7dfd9e918245b96de8c757f5a620&v=4)](https://github.com/Sandy247) [@Sandy247](https://github.com/Sandy247) [![](https://avatars.githubusercontent.com/u/3887295?u=55c8b3263df68b67f9b465c1758c78898f8b163b&v=4)](https://github.com/zoltan-fedor) [@zoltan-fedor](https://github.com/zoltan-fedor) [![](https://avatars.githubusercontent.com/u/19657350?u=9847c9919a636e9d7022803e829ffd80008cb2d3&v=4)](https://github.com/berkedilekoglu) [@berkedilekoglu](https://github.com/berkedilekoglu) [![](https://avatars.githubusercontent.com/u/141281053?u=e3ff32e9ae51ff0cca84b482fc1e6c80c28ab0c6&v=4)](https://github.com/rodrigo-clickup) [@rodrigo-clickup](https://github.com/rodrigo-clickup) [![](https://avatars.githubusercontent.com/u/35718120?u=af59f3ac14a23d1f2e09942415ac07c10f3a3d05&v=4)](https://github.com/numb3r3) [@numb3r3](https://github.com/numb3r3) [![](https://avatars.githubusercontent.com/u/42609308?u=3f7f530d338e33205815639ad3dfe7c244455728&v=4)](https://github.com/svdeepak99) [@svdeepak99](https://github.com/svdeepak99) [![](https://avatars.githubusercontent.com/u/97558871?v=4)](https://github.com/ZyeG) [@ZyeG](https://github.com/ZyeG) [![](https://avatars.githubusercontent.com/u/28337009?u=47c7e4318c5369bbc9f9cb719e7671336c83f15a&v=4)](https://github.com/itok01) [@itok01](https://github.com/itok01) [![](https://avatars.githubusercontent.com/u/30483654?u=95e2c59c64c99e4ba77cffb8b2c180f7b44c6a74&v=4)](https://github.com/NoahStapp) [@NoahStapp](https://github.com/NoahStapp) [![](https://avatars.githubusercontent.com/u/709022?v=4)](https://github.com/tconkling) [@tconkling](https://github.com/tconkling) [![](https://avatars.githubusercontent.com/u/8368470?u=1b7aebda11db89d56b90ff89f9b108e3cd8bffe5&v=4)](https://github.com/thehapyone) [@thehapyone](https://github.com/thehapyone) [![](https://avatars.githubusercontent.com/u/986859?u=54d240cfd5355bb0cfdaf4ac0a9589963ae9ccab&v=4)](https://github.com/toshish) [@toshish](https://github.com/toshish) [![](https://avatars.githubusercontent.com/u/1087039?u=4439c00ef507bef0a99d82cdec33d6d0ed53d67c&v=4)](https://github.com/dremeika) [@dremeika](https://github.com/dremeika) [![](https://avatars.githubusercontent.com/u/49049296?u=26427e6e1aa0a8ac20cc10594664b59a017f5287&v=4)](https://github.com/mingkang111) [@mingkang111](https://github.com/mingkang111) [![](https://avatars.githubusercontent.com/u/13622183?u=c23256501191447d645cc03c1f6bc83282ef1498&v=4)](https://github.com/liaokongVFX) [@liaokongVFX](https://github.com/liaokongVFX) [![](https://avatars.githubusercontent.com/u/36044389?u=e669016609aeb3e08e4f2a50f4faa163d633c073&v=4)](https://github.com/0xRaduan) [@0xRaduan](https://github.com/0xRaduan) [![](https://avatars.githubusercontent.com/u/127370261?v=4)](https://github.com/apeng-singlestore) [@apeng-singlestore](https://github.com/apeng-singlestore) [![](https://avatars.githubusercontent.com/u/252377?v=4)](https://github.com/jeffkit) [@jeffkit](https://github.com/jeffkit) [![](https://avatars.githubusercontent.com/u/158216624?v=4)](https://github.com/xsai9101) [@xsai9101](https://github.com/xsai9101) [![](https://avatars.githubusercontent.com/u/38943595?v=4)](https://github.com/issam9) [@issam9](https://github.com/issam9) [![](https://avatars.githubusercontent.com/u/131272471?v=4)](https://github.com/CogniJT) [@CogniJT](https://github.com/CogniJT) [![](https://avatars.githubusercontent.com/u/87355704?u=e98091da04c6bfe9af8d982938556832f03fb1fb&v=4)](https://github.com/ivyas21) [@ivyas21](https://github.com/ivyas21) [![](https://avatars.githubusercontent.com/u/90619575?u=a99d480b1238cfdb2dabcd2fe60d1110518049d9&v=4)](https://github.com/florian-morel22) [@florian-morel22](https://github.com/florian-morel22) [![](https://avatars.githubusercontent.com/u/16679979?u=ddfe3499c7008b4d7c5cf55677a8f6ef77c7abc1&v=4)](https://github.com/gdj0nes) [@gdj0nes](https://github.com/gdj0nes) [![](https://avatars.githubusercontent.com/u/22898443?u=4e6aceb9132747788c4b6aca6c16027ee1109b01&v=4)](https://github.com/sdan) [@sdan](https://github.com/sdan) [![](https://avatars.githubusercontent.com/u/16283396?v=4)](https://github.com/samching) [@samching](https://github.com/samching) [![](https://avatars.githubusercontent.com/u/306671?u=27f910f1bdcdf18622fcccc138274be885cf1058&v=4)](https://github.com/lukestanley) [@lukestanley](https://github.com/lukestanley) [![](https://avatars.githubusercontent.com/u/63134180?v=4)](https://github.com/IlyaKIS1) [@IlyaKIS1](https://github.com/IlyaKIS1) [![](https://avatars.githubusercontent.com/u/4432788?u=6883ca123ef6ea5c06b6353183e4f92574b4e152&v=4)](https://github.com/dosuken123) [@dosuken123](https://github.com/dosuken123) [![](https://avatars.githubusercontent.com/u/356014?u=e354dc99055acba9e834508f635e3e2d754bb30b&v=4)](https://github.com/wietsevenema) [@wietsevenema](https://github.com/wietsevenema) [![](https://avatars.githubusercontent.com/u/157405112?u=f34aa80161ad2eab0db9255661f4bd7d685cbd0c&v=4)](https://github.com/gustavo-yt) [@gustavo-yt](https://github.com/gustavo-yt) [![](https://avatars.githubusercontent.com/u/55749660?u=ce02778e563e11675fc7f4a7701d25a95296b437&v=4)](https://github.com/alexander1999-hub) [@alexander1999-hub](https://github.com/alexander1999-hub) [![](https://avatars.githubusercontent.com/u/93204286?u=4b965586800fef342c6235fec47e9185b8ec1f81&v=4)](https://github.com/jonathanalgar) [@jonathanalgar](https://github.com/jonathanalgar) [![](https://avatars.githubusercontent.com/u/28803103?u=c0b795ec14b5536f0e757faf1eca1c1900d1ef3c&v=4)](https://github.com/vsxd) [@vsxd](https://github.com/vsxd) [![](https://avatars.githubusercontent.com/u/89905406?v=4)](https://github.com/amirai21) [@amirai21](https://github.com/amirai21) [![](https://avatars.githubusercontent.com/u/17221195?u=6182ec534d25d1c9ffe1667bd78ea28fd0eea4c8&v=4)](https://github.com/var77) [@var77](https://github.com/var77) [![](https://avatars.githubusercontent.com/u/54343137?u=0b69859aa8f8e5145d6fda66985a5c8a82c77524&v=4)](https://github.com/L-cloud) [@L-cloud](https://github.com/L-cloud) [![](https://avatars.githubusercontent.com/u/88005863?v=4)](https://github.com/matiasjacob25) [@matiasjacob25](https://github.com/matiasjacob25) [![](https://avatars.githubusercontent.com/u/130898843?u=0fedb2a0f0f82cd756dbd279e5fd34e2419d054c&v=4)](https://github.com/Haijian06) [@Haijian06](https://github.com/Haijian06) [![](https://avatars.githubusercontent.com/u/1222232?v=4)](https://github.com/IlyaMichlin) [@IlyaMichlin](https://github.com/IlyaMichlin) [![](https://avatars.githubusercontent.com/u/6346981?u=8ae43f7d588ffcc184df5948d2d034cc29dc1d7d&v=4)](https://github.com/dzmitry-kankalovich) [@dzmitry-kankalovich](https://github.com/dzmitry-kankalovich) [![](https://avatars.githubusercontent.com/u/13366849?u=9f66646c23def822aac7d3dfecb49369bc8cdf7b&v=4)](https://github.com/EniasCailliau) [@EniasCailliau](https://github.com/EniasCailliau) [![](https://avatars.githubusercontent.com/u/68635?u=0ebec81cc881b2428e2c45e549a1081e5fe3cddf&v=4)](https://github.com/kreneskyp) [@kreneskyp](https://github.com/kreneskyp) [![](https://avatars.githubusercontent.com/u/4441850?u=532666e949309d38a33cda7b1e8b5f30fee0ef7c&v=4)](https://github.com/rsharath) [@rsharath](https://github.com/rsharath) [![](https://avatars.githubusercontent.com/u/21039333?u=bba2c2d18d3a5ef41360778a7679662565f326d2&v=4)](https://github.com/izapolsk) [@izapolsk](https://github.com/izapolsk) [![](https://avatars.githubusercontent.com/u/30639818?v=4)](https://github.com/rjadr) [@rjadr](https://github.com/rjadr) [![](https://avatars.githubusercontent.com/u/17973367?u=135d566bd1e620e230b94bf5252acea571ba510f&v=4)](https://github.com/Lord-Haji) [@Lord-Haji](https://github.com/Lord-Haji) [![](https://avatars.githubusercontent.com/u/85796?u=d66bb48107582804e6665cd33540cce5dea2fd8b&v=4)](https://github.com/woodworker) [@woodworker](https://github.com/woodworker) [![](https://avatars.githubusercontent.com/u/32632186?u=3e1b1b0d8cc37c998508e3ab83dc20ef1e2f57e0&v=4)](https://github.com/philschmid) [@philschmid](https://github.com/philschmid) [![](https://avatars.githubusercontent.com/u/13198452?v=4)](https://github.com/ChrKahl) [@ChrKahl](https://github.com/ChrKahl) [![](https://avatars.githubusercontent.com/u/8433665?u=5adeb0f5b7d3af0f5f6149bc09076fd37f964e00&v=4)](https://github.com/bongsang) [@bongsang](https://github.com/bongsang) [![](https://avatars.githubusercontent.com/u/49571870?v=4)](https://github.com/clwillhuang) [@clwillhuang](https://github.com/clwillhuang) [![](https://avatars.githubusercontent.com/u/3122709?u=55c1160c7f870bcc582d2e0be42d5b1054262e04&v=4)](https://github.com/BidhanRoy) [@BidhanRoy](https://github.com/BidhanRoy) [![](https://avatars.githubusercontent.com/u/108248080?v=4)](https://github.com/finger-bone) [@finger-bone](https://github.com/finger-bone) [![](https://avatars.githubusercontent.com/u/26385522?v=4)](https://github.com/hiigao) [@hiigao](https://github.com/hiigao) [![](https://avatars.githubusercontent.com/u/152659506?v=4)](https://github.com/samkhano1) [@samkhano1](https://github.com/samkhano1) [![](https://avatars.githubusercontent.com/u/45119610?u=27b4bbe257e0cc055c70f05dc6f45e95d5b09d08&v=4)](https://github.com/ireneisdoomed) [@ireneisdoomed](https://github.com/ireneisdoomed) [![](https://avatars.githubusercontent.com/u/12946725?u=42a21426742352cfbc210619eed7e76bc1bb5b22&v=4)](https://github.com/mahaddad) [@mahaddad](https://github.com/mahaddad) [![](https://avatars.githubusercontent.com/u/44347519?v=4)](https://github.com/nicolasnk) [@nicolasnk](https://github.com/nicolasnk) [![](https://avatars.githubusercontent.com/u/31326650?u=a4db4389f5fa6d2cd4b9f99e38bc08d61f1d8962&v=4)](https://github.com/bovlb) [@bovlb](https://github.com/bovlb) [![](https://avatars.githubusercontent.com/u/18024571?u=c0e12c9590b7e0838b4ab96544bc875e08db0729&v=4)](https://github.com/tomhamer) [@tomhamer](https://github.com/tomhamer) [![](https://avatars.githubusercontent.com/u/1282617?u=940c2e3a241c82af68edc6adf81bc5da0fef0bbe&v=4)](https://github.com/haoch) [@haoch](https://github.com/haoch) [![](https://avatars.githubusercontent.com/u/32279503?u=b760deecdb05c098c0e4e19944b72bc22c6487dc&v=4)](https://github.com/SlapDrone) [@SlapDrone](https://github.com/SlapDrone) [![](https://avatars.githubusercontent.com/u/4302268?u=69a5af6602ab4faa803dcf60b2c50ed33cf44d89&v=4)](https://github.com/taranjeet) [@taranjeet](https://github.com/taranjeet) [![](https://avatars.githubusercontent.com/u/7312176?u=d986a46c4971c5d15feea254801efc5deb0bc358&v=4)](https://github.com/Pixeladed) [@Pixeladed](https://github.com/Pixeladed) [![](https://avatars.githubusercontent.com/u/8475708?v=4)](https://github.com/mlot) [@mlot](https://github.com/mlot) [![](https://avatars.githubusercontent.com/u/7282984?u=d8c2341fa91e31f3d1d90ec2b79ce25bffbe6cdf&v=4)](https://github.com/JGalego) [@JGalego](https://github.com/JGalego) [![](https://avatars.githubusercontent.com/u/21073184?u=deed6fe562ed425be66c210398811b664b5039a2&v=4)](https://github.com/xieqihui) [@xieqihui](https://github.com/xieqihui) [![](https://avatars.githubusercontent.com/u/9324867?v=4)](https://github.com/mhavey) [@mhavey](https://github.com/mhavey) [![](https://avatars.githubusercontent.com/u/4526224?u=3a47513ee686870ddcbecaa70756e3e8224732af&v=4)](https://github.com/praveenv) [@praveenv](https://github.com/praveenv) [![](https://avatars.githubusercontent.com/u/1734012?u=105d7344bcd5c0dee1a293d2740cefa05cc46b9b&v=4)](https://github.com/srics) [@srics](https://github.com/srics) [![](https://avatars.githubusercontent.com/u/31218485?u=6ce575b365c0353b5b3d1ea03088f8da36764100&v=4)](https://github.com/16BitNarwhal) [@16BitNarwhal](https://github.com/16BitNarwhal) [![](https://avatars.githubusercontent.com/u/33707069?u=8587c5bd028774c9af3674197fedca2380bbe2f9&v=4)](https://github.com/zanussbaum) [@zanussbaum](https://github.com/zanussbaum) [![](https://avatars.githubusercontent.com/u/12967560?v=4)](https://github.com/zhangch9) [@zhangch9](https://github.com/zhangch9) [![](https://avatars.githubusercontent.com/u/37284051?u=5c467b29af9d77213b8f3173d5c0319bc79e353d&v=4)](https://github.com/paulonasc) [@paulonasc](https://github.com/paulonasc) [![](https://avatars.githubusercontent.com/u/2008740?u=4c8824a259e14e56c2d3501e32a3422b258704c5&v=4)](https://github.com/rubell) [@rubell](https://github.com/rubell) [![](https://avatars.githubusercontent.com/u/37992436?u=21693d9e841c3b7f9f091a210fbeee7e415a0751&v=4)](https://github.com/izzymsft) [@izzymsft](https://github.com/izzymsft) [![](https://avatars.githubusercontent.com/u/22676399?u=6b46c5acfe16b722badbfa6845516c1627171bbe&v=4)](https://github.com/richarda23) [@richarda23](https://github.com/richarda23) [![](https://avatars.githubusercontent.com/u/7711036?v=4)](https://github.com/zifeiq) [@zifeiq](https://github.com/zifeiq) [![](https://avatars.githubusercontent.com/u/56812134?v=4)](https://github.com/liuyonghengheng) [@liuyonghengheng](https://github.com/liuyonghengheng) [![](https://avatars.githubusercontent.com/u/18428646?u=d26db3c0411bd1d62c1dca99e5c86dd1f7a3b53d&v=4)](https://github.com/tomaspiaggio) [@tomaspiaggio](https://github.com/tomaspiaggio) [![](https://avatars.githubusercontent.com/u/71321890?u=71a53f3a743fb8a91733e2a4cfcc05e309e3ef87&v=4)](https://github.com/klaus-xiong) [@klaus-xiong](https://github.com/klaus-xiong) [![](https://avatars.githubusercontent.com/u/16155041?u=bf86e1dd4aaeccde8ccf12bf8c16c494644b84e1&v=4)](https://github.com/alallema) [@alallema](https://github.com/alallema) [![](https://avatars.githubusercontent.com/u/8777479?v=4)](https://github.com/fengjial) [@fengjial](https://github.com/fengjial) [![](https://avatars.githubusercontent.com/u/18065113?u=6ea1812de26ecb108c18e50b719a109049d93ce2&v=4)](https://github.com/simon824) [@simon824](https://github.com/simon824) [![](https://avatars.githubusercontent.com/u/28787976?u=07c76df6dce5d38c056fb0783128844e6c70f4c4&v=4)](https://github.com/AksAman) [@AksAman](https://github.com/AksAman) [![](https://avatars.githubusercontent.com/u/14037726?u=e91cfcdb7606db58b059893368f3cf70a2340f5f&v=4)](https://github.com/mewim) [@mewim](https://github.com/mewim) [![](https://avatars.githubusercontent.com/u/4874?v=4)](https://github.com/ruanwz) [@ruanwz](https://github.com/ruanwz) [![](https://avatars.githubusercontent.com/u/1921353?v=4)](https://github.com/gdedrouas) [@gdedrouas](https://github.com/gdedrouas) [![](https://avatars.githubusercontent.com/u/1917451?u=03092c3ad1acdeec40390db850b2df9d813b6f83&v=4)](https://github.com/mariokostelac) [@mariokostelac](https://github.com/mariokostelac) [![](https://avatars.githubusercontent.com/u/22236370?u=289c19bfc89a43a7e0c6956f73305aab3a8bd978&v=4)](https://github.com/mosheber) [@mosheber](https://github.com/mosheber) [![](https://avatars.githubusercontent.com/u/8844262?u=1f09d2fe41756368730c3684fc819fbad940b4ac&v=4)](https://github.com/laplaceon) [@laplaceon](https://github.com/laplaceon) [![](https://avatars.githubusercontent.com/u/11781950?u=a34a78ac4d9dcc25fd084f423566c9443c2cc47d&v=4)](https://github.com/thepycoder) [@thepycoder](https://github.com/thepycoder) [![](https://avatars.githubusercontent.com/u/42592581?v=4)](https://github.com/toddkim95) [@toddkim95](https://github.com/toddkim95) [![](https://avatars.githubusercontent.com/u/82586689?u=f10792bb4d6db272be85086ae5a8159f56d8a64f&v=4)](https://github.com/RafaelXokito) [@RafaelXokito](https://github.com/RafaelXokito) [![](https://avatars.githubusercontent.com/u/950938?u=5283ce0f42f555abe0cd3eb9e45d23206c2ba6b8&v=4)](https://github.com/agamble) [@agamble](https://github.com/agamble) [![](https://avatars.githubusercontent.com/u/67593995?u=cfda26bc17e98e1f0b1d7829acb010e0783fd8dc&v=4)](https://github.com/ThanhNguye-n) [@ThanhNguye-n](https://github.com/ThanhNguye-n) [![](https://avatars.githubusercontent.com/u/3660805?u=d06f0923c5f6478f935e317ad901a0a3aef06903&v=4)](https://github.com/igor-drozdov) [@igor-drozdov](https://github.com/igor-drozdov) [![](https://avatars.githubusercontent.com/u/13607221?u=dda5bc6c396f17d83ada9dc57e77e411903e5057&v=4)](https://github.com/KastanDay) [@KastanDay](https://github.com/KastanDay) [![](https://avatars.githubusercontent.com/u/931697?u=4ce45d183c52828da0b4f0ca298d67ad970d43f6&v=4)](https://github.com/seanaedmiston) [@seanaedmiston](https://github.com/seanaedmiston) [![](https://avatars.githubusercontent.com/u/3028543?u=5096311a70425e82c9b1a143d29ccd502c155a7f&v=4)](https://github.com/Randl) [@Randl](https://github.com/Randl) [![](https://avatars.githubusercontent.com/u/115017354?v=4)](https://github.com/NikolaosPapailiou) [@NikolaosPapailiou](https://github.com/NikolaosPapailiou) [![](https://avatars.githubusercontent.com/u/460966?v=4)](https://github.com/ebrehault) [@ebrehault](https://github.com/ebrehault) [![](https://avatars.githubusercontent.com/u/6872942?v=4)](https://github.com/wlleiiwang) [@wlleiiwang](https://github.com/wlleiiwang) [![](https://avatars.githubusercontent.com/u/32112894?u=d317c16ef9614adbeb3cf18ac39239c585db2264&v=4)](https://github.com/santiagxf) [@santiagxf](https://github.com/santiagxf) [![](https://avatars.githubusercontent.com/u/30162978?v=4)](https://github.com/thehappydinoa) [@thehappydinoa](https://github.com/thehappydinoa) [![](https://avatars.githubusercontent.com/u/12056337?u=93476ac29d44271b67ffbce7f055af1f6f294345&v=4)](https://github.com/abhiaagarwal) [@abhiaagarwal](https://github.com/abhiaagarwal) [![](https://avatars.githubusercontent.com/u/30344258?u=51c169c8996024b68e9b3ec0bfe93465940dc8b4&v=4)](https://github.com/LMC117) [@LMC117](https://github.com/LMC117) [![](https://avatars.githubusercontent.com/u/131612909?u=5ea799680a40107fcd922392026312204abb9fe8&v=4)](https://github.com/WilliamEspegren) [@WilliamEspegren](https://github.com/WilliamEspegren) [![](https://avatars.githubusercontent.com/u/7380988?u=ba9beadb7fd3bcd6d8439154bedbd32d5fdbd4d8&v=4)](https://github.com/sunbc0120) [@sunbc0120](https://github.com/sunbc0120) [![](https://avatars.githubusercontent.com/u/18614423?u=1d3dba8e4e87d2a449cc90c204f422327af2d09d&v=4)](https://github.com/Simon-Stone) [@Simon-Stone](https://github.com/Simon-Stone) [![](https://avatars.githubusercontent.com/u/15304273?u=7588e8d8f8a889950b0afd00c2457ec3126ce8f6&v=4)](https://github.com/Amyh102) [@Amyh102](https://github.com/Amyh102) [![](https://avatars.githubusercontent.com/u/67831673?v=4)](https://github.com/shumway743) [@shumway743](https://github.com/shumway743) [![](https://avatars.githubusercontent.com/u/12097018?u=ef0ff38c5959d7e7acf2c87e8e8051ca2d047c76&v=4)](https://github.com/gcheron) [@gcheron](https://github.com/gcheron) [![](https://avatars.githubusercontent.com/u/7102288?u=52db4849a0136c1d78cbc5a5de99ee0073384300&v=4)](https://github.com/zachdj) [@zachdj](https://github.com/zachdj) [![](https://avatars.githubusercontent.com/u/6980212?u=89202482380b379837fd7318dde75a00e83d2459&v=4)](https://github.com/ehsanmok) [@ehsanmok](https://github.com/ehsanmok) [![](https://avatars.githubusercontent.com/u/24109?u=5801e139c8d3bbf45557ba0f79d536f56b7716a8&v=4)](https://github.com/bsbodden) [@bsbodden](https://github.com/bsbodden) [![](https://avatars.githubusercontent.com/u/16619882?u=ed851c7ccfa20588d3cd5ca47e79d94c3e4b6427&v=4)](https://github.com/Trevato) [@Trevato](https://github.com/Trevato) [![](https://avatars.githubusercontent.com/u/13738772?u=1685c6916759c2ec986434af557343f6b29bce32&v=4)](https://github.com/raoufchebri) [@raoufchebri](https://github.com/raoufchebri) [![](https://avatars.githubusercontent.com/u/492616?u=c2ecf6dac54322df081577f6b8e1ca390535c4a6&v=4)](https://github.com/delgermurun) [@delgermurun](https://github.com/delgermurun) [![](https://avatars.githubusercontent.com/u/9665243?u=e403da70029d61dbbb9a2f0e03daebc5418974ed&v=4)](https://github.com/jcjc712) [@jcjc712](https://github.com/jcjc712) [![](https://avatars.githubusercontent.com/u/5901336?u=be9c290e3f2214d93c5e788d7d950c8f63390f06&v=4)](https://github.com/yonarw) [@yonarw](https://github.com/yonarw) [![](https://avatars.githubusercontent.com/u/9089568?u=d2f8bc466003afc3558a96f3266a0e32d5c18c34&v=4)](https://github.com/EvilFreelancer) [@EvilFreelancer](https://github.com/EvilFreelancer) [![](https://avatars.githubusercontent.com/u/32046231?u=db454b8e6da48120d78d3397006928cc86f01019&v=4)](https://github.com/zywilliamli) [@zywilliamli](https://github.com/zywilliamli) [![](https://avatars.githubusercontent.com/u/48098520?u=aa4a7287f484eb32d408360ca340c2f5bc8444d0&v=4)](https://github.com/thaiminhpv) [@thaiminhpv](https://github.com/thaiminhpv) [![](https://avatars.githubusercontent.com/u/8139170?u=a63f55e62ad26febcd94e193c22bfd867d022af2&v=4)](https://github.com/paperMoose) [@paperMoose](https://github.com/paperMoose) [![](https://avatars.githubusercontent.com/u/71520361?v=4)](https://github.com/younis-bash) [@younis-bash](https://github.com/younis-bash) [![](https://avatars.githubusercontent.com/u/16340036?v=4)](https://github.com/rajib76) [@rajib76](https://github.com/rajib76) [![](https://avatars.githubusercontent.com/u/48952237?v=4)](https://github.com/TejaHara) [@TejaHara](https://github.com/TejaHara) [![](https://avatars.githubusercontent.com/u/11153261?u=a5af26e0bd60a27ba4aba60d15b129fc410fe8cc&v=4)](https://github.com/ihpolash) [@ihpolash](https://github.com/ihpolash) [![](https://avatars.githubusercontent.com/u/123224380?v=4)](https://github.com/scadEfUr) [@scadEfUr](https://github.com/scadEfUr) [![](https://avatars.githubusercontent.com/u/51324450?u=25a4838c93e6237e3b6d6ea1fbd23442cfba5723&v=4)](https://github.com/SauhaardW) [@SauhaardW](https://github.com/SauhaardW) [![](https://avatars.githubusercontent.com/u/119924780?v=4)](https://github.com/pranava-amzn) [@pranava-amzn](https://github.com/pranava-amzn) [![](https://avatars.githubusercontent.com/u/16321871?u=458c077105f3c19b5011617fc133386b7ddefe9f&v=4)](https://github.com/fynnfluegge) [@fynnfluegge](https://github.com/fynnfluegge) [![](https://avatars.githubusercontent.com/u/2469198?u=43a8a9e376a5a7db6972e720906fd6f66560d235&v=4)](https://github.com/adilansari) [@adilansari](https://github.com/adilansari) [![](https://avatars.githubusercontent.com/u/13305222?u=6d00fe3cfd2414a9e309540fe49f532fc0e503dd&v=4)](https://github.com/bstadt) [@bstadt](https://github.com/bstadt) [![](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/apps/dependabot) [@dependabot](https://github.com/apps/dependabot) [![](https://avatars.githubusercontent.com/u/42089598?v=4)](https://github.com/PenghuiCheng) [@PenghuiCheng](https://github.com/PenghuiCheng) [![](https://avatars.githubusercontent.com/u/145396613?u=f0da33ee8d74a5353a43f8df3332c9cac2bd70f8&v=4)](https://github.com/giannis2two) [@giannis2two](https://github.com/giannis2two) [![](https://avatars.githubusercontent.com/u/107621925?u=4a7b06f4c0cac2534521698383f58331c00c093f&v=4)](https://github.com/anilaltuner) [@anilaltuner](https://github.com/anilaltuner) [![](https://avatars.githubusercontent.com/u/144132509?u=42f5528898e3f4e3790bf432b8ca662dc347c778&v=4)](https://github.com/bu2kx) [@bu2kx](https://github.com/bu2kx) [![](https://avatars.githubusercontent.com/u/32715913?u=5de749a141259c3fdd8a16c6438aff2b7823fd69&v=4)](https://github.com/AmineDjeghri) [@AmineDjeghri](https://github.com/AmineDjeghri) [![](https://avatars.githubusercontent.com/u/46400934?u=fe4dad00d1e0e6cb555e21ce72bcffa8ec9bf684&v=4)](https://github.com/francesco-kruk) [@francesco-kruk](https://github.com/francesco-kruk) [![](https://avatars.githubusercontent.com/u/1918816?v=4)](https://github.com/bakebrain) [@bakebrain](https://github.com/bakebrain) [![](https://avatars.githubusercontent.com/u/5349024?u=4875b6589899edb51cb083d209bd9fbfac58da18&v=4)](https://github.com/bburgin) [@bburgin](https://github.com/bburgin) [![](https://avatars.githubusercontent.com/u/4271525?u=4e1678b7ca97f74ff6e371d4e234224fd033c524&v=4)](https://github.com/coolbeevip) [@coolbeevip](https://github.com/coolbeevip) [![](https://avatars.githubusercontent.com/u/2806769?u=2969d39e1099584bc34b9e91a718f97107b38cbc&v=4)](https://github.com/sreiswig) [@sreiswig](https://github.com/sreiswig) [![](https://avatars.githubusercontent.com/u/134934501?u=167199ff0bff447057fc5e291be0225ad5260111&v=4)](https://github.com/vrushankportkey) [@vrushankportkey](https://github.com/vrushankportkey) [![](https://avatars.githubusercontent.com/u/4852235?u=f3927adbaafbeaccd6fd4d0bc805414ef08b8b54&v=4)](https://github.com/jxnl) [@jxnl](https://github.com/jxnl) [![](https://avatars.githubusercontent.com/u/8412519?u=391d663c51163f604c14bc625f4d6c11042a0c36&v=4)](https://github.com/arron2003) [@arron2003](https://github.com/arron2003) [![](https://avatars.githubusercontent.com/u/17466553?u=2510816fc74e11bb543f54f97afe1c78e9bda720&v=4)](https://github.com/HashemAlsaket) [@HashemAlsaket](https://github.com/HashemAlsaket) [![](https://avatars.githubusercontent.com/u/20924562?u=3f61dc32f82124727d7157c0977240770ab82c02&v=4)](https://github.com/ea-open-source) [@ea-open-source](https://github.com/ea-open-source) [![](https://avatars.githubusercontent.com/u/1473079?v=4)](https://github.com/constantinmusca) [@constantinmusca](https://github.com/constantinmusca) [![](https://avatars.githubusercontent.com/u/100479?u=5d055e42f37638939325d39ad857dc3a7b466533&v=4)](https://github.com/andrewmbenton) [@andrewmbenton](https://github.com/andrewmbenton) [![](https://avatars.githubusercontent.com/u/74497693?u=0d49e69abc1f1c5299d479d943285fcac7eee1ae&v=4)](https://github.com/Subsegment) [@Subsegment](https://github.com/Subsegment) [![](https://avatars.githubusercontent.com/u/15026857?u=a5129b6393cb746e25fca20655458d248ec4f05d&v=4)](https://github.com/zrcni) [@zrcni](https://github.com/zrcni) [![](https://avatars.githubusercontent.com/u/191493?u=3e803364d95e760cafa108ab29ee109ba0e0af83&v=4)](https://github.com/piizei) [@piizei](https://github.com/piizei) [![](https://avatars.githubusercontent.com/u/58871401?u=81f900fd6c286d9e8c5c8673f68b88387ed491e5&v=4)](https://github.com/RohanDey02) [@RohanDey02](https://github.com/RohanDey02) [![](https://avatars.githubusercontent.com/u/57868915?u=d81c79687784073afcbb10984b7c8f4e5f9d839e&v=4)](https://github.com/therontau0054) [@therontau0054](https://github.com/therontau0054) [![](https://avatars.githubusercontent.com/u/14224983?u=2a696ae181971f12ace4f252b759e1ca75ccdb44&v=4)](https://github.com/demjened) [@demjened](https://github.com/demjened) [![](https://avatars.githubusercontent.com/u/3285355?u=8f91986cb97c2efcd84d62e339d8be43562de13d&v=4)](https://github.com/killinsun) [@killinsun](https://github.com/killinsun) [![](https://avatars.githubusercontent.com/u/291370?u=5802ab31e0feb7ae15465dedaa48ba646f0a4127&v=4)](https://github.com/sanzgiri) [@sanzgiri](https://github.com/sanzgiri) [![](https://avatars.githubusercontent.com/u/51958314?u=ff1c617481aa52a540a1b444280c9308beb83db5&v=4)](https://github.com/sp35) [@sp35](https://github.com/sp35) [![](https://avatars.githubusercontent.com/u/82636823?u=e7e57044f6fca0b0255dfeac66a8c3ec660263c6&v=4)](https://github.com/Yash-1511) [@Yash-1511](https://github.com/Yash-1511) [![](https://avatars.githubusercontent.com/u/20760062?u=422c372863e9c42406db2241e41cc52c522431ef&v=4)](https://github.com/abdalrohman) [@abdalrohman](https://github.com/abdalrohman) [![](https://avatars.githubusercontent.com/u/3118964?u=471d785af68097fa9edeaa7bcd130b56ddda6338&v=4)](https://github.com/coyotespike) [@coyotespike](https://github.com/coyotespike) [![](https://avatars.githubusercontent.com/u/1039756?u=1e32f3165c823547362784b17f65f7690b56e0b0&v=4)](https://github.com/zchenyu) [@zchenyu](https://github.com/zchenyu) [![](https://avatars.githubusercontent.com/u/83261447?v=4)](https://github.com/yuwenzho) [@yuwenzho](https://github.com/yuwenzho) [![](https://avatars.githubusercontent.com/u/132831962?u=d91bc0c46bc4c4df36d752076418530eea55a5dc&v=4)](https://github.com/ricki-epsilla) [@ricki-epsilla](https://github.com/ricki-epsilla) [![](https://avatars.githubusercontent.com/u/2914618?v=4)](https://github.com/HassanOuda) [@HassanOuda](https://github.com/HassanOuda) [![](https://avatars.githubusercontent.com/u/2215597?u=d5558c7d5c1ab6d4a8e5381826abd1f00371a5be&v=4)](https://github.com/s-udhaya) [@s-udhaya](https://github.com/s-udhaya) [![](https://avatars.githubusercontent.com/u/5522060?v=4)](https://github.com/tesfagabir) [@tesfagabir](https://github.com/tesfagabir) [![](https://avatars.githubusercontent.com/u/56334152?v=4)](https://github.com/chocolate4) [@chocolate4](https://github.com/chocolate4) [![](https://avatars.githubusercontent.com/u/13938372?u=0e3f80aa515c41b7d9084b73d761cad378ebdc7a&v=4)](https://github.com/jasondotparse) [@jasondotparse](https://github.com/jasondotparse) [![](https://avatars.githubusercontent.com/u/12449236?u=f13eba9cfa9baf8fa9a0fce667eb2fe429ecd298&v=4)](https://github.com/bwmatson) [@bwmatson](https://github.com/bwmatson) [![](https://avatars.githubusercontent.com/u/38718601?u=44687611a0b7bd160ee129d04d4220d98f32ebab&v=4)](https://github.com/Daggx) [@Daggx](https://github.com/Daggx) [![](https://avatars.githubusercontent.com/u/848849?v=4)](https://github.com/seth-hg) [@seth-hg](https://github.com/seth-hg) [![](https://avatars.githubusercontent.com/u/34580718?u=cf4ff62610ff72ad9580d328e38f32e306d6150f&v=4)](https://github.com/NolanTrem) [@NolanTrem](https://github.com/NolanTrem) [![](https://avatars.githubusercontent.com/u/9007876?v=4)](https://github.com/mpb159753) [@mpb159753](https://github.com/mpb159753) [![](https://avatars.githubusercontent.com/u/800430?v=4)](https://github.com/mikeknoop) [@mikeknoop](https://github.com/mikeknoop) [![](https://avatars.githubusercontent.com/u/57349093?v=4)](https://github.com/datelier) [@datelier](https://github.com/datelier) [![](https://avatars.githubusercontent.com/u/9028897?v=4)](https://github.com/jakerachleff) [@jakerachleff](https://github.com/jakerachleff) [![](https://avatars.githubusercontent.com/u/13024750?u=6ae631199ec7c0bb34eb8d56200023cdd94720d3&v=4)](https://github.com/JamsheedMistri) [@JamsheedMistri](https://github.com/JamsheedMistri) [![](https://avatars.githubusercontent.com/u/42374034?u=cfb14ff1a7c4f0a500cd9c282bc3fbcba170daef&v=4)](https://github.com/atherfawaz) [@atherfawaz](https://github.com/atherfawaz) [![](https://avatars.githubusercontent.com/u/6012338?u=198f10817236beac03b10bb8f5cc6d7fcb133cc7&v=4)](https://github.com/Hugoberry) [@Hugoberry](https://github.com/Hugoberry) [![](https://avatars.githubusercontent.com/u/54216004?u=6a387166a0e8599c4f3ff35f61c12458df539f96&v=4)](https://github.com/Haris-Ali007) [@Haris-Ali007](https://github.com/Haris-Ali007) [![](https://avatars.githubusercontent.com/u/52078762?u=60001db024892c1a54ea9c91d2d6f1befbbe53df&v=4)](https://github.com/AlpinDale) [@AlpinDale](https://github.com/AlpinDale) [![](https://avatars.githubusercontent.com/u/70274018?u=b6d5fd627cd26f590ed442d4dffa5bdddcb803cc&v=4)](https://github.com/jjovalle99) [@jjovalle99](https://github.com/jjovalle99) [![](https://avatars.githubusercontent.com/u/7529846?u=bd1b12fa55583ac7f01c4440cad87163a0fe3c19&v=4)](https://github.com/DN6) [@DN6](https://github.com/DN6) [![](https://avatars.githubusercontent.com/u/83648453?u=9cb34e2b4ef5be7311fc0cd9949280542f8947d8&v=4)](https://github.com/spike-spiegel-21) [@spike-spiegel-21](https://github.com/spike-spiegel-21) [![](https://avatars.githubusercontent.com/u/91102080?u=c87d3f88e6b05445a121c204a0d39a0b9ec17e05&v=4)](https://github.com/mziru) [@mziru](https://github.com/mziru) [![](https://avatars.githubusercontent.com/u/56706206?v=4)](https://github.com/Dylan20XX) [@Dylan20XX](https://github.com/Dylan20XX) [![](https://avatars.githubusercontent.com/u/8936233?u=07eb2625319cd0fd18df747fcdeef42cd9fc981d&v=4)](https://github.com/xingfanxia) [@xingfanxia](https://github.com/xingfanxia) [![](https://avatars.githubusercontent.com/u/16275535?v=4)](https://github.com/NoahBPeterson) [@NoahBPeterson](https://github.com/NoahBPeterson) [![](https://avatars.githubusercontent.com/u/74933942?u=a952add7652d59815f24581d83f504216780521b&v=4)](https://github.com/0xJord4n) [@0xJord4n](https://github.com/0xJord4n) [![](https://avatars.githubusercontent.com/u/9987313?u=4a0795de6a3fa3101b9469e9d2a626ee7a0451b5&v=4)](https://github.com/yuncliu) [@yuncliu](https://github.com/yuncliu) [![](https://avatars.githubusercontent.com/u/29782447?u=a8804de5269d64ef1c2587945e1b40925349c4a0&v=4)](https://github.com/tabbyl21) [@tabbyl21](https://github.com/tabbyl21) [![](https://avatars.githubusercontent.com/u/38180263?u=d514276e558f3f3aaba4844fdeb14eb84e9c8cc2&v=4)](https://github.com/naman-modi) [@naman-modi](https://github.com/naman-modi) [![](https://avatars.githubusercontent.com/u/126395124?u=79cff420daf96b72b14caca0061b57b884139f4f&v=4)](https://github.com/sokolgood) [@sokolgood](https://github.com/sokolgood) [![](https://avatars.githubusercontent.com/u/2310608?u=1e5009aa6681eed766a14cfb8849d820821dddce&v=4)](https://github.com/harelix) [@harelix](https://github.com/harelix) [![](https://avatars.githubusercontent.com/u/107643?v=4)](https://github.com/standby24x7) [@standby24x7](https://github.com/standby24x7) [![](https://avatars.githubusercontent.com/u/170204500?u=a36d4ca4f908cababd62f93eb4a3fbd287ad6b31&v=4)](https://github.com/changliu-0520) [@changliu-0520](https://github.com/changliu-0520) [![](https://avatars.githubusercontent.com/u/37549748?v=4)](https://github.com/lts-rad) [@lts-rad](https://github.com/lts-rad) [![](https://avatars.githubusercontent.com/u/9869689?u=b572050134e1e6a3c0096d2b032a5dec32725222&v=4)](https://github.com/nuric) [@nuric](https://github.com/nuric) [![](https://avatars.githubusercontent.com/u/16749003?v=4)](https://github.com/akshaya-a) [@akshaya-a](https://github.com/akshaya-a) [![](https://avatars.githubusercontent.com/u/16641288?u=f659a34367a54ea7ac49bc2a51ac27f4a72c770b&v=4)](https://github.com/edreisMD) [@edreisMD](https://github.com/edreisMD) [![](https://avatars.githubusercontent.com/u/18373802?u=92b9ba56d4178115777a0a1a7d2bf88c162f3fce&v=4)](https://github.com/ar-mccabe) [@ar-mccabe](https://github.com/ar-mccabe) [![](https://avatars.githubusercontent.com/u/23738320?u=5193798d57e7e887fb121101272718f4f120f56c&v=4)](https://github.com/BobMerkus) [@BobMerkus](https://github.com/BobMerkus) [![](https://avatars.githubusercontent.com/u/98005188?u=21b5e30aa6464f46e85aa006cb44b2bd18c89347&v=4)](https://github.com/Navanit-git) [@Navanit-git](https://github.com/Navanit-git) [![](https://avatars.githubusercontent.com/u/127131037?u=74ffbf6c2a443f51f7e72d00b0a4e9a30b9e1c4c&v=4)](https://github.com/david-huge) [@david-huge](https://github.com/david-huge) [![](https://avatars.githubusercontent.com/u/91344214?u=5c34c21b464a6bbffd83a07aafac2cf9076856db&v=4)](https://github.com/rotemweiss57) [@rotemweiss57](https://github.com/rotemweiss57) [![](https://avatars.githubusercontent.com/u/29104739?u=855b03bee0b9994fbf1e7eba2be25152ecfdefbc&v=4)](https://github.com/sharmisthasg) [@sharmisthasg](https://github.com/sharmisthasg) [![](https://avatars.githubusercontent.com/u/9272497?u=bde02b58aebeb42b77cd6678456e8ead7f50ab66&v=4)](https://github.com/hmilkovi) [@hmilkovi](https://github.com/hmilkovi) [![](https://avatars.githubusercontent.com/u/42059733?u=502e381ca0e17491298e90ac3c5db019dd484efc&v=4)](https://github.com/vreyespue) [@vreyespue](https://github.com/vreyespue) [![](https://avatars.githubusercontent.com/u/2792?u=f5d3e57d22f60b27f9c87430dc45bceb49e88215&v=4)](https://github.com/deepblue) [@deepblue](https://github.com/deepblue) [![](https://avatars.githubusercontent.com/u/79035539?u=fef791ebd0cfd10281254b81a96cd8bf6907f8c6&v=4)](https://github.com/mrugank-wadekar) [@mrugank-wadekar](https://github.com/mrugank-wadekar) [![](https://avatars.githubusercontent.com/u/6087484?u=45381a549e19872d386ca7a7bf399dd571f2f3e8&v=4)](https://github.com/niklub) [@niklub](https://github.com/niklub) [![](https://avatars.githubusercontent.com/u/1081215?v=4)](https://github.com/dirtysalt) [@dirtysalt](https://github.com/dirtysalt) [![](https://avatars.githubusercontent.com/u/2138258?u=7de291a1ce0c95d6589496ba8e1d056c054ced00&v=4)](https://github.com/zeiler) [@zeiler](https://github.com/zeiler) [![](https://avatars.githubusercontent.com/u/46605732?u=a77312f77cca12c30f506c0e68537ff80898bb25&v=4)](https://github.com/moyid) [@moyid](https://github.com/moyid) [![](https://avatars.githubusercontent.com/u/16364994?u=d8603567cb87b4f76f0df2f7937252ae040cbebf&v=4)](https://github.com/sachinparyani) [@sachinparyani](https://github.com/sachinparyani) [![](https://avatars.githubusercontent.com/u/20786?u=221de3ff264dd81ae3e168ba2c4e726e5d861881&v=4)](https://github.com/lsloan) [@lsloan](https://github.com/lsloan) [![](https://avatars.githubusercontent.com/u/27913091?u=af5f1ab3c8383109dfed085fd2e2aa09599dece8&v=4)](https://github.com/ju-bezdek) [@ju-bezdek](https://github.com/ju-bezdek) [![](https://avatars.githubusercontent.com/u/108557828?u=1f1cc6b7e04613034c6ee4add7846c5a7333da26&v=4)](https://github.com/ColabDog) [@ColabDog](https://github.com/ColabDog) [![](https://avatars.githubusercontent.com/u/37485638?u=da12a62d4aab6404e41f77772ae61ecc0e816c88&v=4)](https://github.com/hanit-com) [@hanit-com](https://github.com/hanit-com) [![](https://avatars.githubusercontent.com/u/68591522?u=af3217265b078969783ccbf5159101a5973e7aeb&v=4)](https://github.com/kevaldekivadiya2415) [@kevaldekivadiya2415](https://github.com/kevaldekivadiya2415) [![](https://avatars.githubusercontent.com/u/2748495?v=4)](https://github.com/manmax31) [@manmax31](https://github.com/manmax31) [![](https://avatars.githubusercontent.com/u/38863?v=4)](https://github.com/imrehg) [@imrehg](https://github.com/imrehg) [![](https://avatars.githubusercontent.com/u/8631181?u=dc75ce249013c6fc7f30c742875cb236c9d2bec3&v=4)](https://github.com/ldorigo) [@ldorigo](https://github.com/ldorigo) [![](https://avatars.githubusercontent.com/u/1454551?u=14928571307ed348c362e902edc913f6d81fea07&v=4)](https://github.com/janchorowski) [@janchorowski](https://github.com/janchorowski) [![](https://avatars.githubusercontent.com/u/90774897?v=4)](https://github.com/AthulVincent) [@AthulVincent](https://github.com/AthulVincent) [![](https://avatars.githubusercontent.com/u/23078323?u=7524c4ab19b061e21e62ddd6b48b6084fd6d54c1&v=4)](https://github.com/tamohannes) [@tamohannes](https://github.com/tamohannes) [![](https://avatars.githubusercontent.com/u/49598618?u=2d8024560f2f936312e819348cc18db338961fb7&v=4)](https://github.com/boazwasserman) [@boazwasserman](https://github.com/boazwasserman) [![](https://avatars.githubusercontent.com/u/3598211?u=4cae081d5f8478165567af32a1012b7819ad3de3&v=4)](https://github.com/gkermit) [@gkermit](https://github.com/gkermit) [![](https://avatars.githubusercontent.com/u/30856?v=4)](https://github.com/dsummersl) [@dsummersl](https://github.com/dsummersl) [![](https://avatars.githubusercontent.com/u/280981?u=6c969bb88d84ac2c2ea100389504f63ac9155425&v=4)](https://github.com/idvorkin) [@idvorkin](https://github.com/idvorkin) [![](https://avatars.githubusercontent.com/u/24319338?v=4)](https://github.com/vempaliakhil96) [@vempaliakhil96](https://github.com/vempaliakhil96) [![](https://avatars.githubusercontent.com/u/18140070?u=1992cdb13c62ee66f4ccc8f000d2c6efae3056c3&v=4)](https://github.com/C-K-Loan) [@C-K-Loan](https://github.com/C-K-Loan) [![](https://avatars.githubusercontent.com/u/18020640?u=d47ad1cc8fb82340d1c77d1f191038372987f85a&v=4)](https://github.com/daniel-brenot) [@daniel-brenot](https://github.com/daniel-brenot) [![](https://avatars.githubusercontent.com/u/20795854?u=e0a8116151662cf0126b274f74fd279f34febf93&v=4)](https://github.com/jwbeck97) [@jwbeck97](https://github.com/jwbeck97) [![](https://avatars.githubusercontent.com/u/497264?u=b315947bb39241aa106b760051d903209096fc58&v=4)](https://github.com/giacbrd) [@giacbrd](https://github.com/giacbrd) We're so thankful for your support! And one more thank you to [@tiangolo](https://github.com/tiangolo) for inspiration via FastAPI's [excellent people page](https://fastapi.tiangolo.com/fastapi-people) . * * * #### Was this page helpful? --- # Error reference | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/troubleshooting/errors/index.mdx) This page contains guides around resolving common errors you may find while building with LangChain. Errors referenced below will have an `lc_error_code` property corresponding to one of the below codes when they are thrown in code. * [INVALID\_PROMPT\_INPUT](/docs/troubleshooting/errors/INVALID_PROMPT_INPUT/) * [INVALID\_TOOL\_RESULTS](/docs/troubleshooting/errors/INVALID_TOOL_RESULTS/) * [MESSAGE\_COERCION\_FAILURE](/docs/troubleshooting/errors/MESSAGE_COERCION_FAILURE/) * [MODEL\_AUTHENTICATION](/docs/troubleshooting/errors/MODEL_AUTHENTICATION/) * [MODEL\_NOT\_FOUND](/docs/troubleshooting/errors/MODEL_NOT_FOUND/) * [MODEL\_RATE\_LIMIT](/docs/troubleshooting/errors/MODEL_RATE_LIMIT/) * [OUTPUT\_PARSING\_FAILURE](/docs/troubleshooting/errors/OUTPUT_PARSING_FAILURE/) * * * #### Was this page helpful? --- # Introduction | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) A newer LangChain version is out! Check out the [latest version](https://python.langchain.com/docs/introduction) . This is documentation for LangChain **v0.2**, which is no longer actively maintained. For the current stable version, see **[this version](https://python.langchain.com/docs/introduction/) ** (Latest). On this page Introduction ============ **LangChain** is a framework for developing applications powered by large language models (LLMs). LangChain simplifies every stage of the LLM application lifecycle: * **Development**: Build your applications using LangChain's open-source [building blocks](/v0.2/docs/concepts/#langchain-expression-language-lcel) , [components](/v0.2/docs/concepts/) , and [third-party integrations](/v0.2/docs/integrations/platforms/) . Use [LangGraph](/v0.2/docs/concepts/#langgraph) to build stateful agents with first-class streaming and human-in-the-loop support. * **Productionization**: Use [LangSmith](https://docs.smith.langchain.com/) to inspect, monitor and evaluate your chains, so that you can continuously optimize and deploy with confidence. * **Deployment**: Turn your LangGraph applications into production-ready APIs and Assistants with [LangGraph Cloud](https://langchain-ai.github.io/langgraph/cloud/) . ![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](/v0.2/svg/langchain_stack_062024.svg "LangChain Framework Overview")![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](/v0.2/svg/langchain_stack_062024_dark.svg "LangChain Framework Overview") Concretely, the framework consists of the following open-source libraries: * **`langchain-core`**: Base abstractions and LangChain Expression Language. * **`langchain-community`**: Third party integrations. * Partner packages (e.g. **`langchain-openai`**, **`langchain-anthropic`**, etc.): Some integrations have been further split into their own lightweight packages that only depend on **`langchain-core`**. * **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. * **[LangGraph](https://langchain-ai.github.io/langgraph) **: Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. Integrates smoothly with LangChain, but can be used without it. * **[LangServe](/v0.2/docs/langserve/) **: Deploy LangChain chains as REST APIs. * **[LangSmith](https://docs.smith.langchain.com) **: A developer platform that lets you debug, test, evaluate, and monitor LLM applications. note These docs focus on the Python LangChain library. [Head here](https://js.langchain.com) for docs on the JavaScript LangChain library. [Tutorials](/v0.2/docs/tutorials/) [​](#tutorials "Direct link to tutorials") ------------------------------------------------------------------------------ If you're looking to build something specific or are more of a hands-on learner, check out our [tutorials section](/v0.2/docs/tutorials/) . This is the best place to get started. These are the best ones to get started with: * [Build a Simple LLM Application](/v0.2/docs/tutorials/llm_chain/) * [Build a Chatbot](/v0.2/docs/tutorials/chatbot/) * [Build an Agent](/v0.2/docs/tutorials/agents/) * [Introduction to LangGraph](https://langchain-ai.github.io/langgraph/tutorials/introduction/) Explore the full list of LangChain tutorials [here](/v0.2/docs/tutorials/) , and check out other [LangGraph tutorials here](https://langchain-ai.github.io/langgraph/tutorials/) . To learn more about LangGraph, check out our first LangChain Academy course, _Introduction to LangGraph_, available [here](https://academy.langchain.com/courses/intro-to-langgraph) . [How-to guides](/v0.2/docs/how_to/) [​](#how-to-guides "Direct link to how-to-guides") --------------------------------------------------------------------------------------- [Here](/v0.2/docs/how_to/) you’ll find short answers to β€œHow do I….?” types of questions. These how-to guides don’t cover topics in depth – you’ll find that material in the [Tutorials](/v0.2/docs/tutorials/) and the [API Reference](https://python.langchain.com/v0.2/api_reference/) . However, these guides will help you quickly accomplish common tasks. Check out [LangGraph-specific how-tos here](https://langchain-ai.github.io/langgraph/how-tos/) . [Conceptual guide](/v0.2/docs/concepts/) [​](#conceptual-guide "Direct link to conceptual-guide") -------------------------------------------------------------------------------------------------- Introductions to all the key parts of LangChain you’ll need to know! [Here](/v0.2/docs/concepts/) you'll find high level explanations of all LangChain concepts. For a deeper dive into LangGraph concepts, check out [this page](https://langchain-ai.github.io/langgraph/concepts/) . [API reference](https://python.langchain.com/v0.2/api_reference/) [​](#api-reference "Direct link to api-reference") --------------------------------------------------------------------------------------------------------------------- Head to the reference section for full documentation of all classes and methods in the LangChain Python packages. Ecosystem[​](#ecosystem "Direct link to Ecosystem") ---------------------------------------------------- ### [πŸ¦œπŸ› οΈ LangSmith](https://docs.smith.langchain.com) [​](#️-langsmith "Direct link to ️-langsmith") Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production. ### [πŸ¦œπŸ•ΈοΈ LangGraph](https://langchain-ai.github.io/langgraph) [​](#️-langgraph "Direct link to ️-langgraph") Build stateful, multi-actor applications with LLMs. Integrates smoothly with LangChain, but can be used without it. Additional resources[​](#additional-resources "Direct link to Additional resources") ------------------------------------------------------------------------------------- ### [Versions](/v0.2/docs/versions/overview/) [​](#versions "Direct link to versions") See what changed in v0.2, learn how to migrate legacy code, and read up on our release/versioning policies, and more. ### [Security](/v0.2/docs/security/) [​](#security "Direct link to security") Read up on [security](/v0.2/docs/security/) best practices to make sure you're developing safely with LangChain. ### [Integrations](/v0.2/docs/integrations/providers/) [​](#integrations "Direct link to integrations") LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of [integrations](/v0.2/docs/integrations/providers/) . ### [Contributing](/v0.2/docs/contributing/) [​](#contributing "Direct link to contributing") Check out the developer's guide for guidelines on contributing and help getting your dev environment set up. * * * #### Was this page helpful? #### You can also leave detailed feedback [on GitHub](https://github.com/langchain-ai/langchain/issues/new?assignees=&labels=03+-+Documentation&projects=&template=documentation.yml&title=DOC%3A+%3CPlease+write+a+comprehensive+title+after+the+%27DOC%3A+%27+prefix%3E) . * [Tutorials](#tutorials) * [How-to guides](#how-to-guides) * [Conceptual guide](#conceptual-guide) * [API reference](#api-reference) * [Ecosystem](#ecosystem) * [πŸ¦œπŸ› οΈ LangSmith](#️-langsmith) * [πŸ¦œπŸ•ΈοΈ LangGraph](#️-langgraph) * [Additional resources](#additional-resources) * [Versions](#versions) * [Security](#security) * [Integrations](#integrations) * [Contributing](#contributing) --- # Tutorials | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/index.mdx) New to LangChain or LLM app development in general? Read this material to quickly get up and running building your first applications. Get started[​](#get-started "Direct link to Get started") ---------------------------------------------------------- Familiarize yourself with LangChain's open-source components by building simple applications. If you're looking to get started with [chat models](/docs/integrations/chat/) , [vector stores](/docs/integrations/vectorstores/) , or other LangChain components from a specific provider, check out our supported [integrations](/docs/integrations/providers/) . * [Chat models and prompts](/docs/tutorials/llm_chain/) : Build a simple LLM application with [prompt templates](/docs/concepts/prompt_templates/) and [chat models](/docs/concepts/chat_models/) . * [Semantic search](/docs/tutorials/retrievers/) : Build a semantic search engine over a PDF with [document loaders](/docs/concepts/document_loaders/) , [embedding models](/docs/concepts/embedding_models/) , and [vector stores](/docs/concepts/vectorstores/) . * [Classification](/docs/tutorials/classification/) : Classify text into categories or labels using [chat models](/docs/concepts/chat_models/) with [structured outputs](/docs/concepts/structured_outputs/) . * [Extraction](/docs/tutorials/extraction/) : Extract structured data from text and other unstructured media using [chat models](/docs/concepts/chat_models/) and [few-shot examples](/docs/concepts/few_shot_prompting/) . Refer to the [how-to guides](/docs/how_to/) for more detail on using all LangChain components. Orchestration[​](#orchestration "Direct link to Orchestration") ---------------------------------------------------------------- Get started using [LangGraph](https://langchain-ai.github.io/langgraph/) to assemble LangChain components into full-featured applications. * [Chatbots](/docs/tutorials/chatbot/) : Build a chatbot that incorporates memory. * [Agents](/docs/tutorials/agents/) : Build an agent that interacts with external tools. * [Retrieval Augmented Generation (RAG) Part 1](/docs/tutorials/rag/) : Build an application that uses your own documents to inform its responses. * [Retrieval Augmented Generation (RAG) Part 2](/docs/tutorials/qa_chat_history/) : Build a RAG application that incorporates a memory of its user interactions and multi-step retrieval. * [Question-Answering with SQL](/docs/tutorials/sql_qa/) : Build a question-answering system that executes SQL queries to inform its responses. * [Summarization](/docs/tutorials/summarization/) : Generate summaries of (potentially long) texts. * [Question-Answering with Graph Databases](/docs/tutorials/graph/) : Build a question-answering system that queries a graph database to inform its responses. LangSmith[​](#langsmith "Direct link to LangSmith") ---------------------------------------------------- LangSmith allows you to closely trace, monitor and evaluate your LLM application. It seamlessly integrates with LangChain, and you can use it to inspect and debug individual steps of your chains as you build. LangSmith documentation is hosted on a separate site. You can peruse [LangSmith tutorials here](https://docs.smith.langchain.com/tutorials/) . ### Evaluation[​](#evaluation "Direct link to Evaluation") LangSmith helps you evaluate the performance of your LLM applications. The tutorial below is a great way to get started: * [Evaluate your LLM application](https://docs.smith.langchain.com/tutorials/Developers/evaluation) * * * #### Was this page helpful? * [Get started](#get-started) * [Orchestration](#orchestration) * [LangSmith](#langsmith) * [Evaluation](#evaluation) --- # Introduction | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) This is documentation for LangChain v0.1, which is no longer actively maintained. Check out the docs for the [latest version here](https://python.langchain.com/docs/introduction) . This is documentation for LangChain **v0.1**, which is no longer actively maintained. For the current stable version, see **[this version](https://python.langchain.com/docs/tutorials/) ** (Latest). On this page Introduction ============ **LangChain** is a framework for developing applications powered by large language models (LLMs). LangChain simplifies every stage of the LLM application lifecycle: * **Development**: Build your applications using LangChain's open-source [building blocks](/v0.1/docs/expression_language/) and [components](/v0.1/docs/modules/) . Hit the ground running using [third-party integrations](/v0.1/docs/integrations/platforms/) and [Templates](/v0.1/docs/templates/) . * **Productionization**: Use [LangSmith](/v0.1/docs/langsmith/) to inspect, monitor and evaluate your chains, so that you can continuously optimize and deploy with confidence. * **Deployment**: Turn any chain into an API with [LangServe](/v0.1/docs/langserve/) . ![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](/v0.1/svg/langchain_stack.svg "LangChain Framework Overview")![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](/v0.1/svg/langchain_stack_dark.svg "LangChain Framework Overview") Concretely, the framework consists of the following open-source libraries: * **`langchain-core`**: Base abstractions and LangChain Expression Language. * **`langchain-community`**: Third party integrations. * Partner packages (e.g. **`langchain-openai`**, **`langchain-anthropic`**, etc.): Some integrations have been further split into their own lightweight packages that only depend on **`langchain-core`**. * **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. * **[langgraph](https://langchain-ai.github.io/langgraph/) **: Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. * **[langserve](/v0.1/docs/langserve/) **: Deploy LangChain chains as REST APIs. The broader ecosystem includes: * **[LangSmith](/v0.1/docs/langsmith/) **: A developer platform that lets you debug, test, evaluate, and monitor LLM applications and seamlessly integrates with LangChain. Get started[​](#get-started "Direct link to Get started") ---------------------------------------------------------- We recommend following our [Quickstart](/v0.1/docs/get_started/quickstart/) guide to familiarize yourself with the framework by building your first LangChain application. [See here](/v0.1/docs/get_started/installation/) for instructions on how to install LangChain, set up your environment, and start building. note These docs focus on the Python LangChain library. [Head here](https://js.langchain.com) for docs on the JavaScript LangChain library. Use cases[​](#use-cases "Direct link to Use cases") ---------------------------------------------------- If you're looking to build something specific or are more of a hands-on learner, check out our [use-cases](/v0.1/docs/use_cases/) . They're walkthroughs and techniques for common end-to-end tasks, such as: * [Question answering with RAG](/v0.1/docs/use_cases/question_answering/) * [Extracting structured output](/v0.1/docs/use_cases/extraction/) * [Chatbots](/v0.1/docs/use_cases/chatbots/) * and more! Expression Language[​](#expression-language "Direct link to Expression Language") ---------------------------------------------------------------------------------- LangChain Expression Language (LCEL) is the foundation of many of LangChain's components, and is a declarative way to compose chains. LCEL was designed from day 1 to support putting prototypes in production, with no code changes, from the simplest β€œprompt + LLM” chain to the most complex chains. * **[Get started](/v0.1/docs/expression_language/) **: LCEL and its benefits * **[Runnable interface](/v0.1/docs/expression_language/interface/) **: The standard interface for LCEL objects * **[Primitives](/v0.1/docs/expression_language/primitives/) **: More on the primitives LCEL includes * and more! Ecosystem[​](#ecosystem "Direct link to Ecosystem") ---------------------------------------------------- ### [πŸ¦œπŸ› οΈ LangSmith](/v0.1/docs/langsmith/) [​](#️-langsmith "Direct link to ️-langsmith") Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production. ### [πŸ¦œπŸ•ΈοΈ LangGraph](https://langchain-ai.github.io/langgraph/) [​](#️-langgraph "Direct link to ️-langgraph") Build stateful, multi-actor applications with LLMs, built on top of (and intended to be used with) LangChain primitives. ### [πŸ¦œπŸ“ LangServe](/v0.1/docs/langserve/) [​](#-langserve "Direct link to -langserve") Deploy LangChain runnables and chains as REST APIs. [Security](/v0.1/docs/security/) [​](#security "Direct link to security") -------------------------------------------------------------------------- Read up on our [Security](/v0.1/docs/security/) best practices to make sure you're developing safely with LangChain. Additional resources[​](#additional-resources "Direct link to Additional resources") ------------------------------------------------------------------------------------- ### [Components](/v0.1/docs/modules/) [​](#components "Direct link to components") LangChain provides standard, extendable interfaces and integrations for many different components, including: ### [Integrations](/v0.1/docs/integrations/providers/) [​](#integrations "Direct link to integrations") LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of [integrations](/v0.1/docs/integrations/providers/) . ### [Guides](/v0.1/docs/guides/) [​](#guides "Direct link to guides") Best practices for developing with LangChain. ### [API reference](https://api.python.langchain.com) [​](#api-reference "Direct link to api-reference") Head to the reference section for full documentation of all classes and methods in the LangChain and LangChain Experimental Python packages. ### [Contributing](/v0.1/docs/contributing/) [​](#contributing "Direct link to contributing") Check out the developer's guide for guidelines on contributing and help getting your dev environment set up. * * * #### Help us out by providing feedback on this documentation page: * [Get started](#get-started) * [Use cases](#use-cases) * [Expression Language](#expression-language) * [Ecosystem](#ecosystem) * [πŸ¦œπŸ› οΈ LangSmith](#️-langsmith) * [πŸ¦œπŸ•ΈοΈ LangGraph](#️-langgraph) * [πŸ¦œπŸ“ LangServe](#-langserve) * [Security](#security) * [Additional resources](#additional-resources) * [Components](#components) * [Integrations](#integrations) * [Guides](#guides) * [API reference](#api-reference) * [Contributing](#contributing) --- # LangChain Python API Reference β€” πŸ¦œπŸ”— LangChain documentation [Skip to main content](#main-content) Back to top Ctrl+K [Docs](https://python.langchain.com/) * [GitHub](https://github.com/langchain-ai/langchain "GitHub") * [X / Twitter](https://twitter.com/langchainai "X / Twitter") LangChain Python API Reference[#](#langchain-python-api-reference "Link to this heading") ========================================================================================== Welcome to the LangChain Python API reference. This is a reference for all `langchain-x` packages. For user guides see [https://python.langchain.com](https://python.langchain.com) . For the legacy API reference hosted on ReadTheDocs see [https://api.python.langchain.com/](https://api.python.langchain.com/) . Base packages[#](#base-packages "Link to this heading") -------------------------------------------------------- **Core** langchain-core: 0.3.28 [core/index.html](core/index.html) **Langchain** langchain: 0.3.13 [langchain/index.html](langchain/index.html) **Text Splitters** langchain-text-splitters: 0.3.4 [text\_splitters/index.html](text_splitters/index.html) **Community** langchain-community: 0.3.13 [community/index.html](community/index.html) **Experimental** langchain-experimental: 0.3.4 [experimental/index.html](experimental/index.html) Integrations[#](#integrations "Link to this heading") ------------------------------------------------------ **OpenAI** langchain-openai 0.2.14 [openai/index.html](openai/index.html) **Anthropic** langchain-anthropic 0.3.1 [anthropic/index.html](anthropic/index.html) **Google VertexAI** langchain-google-vertexai 2.0.10 [google\_vertexai/index.html](google_vertexai/index.html) **AWS** langchain-aws 0.2.10 [aws/index.html](aws/index.html) **Huggingface** langchain-huggingface 0.1.2 [huggingface/index.html](huggingface/index.html) **MistralAI** langchain-mistralai 0.2.4 [mistralai/index.html](mistralai/index.html) See the full list of integrations in the Section Navigation. On this page --- # Build a simple LLM application with chat models and prompt templates | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/llm_chain.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/llm_chain.ipynb) In this quickstart we'll show you how to build a simple LLM application with LangChain. This application will translate text from English into another language. This is a relatively simple LLM application - it's just a single LLM call plus some prompting. Still, this is a great way to get started with LangChain - a lot of features can be built with just some prompting and an LLM call! After reading this tutorial, you'll have a high level overview of: * Using [language models](/docs/concepts/chat_models/) * Using [prompt templates](/docs/concepts/prompt_templates/) * Debugging and tracing your application using [LangSmith](https://docs.smith.langchain.com/) Let's dive in! Setup[​](#setup "Direct link to Setup") ---------------------------------------- ### Jupyter Notebook[​](#jupyter-notebook "Direct link to Jupyter Notebook") This and other tutorials are perhaps most conveniently run in a [Jupyter notebooks](https://jupyter.org/) . Going through guides in an interactive environment is a great way to better understand them. See [here](https://jupyter.org/install) for instructions on how to install. ### Installation[​](#installation "Direct link to Installation") To install LangChain run: * Pip * Conda pip install langchain conda install langchain -c conda-forge For more details, see our [Installation guide](/docs/how_to/installation/) . ### LangSmith[​](#langsmith "Direct link to LangSmith") Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent. The best way to do this is with [LangSmith](https://smith.langchain.com) . After you sign up at the link above, make sure to set your environment variables to start logging traces: export LANGCHAIN_TRACING_V2="true"export LANGCHAIN_API_KEY="..." Or, if in a notebook, you can set them with: import getpassimport osos.environ["LANGCHAIN_TRACING_V2"] = "true"os.environ["LANGCHAIN_API_KEY"] = getpass.getpass() Using Language Models[​](#using-language-models "Direct link to Using Language Models") ---------------------------------------------------------------------------------------- First up, let's learn how to use a language model by itself. LangChain supports many different language models that you can use interchangeably. For details on getting started with a specific model, refer to [supported integrations](/docs/integrations/chat/) . Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAImodel = ChatOpenAI(model="gpt-4o-mini") Let's first use the model directly. [ChatModels](/docs/concepts/chat_models/) are instances of LangChain [Runnables](/docs/concepts/runnables/) , which means they expose a standard interface for interacting with them. To simply call the model, we can pass in a list of [messages](/docs/concepts/messages/) to the `.invoke` method. from langchain_core.messages import HumanMessage, SystemMessagemessages = [ SystemMessage("Translate the following from English into Italian"), HumanMessage("hi!"),]model.invoke(messages) **API Reference:**[HumanMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.human.HumanMessage.html) | [SystemMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.system.SystemMessage.html) AIMessage(content='Ciao!', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 3, 'prompt_tokens': 20, 'total_tokens': 23, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-mini-2024-07-18', 'system_fingerprint': 'fp_0705bf87c0', 'finish_reason': 'stop', 'logprobs': None}, id='run-32654a56-627c-40e1-a141-ad9350bbfd3e-0', usage_metadata={'input_tokens': 20, 'output_tokens': 3, 'total_tokens': 23, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}}) tip If we've enabled LangSmith, we can see that this run is logged to LangSmith, and can see the [LangSmith trace](https://smith.langchain.com/public/88baa0b2-7c1a-4d09-ba30-a47985dde2ea/r) . The LangSmith trace reports [token](/docs/concepts/tokens/) usage information, latency, [standard model parameters](/docs/concepts/chat_models/#standard-parameters) (such as temperature), and other information. Note that ChatModels receive [message](/docs/concepts/messages/) objects as input and generate message objects as output. In addition to text content, message objects convey conversational [roles](/docs/concepts/messages/#role) and hold important data, such as [tool calls](/docs/concepts/tool_calling/) and token usage counts. LangChain also supports chat model inputs via strings or [OpenAI format](/docs/concepts/messages/#openai-format) . The following are equivalent: model.invoke("Hello")model.invoke([{"role": "user", "content": "Hello"}])model.invoke([HumanMessage("Hello")]) ### Streaming[​](#streaming "Direct link to Streaming") Because chat models are [Runnables](/docs/concepts/runnables/) , they expose a standard interface that includes async and streaming modes of invocation. This allows us to stream individual tokens from a chat model: for token in model.stream(messages): print(token.content, end="|") |C|iao|!|| You can find more details on streaming chat model outputs in [this guide](/docs/how_to/chat_streaming/) . Prompt Templates[​](#prompt-templates "Direct link to Prompt Templates") ------------------------------------------------------------------------- Right now we are passing a list of messages directly into the language model. Where does this list of messages come from? Usually, it is constructed from a combination of user input and application logic. This application logic usually takes the raw user input and transforms it into a list of messages ready to pass to the language model. Common transformations include adding a system message or formatting a template with the user input. [Prompt templates](/docs/concepts/prompt_templates/) are a concept in LangChain designed to assist with this transformation. They take in raw user input and return data (a prompt) that is ready to pass into a language model. Let's create a prompt template here. It will take in two user variables: * `language`: The language to translate text into * `text`: The text to translate from langchain_core.prompts import ChatPromptTemplatesystem_template = "Translate the following from English into {language}"prompt_template = ChatPromptTemplate.from_messages( [("system", system_template), ("user", "{text}")]) **API Reference:**[ChatPromptTemplate](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.ChatPromptTemplate.html) Note that `ChatPromptTemplate` supports multiple [message roles](/docs/concepts/messages/#role) in a single template. We format the `language` parameter into the system message, and the user `text` into a user message. The input to this prompt template is a dictionary. We can play around with this prompt template by itself to see what it does by itself prompt = prompt_template.invoke({"language": "Italian", "text": "hi!"})prompt ChatPromptValue(messages=[SystemMessage(content='Translate the following from English into Italian', additional_kwargs={}, response_metadata={}), HumanMessage(content='hi!', additional_kwargs={}, response_metadata={})]) We can see that it returns a `ChatPromptValue` that consists of two messages. If we want to access the messages directly we do: prompt.to_messages() [SystemMessage(content='Translate the following from English into Italian', additional_kwargs={}, response_metadata={}), HumanMessage(content='hi!', additional_kwargs={}, response_metadata={})] Finally, we can invoke the chat model on the formatted prompt: response = model.invoke(prompt)print(response.content) Ciao! tip Message `content` can contain both text and [content blocks](/docs/concepts/messages/#aimessage) with additional structure. See [this guide](/docs/how_to/output_parser_string/) for more information. If we take a look at the [LangSmith trace](https://smith.langchain.com/public/3ccc2d5e-2869-467b-95d6-33a577df99a2/r) , we can see exactly what prompt the chat model receives, along with [token](/docs/concepts/tokens/) usage information, latency, [standard model parameters](/docs/concepts/chat_models/#standard-parameters) (such as temperature), and other information. Conclusion[​](#conclusion "Direct link to Conclusion") ------------------------------------------------------- That's it! In this tutorial you've learned how to create your first simple LLM application. You've learned how to work with language models, how to create a prompt template, and how to get great observability into applications you create with LangSmith. This just scratches the surface of what you will want to learn to become a proficient AI Engineer. Luckily - we've got a lot of other resources! For further reading on the core concepts of LangChain, we've got detailed [Conceptual Guides](/docs/concepts/) . If you have more specific questions on these concepts, check out the following sections of the how-to guides: * [Chat models](/docs/how_to/#chat-models) * [Prompt templates](/docs/how_to/#prompt-templates) And the LangSmith docs: * [LangSmith](https://docs.smith.langchain.com) * * * #### Was this page helpful? * [Setup](#setup) * [Jupyter Notebook](#jupyter-notebook) * [Installation](#installation) * [LangSmith](#langsmith) * [Using Language Models](#using-language-models) * [Streaming](#streaming) * [Prompt Templates](#prompt-templates) * [Conclusion](#conclusion) --- # Build a Question Answering application over a Graph Database | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/graph.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/graph.ipynb) In this guide we'll go over the basic ways to create a Q&A chain over a graph database. These systems will allow us to ask a question about the data in a graph database and get back a natural language answer. First, we will show a simple out-of-the-box option and then implement a more sophisticated version with LangGraph. ⚠️ Security note ⚠️[​](#️-security-note-️ "Direct link to ⚠️ Security note ⚠️") -------------------------------------------------------------------------------- Building Q&A systems of graph databases requires executing model-generated graph queries. There are inherent risks in doing this. Make sure that your database connection permissions are always scoped as narrowly as possible for your chain/agent's needs. This will mitigate though not eliminate the risks of building a model-driven system. For more on general security best practices, [see here](/docs/security/) . Architecture[​](#architecture "Direct link to Architecture") ------------------------------------------------------------- At a high-level, the steps of most graph chains are: 1. **Convert question to a graph database query**: Model converts user input to a graph database query (e.g. Cypher). 2. **Execute graph database query**: Execute the graph database query. 3. **Answer the question**: Model responds to user input using the query results. ![sql_usecase.png](/assets/images/graph_usecase-34d891523e6284bb6230b38c5f8392e5.png) Setup[​](#setup "Direct link to Setup") ---------------------------------------- First, get required packages and set environment variables. In this example, we will be using Neo4j graph database. %pip install --upgrade --quiet langchain langchain-neo4j langchain-openai langgraph We default to OpenAI models in this guide. import getpassimport osif "OPENAI_API_KEY" not in os.environ: os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter your OpenAI API key: ")# Uncomment the below to use LangSmith. Not required.# os.environ["LANGCHAIN_API_KEY"] = getpass.getpass()# os.environ["LANGCHAIN_TRACING_V2"] = "true" Enter your OpenAI API key: Β·Β·Β·Β·Β·Β·Β·Β· Next, we need to define Neo4j credentials. Follow [these installation steps](https://neo4j.com/docs/operations-manual/current/installation/) to set up a Neo4j database. os.environ["NEO4J_URI"] = "bolt://localhost:7687"os.environ["NEO4J_USERNAME"] = "neo4j"os.environ["NEO4J_PASSWORD"] = "password" The below example will create a connection with a Neo4j database and will populate it with example data about movies and their actors. from langchain_neo4j import Neo4jGraphgraph = Neo4jGraph()# Import movie informationmovies_query = """LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/tomasonjo/blog-datasets/main/movies/movies_small.csv'AS rowMERGE (m:Movie {id:row.movieId})SET m.released = date(row.released), m.title = row.title, m.imdbRating = toFloat(row.imdbRating)FOREACH (director in split(row.director, '|') | MERGE (p:Person {name:trim(director)}) MERGE (p)-[:DIRECTED]->(m))FOREACH (actor in split(row.actors, '|') | MERGE (p:Person {name:trim(actor)}) MERGE (p)-[:ACTED_IN]->(m))FOREACH (genre in split(row.genres, '|') | MERGE (g:Genre {name:trim(genre)}) MERGE (m)-[:IN_GENRE]->(g))"""graph.query(movies_query) **API Reference:**[Neo4jGraph](https://python.langchain.com/api_reference/neo4j/graphs/langchain_neo4j.graphs.neo4j_graph.Neo4jGraph.html) [] Graph schema[​](#graph-schema "Direct link to Graph schema") ------------------------------------------------------------- In order for an LLM to be able to generate a Cypher statement, it needs information about the graph schema. When you instantiate a graph object, it retrieves the information about the graph schema. If you later make any changes to the graph, you can run the `refresh_schema` method to refresh the schema information. graph.refresh_schema()print(graph.schema) Node properties:Person {name: STRING}Movie {id: STRING, released: DATE, title: STRING, imdbRating: FLOAT}Genre {name: STRING}Chunk {id: STRING, embedding: LIST, text: STRING, question: STRING, query: STRING}Relationship properties:The relationships:(:Person)-[:DIRECTED]->(:Movie)(:Person)-[:ACTED_IN]->(:Movie)(:Movie)-[:IN_GENRE]->(:Genre) For more involved schema information, you can use `enhanced_schema` option. enhanced_graph = Neo4jGraph(enhanced_schema=True)print(enhanced_graph.schema) Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.FeatureDeprecationWarning} {category: DEPRECATION} {title: This feature is deprecated and will be removed in future versions.} {description: The procedure has a deprecated field. ('config' used by 'apoc.meta.graphSample' is deprecated.)} {position: line: 1, column: 1, offset: 0} for query: "CALL apoc.meta.graphSample() YIELD nodes, relationships RETURN nodes, [rel in relationships | {name:apoc.any.property(rel, 'type'), count: apoc.any.property(rel, 'count')}] AS relationships"``````outputNode properties:- **Person** - `name`: STRING Example: "John Lasseter"- **Movie** - `id`: STRING Example: "1" - `released`: DATE Min: 1964-12-16, Max: 1996-09-15 - `title`: STRING Example: "Toy Story" - `imdbRating`: FLOAT Min: 2.4, Max: 9.3- **Genre** - `name`: STRING Example: "Adventure"- **Chunk** - `id`: STRING Available options: ['d66006059fd78d63f3df90cc1059639a', '0e3dcb4502853979d12357690a95ec17', 'c438c6bcdcf8e4fab227f29f8e7ff204', '97fe701ec38057594464beaa2df0710e', 'b54f9286e684373498c4504b4edd9910', '5b50a72c3a4954b0ff7a0421be4f99b9', 'fb28d41771e717255f0d8f6c799ede32', '58e6f14dd2e6c6702cf333f2335c499c'] - `text`: STRING Available options: ['How many artists are there?', 'Which actors played in the movie Casino?', 'How many movies has Tom Hanks acted in?', "List all the genres of the movie Schindler's List", 'Which actors have worked in movies from both the c', 'Which directors have made movies with at least thr', 'Identify movies where directors also played a role', 'Find the actor with the highest number of movies i'] - `question`: STRING Available options: ['How many artists are there?', 'Which actors played in the movie Casino?', 'How many movies has Tom Hanks acted in?', "List all the genres of the movie Schindler's List", 'Which actors have worked in movies from both the c', 'Which directors have made movies with at least thr', 'Identify movies where directors also played a role', 'Find the actor with the highest number of movies i'] - `query`: STRING Available options: ['MATCH (a:Person)-[:ACTED_IN]->(:Movie) RETURN coun', "MATCH (m:Movie {title: 'Casino'})<-[:ACTED_IN]-(a)", "MATCH (a:Person {name: 'Tom Hanks'})-[:ACTED_IN]->", "MATCH (m:Movie {title: 'Schindler's List'})-[:IN_G", 'MATCH (a:Person)-[:ACTED_IN]->(:Movie)-[:IN_GENRE]', 'MATCH (d:Person)-[:DIRECTED]->(m:Movie)<-[:ACTED_I', 'MATCH (p:Person)-[:DIRECTED]->(m:Movie), (p)-[:ACT', 'MATCH (a:Actor)-[:ACTED_IN]->(m:Movie) RETURN a.na']Relationship properties:The relationships:(:Person)-[:DIRECTED]->(:Movie)(:Person)-[:ACTED_IN]->(:Movie)(:Movie)-[:IN_GENRE]->(:Genre)\ \ The `enhanced_schema` option enriches property information by including details such as minimum and maximum values for floats and dates, as well as example values for string properties. This additional context helps guide the LLM toward generating more accurate and effective queries.\ \ Great! We've got a graph database that we can query. Now let's try hooking it up to an LLM.\ \ GraphQACypherChain[​](#graphqacypherchain "Direct link to GraphQACypherChain")\ \ -------------------------------------------------------------------------------\ \ Let's use a simple out-of-the-box chain that takes a question, turns it into a Cypher query, executes the query, and uses the result to answer the original question.\ \ ![graph_chain.webp](/assets/images/graph_chain-6379941793e0fa985e51e4bda0329403.webp)\ \ LangChain comes with a built-in chain for this workflow that is designed to work with Neo4j: [GraphCypherQAChain](/docs/integrations/graphs/neo4j_cypher/)\ \ from langchain_neo4j import GraphCypherQAChainfrom langchain_openai import ChatOpenAIllm = ChatOpenAI(model="gpt-4o", temperature=0)chain = GraphCypherQAChain.from_llm( graph=enhanced_graph, llm=llm, verbose=True, allow_dangerous_requests=True)response = chain.invoke({"query": "What was the cast of the Casino?"})response\ \ **API Reference:**[GraphCypherQAChain](https://python.langchain.com/api_reference/neo4j/chains/langchain_neo4j.chains.graph_qa.cypher.GraphCypherQAChain.html)\ | [ChatOpenAI](https://python.langchain.com/api_reference/openai/chat_models/langchain_openai.chat_models.base.ChatOpenAI.html)\ \ > Entering new GraphCypherQAChain chain...Generated Cypher:cypherMATCH (p:Person)-[:ACTED_IN]->(m:Movie {title: "Casino"})RETURN p.nameFull Context:[{'p.name': 'Robert De Niro'}, {'p.name': 'Joe Pesci'}, {'p.name': 'Sharon Stone'}, {'p.name': 'James Woods'}]> Finished chain.\ \ {'query': 'What was the cast of the Casino?', 'result': 'Robert De Niro, Joe Pesci, Sharon Stone, and James Woods were the cast of Casino.'}\ \ Advanced implementation with LangGraph[​](#advanced-implementation-with-langgraph "Direct link to Advanced implementation with LangGraph")\ \ -------------------------------------------------------------------------------------------------------------------------------------------\ \ While the GraphCypherQAChain is effective for quick demonstrations, it may face challenges in production environments. Transitioning to LangGraph can enhance the workflow, but implementing natural language to query flows in production remains a complex task. Nevertheless, there are several strategies to significantly improve accuracy and reliability, which we will explore next.\ \ Here is the visualized LangGraph flow we will implement:\ \ ![langgraph_text2cypher](/assets/images/langgraph_text2cypher-1414c073e151b391ef08fed77915e3c0.webp)\ \ We will begin by defining the Input, Output, and Overall state of the LangGraph application.\ \ from operator import addfrom typing import Annotated, Listfrom typing_extensions import TypedDictclass InputState(TypedDict): question: strclass OverallState(TypedDict): question: str next_action: str cypher_statement: str cypher_errors: List[str] database_records: List[dict] steps: Annotated[List[str], add]class OutputState(TypedDict): answer: str steps: List[str] cypher_statement: str\ \ The first step is a simple `guardrails` step, where we validate whether the question pertains to movies or their cast. If it doesn't, we notify the user that we cannot answer any other questions. Otherwise, we move on to the Cypher generation step.\ \ from typing import Literalfrom langchain_core.prompts import ChatPromptTemplatefrom pydantic import BaseModel, Fieldguardrails_system = """As an intelligent assistant, your primary objective is to decide whether a given question is related to movies or not. If the question is related to movies, output "movie". Otherwise, output "end".To make this decision, assess the content of the question and determine if it refers to any movie, actor, director, film industry, or related topics. Provide only the specified output: "movie" or "end"."""guardrails_prompt = ChatPromptTemplate.from_messages( [ ( "system", guardrails_system, ), ( "human", ("{question}"), ), ])class GuardrailsOutput(BaseModel): decision: Literal["movie", "end"] = Field( description="Decision on whether the question is related to movies" )guardrails_chain = guardrails_prompt | llm.with_structured_output(GuardrailsOutput)def guardrails(state: InputState) -> OverallState: """ Decides if the question is related to movies or not. """ guardrails_output = guardrails_chain.invoke({"question": state.get("question")}) database_records = None if guardrails_output.decision == "end": database_records = "This questions is not about movies or their cast. Therefore I cannot answer this question." return { "next_action": guardrails_output.decision, "database_records": database_records, "steps": ["guardrail"], }\ \ **API Reference:**[ChatPromptTemplate](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.ChatPromptTemplate.html)\ \ ### Few-shot prompting[​](#few-shot-prompting "Direct link to Few-shot prompting")\ \ Converting natural language into accurate queries is challenging. One way to enhance this process is by providing relevant few-shot examples to guide the LLM in query generation. To achieve this, we will use the `SemanticSimilarityExampleSelector` to dynamically select the most relevant examples.\ \ from langchain_core.example_selectors import SemanticSimilarityExampleSelectorfrom langchain_neo4j import Neo4jVectorfrom langchain_openai import OpenAIEmbeddingsexamples = [ { "question": "How many artists are there?", "query": "MATCH (a:Person)-[:ACTED_IN]->(:Movie) RETURN count(DISTINCT a)", }, { "question": "Which actors played in the movie Casino?", "query": "MATCH (m:Movie {title: 'Casino'})<-[:ACTED_IN]-(a) RETURN a.name", }, { "question": "How many movies has Tom Hanks acted in?", "query": "MATCH (a:Person {name: 'Tom Hanks'})-[:ACTED_IN]->(m:Movie) RETURN count(m)", }, { "question": "List all the genres of the movie Schindler's List", "query": "MATCH (m:Movie {title: 'Schindler's List'})-[:IN_GENRE]->(g:Genre) RETURN g.name", }, { "question": "Which actors have worked in movies from both the comedy and action genres?", "query": "MATCH (a:Person)-[:ACTED_IN]->(:Movie)-[:IN_GENRE]->(g1:Genre), (a)-[:ACTED_IN]->(:Movie)-[:IN_GENRE]->(g2:Genre) WHERE g1.name = 'Comedy' AND g2.name = 'Action' RETURN DISTINCT a.name", }, { "question": "Which directors have made movies with at least three different actors named 'John'?", "query": "MATCH (d:Person)-[:DIRECTED]->(m:Movie)<-[:ACTED_IN]-(a:Person) WHERE a.name STARTS WITH 'John' WITH d, COUNT(DISTINCT a) AS JohnsCount WHERE JohnsCount >= 3 RETURN d.name", }, { "question": "Identify movies where directors also played a role in the film.", "query": "MATCH (p:Person)-[:DIRECTED]->(m:Movie), (p)-[:ACTED_IN]->(m) RETURN m.title, p.name", }, { "question": "Find the actor with the highest number of movies in the database.", "query": "MATCH (a:Actor)-[:ACTED_IN]->(m:Movie) RETURN a.name, COUNT(m) AS movieCount ORDER BY movieCount DESC LIMIT 1", },]example_selector = SemanticSimilarityExampleSelector.from_examples( examples, OpenAIEmbeddings(), Neo4jVector, k=5, input_keys=["question"])\ \ **API Reference:**[SemanticSimilarityExampleSelector](https://python.langchain.com/api_reference/core/example_selectors/langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector.html)\ | [Neo4jVector](https://python.langchain.com/api_reference/neo4j/vectorstores/langchain_neo4j.vectorstores.neo4j_vector.Neo4jVector.html)\ | [OpenAIEmbeddings](https://python.langchain.com/api_reference/openai/embeddings/langchain_openai.embeddings.base.OpenAIEmbeddings.html)\ \ Next, we implement the Cypher generation chain, also known as **text2cypher**. The prompt includes an enhanced graph schema, dynamically selected few-shot examples, and the user’s question. This combination enables the generation of a Cypher query to retrieve relevant information from the database.\ \ from langchain_core.output_parsers import StrOutputParsertext2cypher_prompt = ChatPromptTemplate.from_messages( [ ( "system", ( "Given an input question, convert it to a Cypher query. No pre-amble." "Do not wrap the response in any backticks or anything else. Respond with a Cypher statement only!" ), ), ( "human", ( """You are a Neo4j expert. Given an input question, create a syntactically correct Cypher query to run.Do not wrap the response in any backticks or anything else. Respond with a Cypher statement only!Here is the schema information{schema}Below are a number of examples of questions and their corresponding Cypher queries.{fewshot_examples}User input: {question}Cypher query:""" ), ), ])text2cypher_chain = text2cypher_prompt | llm | StrOutputParser()def generate_cypher(state: OverallState) -> OverallState: """ Generates a cypher statement based on the provided schema and user input """ NL = "\n" fewshot_examples = (NL * 2).join( [ f"Question: {el['question']}{NL}Cypher:{el['query']}" for el in example_selector.select_examples( {"question": state.get("question")} ) ] ) generated_cypher = text2cypher_chain.invoke( { "question": state.get("question"), "fewshot_examples": fewshot_examples, "schema": enhanced_graph.schema, } ) return {"cypher_statement": generated_cypher, "steps": ["generate_cypher"]}\ \ **API Reference:**[StrOutputParser](https://python.langchain.com/api_reference/core/output_parsers/langchain_core.output_parsers.string.StrOutputParser.html)\ \ ### Query validation[​](#query-validation "Direct link to Query validation")\ \ The next step is to validate the generated Cypher statement and ensuring that all property values are accurate. While numbers and dates typically don’t require validation, strings such as movie titles or people’s names do. In this example, we’ll use a basic `CONTAINS` clause for validation, though more advanced mapping and validation techniques can be implemented if needed.\ \ First, we will create a chain that detects any errors in the Cypher statement and extracts the property values it references.\ \ from typing import List, Optionalvalidate_cypher_system = """You are a Cypher expert reviewing a statement written by a junior developer."""validate_cypher_user = """You must check the following:* Are there any syntax errors in the Cypher statement?* Are there any missing or undefined variables in the Cypher statement?* Are any node labels missing from the schema?* Are any relationship types missing from the schema?* Are any of the properties not included in the schema?* Does the Cypher statement include enough information to answer the question?Examples of good errors:* Label (:Foo) does not exist, did you mean (:Bar)?* Property bar does not exist for label Foo, did you mean baz?* Relationship FOO does not exist, did you mean FOO_BAR?Schema:{schema}The question is:{question}The Cypher statement is:{cypher}Make sure you don't make any mistakes!"""validate_cypher_prompt = ChatPromptTemplate.from_messages( [ ( "system", validate_cypher_system, ), ( "human", (validate_cypher_user), ), ])class Property(BaseModel): """ Represents a filter condition based on a specific node property in a graph in a Cypher statement. """ node_label: str = Field( description="The label of the node to which this property belongs." ) property_key: str = Field(description="The key of the property being filtered.") property_value: str = Field( description="The value that the property is being matched against." )class ValidateCypherOutput(BaseModel): """ Represents the validation result of a Cypher query's output, including any errors and applied filters. """ errors: Optional[List[str]] = Field( description="A list of syntax or semantical errors in the Cypher statement. Always explain the discrepancy between schema and Cypher statement" ) filters: Optional[List[Property]] = Field( description="A list of property-based filters applied in the Cypher statement." )validate_cypher_chain = validate_cypher_prompt | llm.with_structured_output( ValidateCypherOutput)\ \ LLMs often struggle with correctly determining relationship directions in generated Cypher statements. Since we have access to the schema, we can deterministically correct these directions using the **CypherQueryCorrector**.\ \ _Note: The `CypherQueryCorrector` is an experimental feature and doesn't support all the newest Cypher syntax._\ \ from langchain_neo4j.chains.graph_qa.cypher_utils import CypherQueryCorrector, Schema# Cypher query corrector is experimentalcorrector_schema = [ Schema(el["start"], el["type"], el["end"]) for el in enhanced_graph.structured_schema.get("relationships")]cypher_query_corrector = CypherQueryCorrector(corrector_schema)\ \ **API Reference:**[CypherQueryCorrector](https://python.langchain.com/api_reference/neo4j/chains/langchain_neo4j.chains.graph_qa.cypher_utils.CypherQueryCorrector.html)\ | [Schema](https://python.langchain.com/api_reference/neo4j/chains/langchain_neo4j.chains.graph_qa.cypher_utils.Schema.html)\ \ Now we can implement the Cypher validation step. First, we use the `EXPLAIN` method to detect any syntax errors. Next, we leverage the LLM to identify potential issues and extract the properties used for filtering. For string properties, we validate them against the database using a simple `CONTAINS` clause.\ \ Based on the validation results, the process can take the following paths:\ \ * If value mapping fails, we end the conversation and inform the user that we couldn't identify a specific property value (e.g., a person or movie title).\ * If errors are found, we route the query for correction.\ * If no issues are detected, we proceed to the Cypher execution step.\ \ from neo4j.exceptions import CypherSyntaxErrordef validate_cypher(state: OverallState) -> OverallState: """ Validates the Cypher statements and maps any property values to the database. """ errors = [] mapping_errors = [] # Check for syntax errors try: enhanced_graph.query(f"EXPLAIN {state.get('cypher_statement')}") except CypherSyntaxError as e: errors.append(e.message) # Experimental feature for correcting relationship directions corrected_cypher = cypher_query_corrector(state.get("cypher_statement")) if not corrected_cypher: errors.append("The generated Cypher statement doesn't fit the graph schema") if not corrected_cypher == state.get("cypher_statement"): print("Relationship direction was corrected") # Use LLM to find additional potential errors and get the mapping for values llm_output = validate_cypher_chain.invoke( { "question": state.get("question"), "schema": enhanced_graph.schema, "cypher": state.get("cypher_statement"), } ) if llm_output.errors: errors.extend(llm_output.errors) if llm_output.filters: for filter in llm_output.filters: # Do mapping only for string values if ( not [ prop for prop in enhanced_graph.structured_schema["node_props"][ filter.node_label ] if prop["property"] == filter.property_key ][0]["type"] == "STRING" ): continue mapping = enhanced_graph.query( f"MATCH (n:{filter.node_label}) WHERE toLower(n.`{filter.property_key}`) = toLower($value) RETURN 'yes' LIMIT 1", {"value": filter.property_value}, ) if not mapping: print( f"Missing value mapping for {filter.node_label} on property {filter.property_key} with value {filter.property_value}" ) mapping_errors.append( f"Missing value mapping for {filter.node_label} on property {filter.property_key} with value {filter.property_value}" ) if mapping_errors: next_action = "end" elif errors: next_action = "correct_cypher" else: next_action = "execute_cypher" return { "next_action": next_action, "cypher_statement": corrected_cypher, "cypher_errors": errors, "steps": ["validate_cypher"], }\ \ The Cypher correction step takes the existing Cypher statement, any identified errors, and the original question to generate a corrected version of the query.\ \ correct_cypher_prompt = ChatPromptTemplate.from_messages( [ ( "system", ( "You are a Cypher expert reviewing a statement written by a junior developer. " "You need to correct the Cypher statement based on the provided errors. No pre-amble." "Do not wrap the response in any backticks or anything else. Respond with a Cypher statement only!" ), ), ( "human", ( """Check for invalid syntax or semantics and return a corrected Cypher statement.Schema:{schema}Note: Do not include any explanations or apologies in your responses.Do not wrap the response in any backticks or anything else.Respond with a Cypher statement only!Do not respond to any questions that might ask anything else than for you to construct a Cypher statement.The question is:{question}The Cypher statement is:{cypher}The errors are:{errors}Corrected Cypher statement: """ ), ), ])correct_cypher_chain = correct_cypher_prompt | llm | StrOutputParser()def correct_cypher(state: OverallState) -> OverallState: """ Correct the Cypher statement based on the provided errors. """ corrected_cypher = correct_cypher_chain.invoke( { "question": state.get("question"), "errors": state.get("cypher_errors"), "cypher": state.get("cypher_statement"), "schema": enhanced_graph.schema, } ) return { "next_action": "validate_cypher", "cypher_statement": corrected_cypher, "steps": ["correct_cypher"], }\ \ We need to add a step that executes the given Cypher statement. If no results are returned, we should explicitly handle this scenario, as leaving the context empty can sometimes lead to LLM hallucinations.\ \ no_results = "I couldn't find any relevant information in the database"def execute_cypher(state: OverallState) -> OverallState: """ Executes the given Cypher statement. """ records = enhanced_graph.query(state.get("cypher_statement")) return { "database_records": records if records else no_results, "next_action": "end", "steps": ["execute_cypher"], }\ \ The final step is to generate the answer. This involves combining the initial question with the database output to produce a relevant response.\ \ generate_final_prompt = ChatPromptTemplate.from_messages( [ ( "system", "You are a helpful assistant", ), ( "human", ( """Use the following results retrieved from a database to providea succinct, definitive answer to the user's question.Respond as if you are answering the question directly.Results: {results}Question: {question}""" ), ), ])generate_final_chain = generate_final_prompt | llm | StrOutputParser()def generate_final_answer(state: OverallState) -> OutputState: """ Decides if the question is related to movies. """ final_answer = generate_final_chain.invoke( {"question": state.get("question"), "results": state.get("database_records")} ) return {"answer": final_answer, "steps": ["generate_final_answer"]}\ \ Next, we will implement the LangGraph workflow, starting with defining the conditional edge functions.\ \ def guardrails_condition( state: OverallState,) -> Literal["generate_cypher", "generate_final_answer"]: if state.get("next_action") == "end": return "generate_final_answer" elif state.get("next_action") == "movie": return "generate_cypher"def validate_cypher_condition( state: OverallState,) -> Literal["generate_final_answer", "correct_cypher", "execute_cypher"]: if state.get("next_action") == "end": return "generate_final_answer" elif state.get("next_action") == "correct_cypher": return "correct_cypher" elif state.get("next_action") == "execute_cypher": return "execute_cypher"\ \ Let's put it all together now.\ \ from IPython.display import Image, displayfrom langgraph.graph import END, START, StateGraphlanggraph = StateGraph(OverallState, input=InputState, output=OutputState)langgraph.add_node(guardrails)langgraph.add_node(generate_cypher)langgraph.add_node(validate_cypher)langgraph.add_node(correct_cypher)langgraph.add_node(execute_cypher)langgraph.add_node(generate_final_answer)langgraph.add_edge(START, "guardrails")langgraph.add_conditional_edges( "guardrails", guardrails_condition,)langgraph.add_edge("generate_cypher", "validate_cypher")langgraph.add_conditional_edges( "validate_cypher", validate_cypher_condition,)langgraph.add_edge("execute_cypher", "generate_final_answer")langgraph.add_edge("correct_cypher", "validate_cypher")langgraph.add_edge("generate_final_answer", END)langgraph = langgraph.compile()# Viewdisplay(Image(langgraph.get_graph().draw_mermaid_png()))\ \ **API Reference:**[StateGraph](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.state.StateGraph)\ \ ![]()\ \ We can now test the application by asking an irrelevant question.\ \ langgraph.invoke({"question": "What's the weather in Spain?"})\ \ {'answer': "I'm sorry, but I cannot provide current weather information. Please check a reliable weather website or app for the latest updates on the weather in Spain.", 'steps': ['guardrail', 'generate_final_answer']}\ \ Let's now ask something relevant about the movies.\ \ langgraph.invoke({"question": "What was the cast of the Casino?"})\ \ {'answer': 'The cast of "Casino" includes Robert De Niro, Joe Pesci, Sharon Stone, and James Woods.', 'steps': ['guardrail', 'generate_cypher', 'validate_cypher', 'execute_cypher', 'generate_final_answer'], 'cypher_statement': "MATCH (m:Movie {title: 'Casino'})<-[:ACTED_IN]-(a:Person) RETURN a.name"}\ \ ### Next steps[​](#next-steps "Direct link to Next steps")\ \ For other graph techniques like this and more check out:\ \ * [Semantic layer](/docs/how_to/graph_semantic/)\ : Techniques for implementing semantic layers.\ * [Constructing graphs](/docs/how_to/graph_constructing/)\ : Techniques for constructing knowledge graphs.\ \ * * *\ \ #### Was this page helpful?\ \ * [⚠️ Security note ⚠️](#️-security-note-️)\ \ * [Architecture](#architecture)\ \ * [Setup](#setup)\ \ * [Graph schema](#graph-schema)\ \ * [GraphQACypherChain](#graphqacypherchain)\ \ * [Advanced implementation with LangGraph](#advanced-implementation-with-langgraph)\ * [Few-shot prompting](#few-shot-prompting)\ \ * [Query validation](#query-validation)\ \ * [Next steps](#next-steps) --- # langchain-core: 0.3.28 β€” πŸ¦œπŸ”— LangChain documentation [Skip to main content](#main-content) Back to top Ctrl+K [Docs](https://python.langchain.com/) * [GitHub](https://github.com/langchain-ai/langchain "GitHub") * [X / Twitter](https://twitter.com/langchainai "X / Twitter") langchain-core: 0.3.28[#](#module-langchain_core "Link to this heading") ========================================================================= `langchain-core` defines the base abstractions for the LangChain ecosystem. The interfaces for core components like chat models, LLMs, vector stores, retrievers, and more are defined here. The universal invocation protocol (Runnables) along with a syntax for combining components (LangChain Expression Language) are also defined here. No third-party integrations are defined here. The dependencies are kept purposefully very lightweight. [agents](agents.html#langchain-core-agents) [#](#langchain-core-agents "Link to this heading") ----------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`agents.AgentAction`](agents/langchain_core.agents.AgentAction.html#langchain_core.agents.AgentAction "langchain_core.agents.AgentAction") | Represents a request to execute an action by an agent. | | [`agents.AgentActionMessageLog`](agents/langchain_core.agents.AgentActionMessageLog.html#langchain_core.agents.AgentActionMessageLog "langchain_core.agents.AgentActionMessageLog") | Representation of an action to be executed by an agent. | | [`agents.AgentFinish`](agents/langchain_core.agents.AgentFinish.html#langchain_core.agents.AgentFinish "langchain_core.agents.AgentFinish") | Final return value of an ActionAgent. | | [`agents.AgentStep`](agents/langchain_core.agents.AgentStep.html#langchain_core.agents.AgentStep "langchain_core.agents.AgentStep") | Result of running an AgentAction. | [beta](beta.html#langchain-core-beta) [#](#langchain-core-beta "Link to this heading") --------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`beta.runnables.context.Context`](beta/langchain_core.beta.runnables.context.Context.html#langchain_core.beta.runnables.context.Context "langchain_core.beta.runnables.context.Context")
() | Context for a runnable. | | [`beta.runnables.context.ContextGet`](beta/langchain_core.beta.runnables.context.ContextGet.html#langchain_core.beta.runnables.context.ContextGet "langchain_core.beta.runnables.context.ContextGet") | | | [`beta.runnables.context.ContextSet`](beta/langchain_core.beta.runnables.context.ContextSet.html#langchain_core.beta.runnables.context.ContextSet "langchain_core.beta.runnables.context.ContextSet") | | | [`beta.runnables.context.PrefixContext`](beta/langchain_core.beta.runnables.context.PrefixContext.html#langchain_core.beta.runnables.context.PrefixContext "langchain_core.beta.runnables.context.PrefixContext")
(\[prefix\]) | Context for a runnable with a prefix. | **Functions** | | | | --- | --- | | [`beta.runnables.context.aconfig_with_context`](beta/langchain_core.beta.runnables.context.aconfig_with_context.html#langchain_core.beta.runnables.context.aconfig_with_context "langchain_core.beta.runnables.context.aconfig_with_context")
(...) | Asynchronously patch a runnable config with context getters and setters. | | [`beta.runnables.context.config_with_context`](beta/langchain_core.beta.runnables.context.config_with_context.html#langchain_core.beta.runnables.context.config_with_context "langchain_core.beta.runnables.context.config_with_context")
(...) | Patch a runnable config with context getters and setters. | [caches](caches.html#langchain-core-caches) [#](#langchain-core-caches "Link to this heading") ----------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`caches.BaseCache`](caches/langchain_core.caches.BaseCache.html#langchain_core.caches.BaseCache "langchain_core.caches.BaseCache")
() | Interface for a caching layer for LLMs and Chat models. | | [`caches.InMemoryCache`](caches/langchain_core.caches.InMemoryCache.html#langchain_core.caches.InMemoryCache "langchain_core.caches.InMemoryCache")
(\*\[,Β maxsize\]) | Cache that stores things in memory. | [callbacks](callbacks.html#langchain-core-callbacks) [#](#langchain-core-callbacks "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`callbacks.base.AsyncCallbackHandler`](callbacks/langchain_core.callbacks.base.AsyncCallbackHandler.html#langchain_core.callbacks.base.AsyncCallbackHandler "langchain_core.callbacks.base.AsyncCallbackHandler")
() | Async callback handler for LangChain. | | [`callbacks.base.BaseCallbackHandler`](callbacks/langchain_core.callbacks.base.BaseCallbackHandler.html#langchain_core.callbacks.base.BaseCallbackHandler "langchain_core.callbacks.base.BaseCallbackHandler")
() | Base callback handler for LangChain. | | [`callbacks.base.BaseCallbackManager`](callbacks/langchain_core.callbacks.base.BaseCallbackManager.html#langchain_core.callbacks.base.BaseCallbackManager "langchain_core.callbacks.base.BaseCallbackManager")
(handlers) | Base callback manager for LangChain. | | [`callbacks.base.CallbackManagerMixin`](callbacks/langchain_core.callbacks.base.CallbackManagerMixin.html#langchain_core.callbacks.base.CallbackManagerMixin "langchain_core.callbacks.base.CallbackManagerMixin")
() | Mixin for callback manager. | | [`callbacks.base.ChainManagerMixin`](callbacks/langchain_core.callbacks.base.ChainManagerMixin.html#langchain_core.callbacks.base.ChainManagerMixin "langchain_core.callbacks.base.ChainManagerMixin")
() | Mixin for chain callbacks. | | [`callbacks.base.LLMManagerMixin`](callbacks/langchain_core.callbacks.base.LLMManagerMixin.html#langchain_core.callbacks.base.LLMManagerMixin "langchain_core.callbacks.base.LLMManagerMixin")
() | Mixin for LLM callbacks. | | [`callbacks.base.RetrieverManagerMixin`](callbacks/langchain_core.callbacks.base.RetrieverManagerMixin.html#langchain_core.callbacks.base.RetrieverManagerMixin "langchain_core.callbacks.base.RetrieverManagerMixin")
() | Mixin for Retriever callbacks. | | [`callbacks.base.RunManagerMixin`](callbacks/langchain_core.callbacks.base.RunManagerMixin.html#langchain_core.callbacks.base.RunManagerMixin "langchain_core.callbacks.base.RunManagerMixin")
() | Mixin for run manager. | | [`callbacks.base.ToolManagerMixin`](callbacks/langchain_core.callbacks.base.ToolManagerMixin.html#langchain_core.callbacks.base.ToolManagerMixin "langchain_core.callbacks.base.ToolManagerMixin")
() | Mixin for tool callbacks. | | [`callbacks.file.FileCallbackHandler`](callbacks/langchain_core.callbacks.file.FileCallbackHandler.html#langchain_core.callbacks.file.FileCallbackHandler "langchain_core.callbacks.file.FileCallbackHandler")
(filename) | Callback Handler that writes to a file. | | [`callbacks.manager.AsyncCallbackManager`](callbacks/langchain_core.callbacks.manager.AsyncCallbackManager.html#langchain_core.callbacks.manager.AsyncCallbackManager "langchain_core.callbacks.manager.AsyncCallbackManager")
(handlers) | Async callback manager that handles callbacks from LangChain. | | [`callbacks.manager.AsyncCallbackManagerForChainGroup`](callbacks/langchain_core.callbacks.manager.AsyncCallbackManagerForChainGroup.html#langchain_core.callbacks.manager.AsyncCallbackManagerForChainGroup "langchain_core.callbacks.manager.AsyncCallbackManagerForChainGroup")
(...) | Async callback manager for the chain group. | | [`callbacks.manager.AsyncCallbackManagerForChainRun`](callbacks/langchain_core.callbacks.manager.AsyncCallbackManagerForChainRun.html#langchain_core.callbacks.manager.AsyncCallbackManagerForChainRun "langchain_core.callbacks.manager.AsyncCallbackManagerForChainRun")
(\*,Β ...) | Async callback manager for chain run. | | [`callbacks.manager.AsyncCallbackManagerForLLMRun`](callbacks/langchain_core.callbacks.manager.AsyncCallbackManagerForLLMRun.html#langchain_core.callbacks.manager.AsyncCallbackManagerForLLMRun "langchain_core.callbacks.manager.AsyncCallbackManagerForLLMRun")
(\*,Β ...) | Async callback manager for LLM run. | | [`callbacks.manager.AsyncCallbackManagerForRetrieverRun`](callbacks/langchain_core.callbacks.manager.AsyncCallbackManagerForRetrieverRun.html#langchain_core.callbacks.manager.AsyncCallbackManagerForRetrieverRun "langchain_core.callbacks.manager.AsyncCallbackManagerForRetrieverRun")
(\*,Β ...) | Async callback manager for retriever run. | | [`callbacks.manager.AsyncCallbackManagerForToolRun`](callbacks/langchain_core.callbacks.manager.AsyncCallbackManagerForToolRun.html#langchain_core.callbacks.manager.AsyncCallbackManagerForToolRun "langchain_core.callbacks.manager.AsyncCallbackManagerForToolRun")
(\*,Β ...) | Async callback manager for tool run. | | [`callbacks.manager.AsyncParentRunManager`](callbacks/langchain_core.callbacks.manager.AsyncParentRunManager.html#langchain_core.callbacks.manager.AsyncParentRunManager "langchain_core.callbacks.manager.AsyncParentRunManager")
(\*,Β ...) | Async Parent Run Manager. | | [`callbacks.manager.AsyncRunManager`](callbacks/langchain_core.callbacks.manager.AsyncRunManager.html#langchain_core.callbacks.manager.AsyncRunManager "langchain_core.callbacks.manager.AsyncRunManager")
(\*,Β run\_id,Β ...) | Async Run Manager. | | [`callbacks.manager.BaseRunManager`](callbacks/langchain_core.callbacks.manager.BaseRunManager.html#langchain_core.callbacks.manager.BaseRunManager "langchain_core.callbacks.manager.BaseRunManager")
(\*,Β run\_id,Β ...) | Base class for run manager (a bound callback manager). | | [`callbacks.manager.CallbackManager`](callbacks/langchain_core.callbacks.manager.CallbackManager.html#langchain_core.callbacks.manager.CallbackManager "langchain_core.callbacks.manager.CallbackManager")
(handlers) | Callback manager for LangChain. | | [`callbacks.manager.CallbackManagerForChainGroup`](callbacks/langchain_core.callbacks.manager.CallbackManagerForChainGroup.html#langchain_core.callbacks.manager.CallbackManagerForChainGroup "langchain_core.callbacks.manager.CallbackManagerForChainGroup")
(...) | Callback manager for the chain group. | | [`callbacks.manager.CallbackManagerForChainRun`](callbacks/langchain_core.callbacks.manager.CallbackManagerForChainRun.html#langchain_core.callbacks.manager.CallbackManagerForChainRun "langchain_core.callbacks.manager.CallbackManagerForChainRun")
(\*,Β ...) | Callback manager for chain run. | | [`callbacks.manager.CallbackManagerForLLMRun`](callbacks/langchain_core.callbacks.manager.CallbackManagerForLLMRun.html#langchain_core.callbacks.manager.CallbackManagerForLLMRun "langchain_core.callbacks.manager.CallbackManagerForLLMRun")
(\*,Β ...) | Callback manager for LLM run. | | [`callbacks.manager.CallbackManagerForRetrieverRun`](callbacks/langchain_core.callbacks.manager.CallbackManagerForRetrieverRun.html#langchain_core.callbacks.manager.CallbackManagerForRetrieverRun "langchain_core.callbacks.manager.CallbackManagerForRetrieverRun")
(\*,Β ...) | Callback manager for retriever run. | | [`callbacks.manager.CallbackManagerForToolRun`](callbacks/langchain_core.callbacks.manager.CallbackManagerForToolRun.html#langchain_core.callbacks.manager.CallbackManagerForToolRun "langchain_core.callbacks.manager.CallbackManagerForToolRun")
(\*,Β ...) | Callback manager for tool run. | | [`callbacks.manager.ParentRunManager`](callbacks/langchain_core.callbacks.manager.ParentRunManager.html#langchain_core.callbacks.manager.ParentRunManager "langchain_core.callbacks.manager.ParentRunManager")
(\*,Β ...\[,Β ...\]) | Sync Parent Run Manager. | | [`callbacks.manager.RunManager`](callbacks/langchain_core.callbacks.manager.RunManager.html#langchain_core.callbacks.manager.RunManager "langchain_core.callbacks.manager.RunManager")
(\*,Β run\_id,Β ...) | Sync Run Manager. | | [`callbacks.stdout.StdOutCallbackHandler`](callbacks/langchain_core.callbacks.stdout.StdOutCallbackHandler.html#langchain_core.callbacks.stdout.StdOutCallbackHandler "langchain_core.callbacks.stdout.StdOutCallbackHandler")
(\[color\]) | Callback Handler that prints to std out. | | [`callbacks.streaming_stdout.StreamingStdOutCallbackHandler`](callbacks/langchain_core.callbacks.streaming_stdout.StreamingStdOutCallbackHandler.html#langchain_core.callbacks.streaming_stdout.StreamingStdOutCallbackHandler "langchain_core.callbacks.streaming_stdout.StreamingStdOutCallbackHandler")
() | Callback handler for streaming. | **Functions** | | | | --- | --- | | [`callbacks.manager.adispatch_custom_event`](callbacks/langchain_core.callbacks.manager.adispatch_custom_event.html#langchain_core.callbacks.manager.adispatch_custom_event "langchain_core.callbacks.manager.adispatch_custom_event")
(...) | Dispatch an adhoc event to the handlers. | | [`callbacks.manager.ahandle_event`](callbacks/langchain_core.callbacks.manager.ahandle_event.html#langchain_core.callbacks.manager.ahandle_event "langchain_core.callbacks.manager.ahandle_event")
(handlers,Β ...) | Async generic event handler for AsyncCallbackManager. | | [`callbacks.manager.atrace_as_chain_group`](callbacks/langchain_core.callbacks.manager.atrace_as_chain_group.html#langchain_core.callbacks.manager.atrace_as_chain_group "langchain_core.callbacks.manager.atrace_as_chain_group")
(...) | Get an async callback manager for a chain group in a context manager. | | [`callbacks.manager.dispatch_custom_event`](callbacks/langchain_core.callbacks.manager.dispatch_custom_event.html#langchain_core.callbacks.manager.dispatch_custom_event "langchain_core.callbacks.manager.dispatch_custom_event")
(...) | Dispatch an adhoc event. | | [`callbacks.manager.handle_event`](callbacks/langchain_core.callbacks.manager.handle_event.html#langchain_core.callbacks.manager.handle_event "langchain_core.callbacks.manager.handle_event")
(handlers,Β ...) | Generic event handler for CallbackManager. | | [`callbacks.manager.shielded`](callbacks/langchain_core.callbacks.manager.shielded.html#langchain_core.callbacks.manager.shielded "langchain_core.callbacks.manager.shielded")
(func) | Makes so an awaitable method is always shielded from cancellation. | | [`callbacks.manager.trace_as_chain_group`](callbacks/langchain_core.callbacks.manager.trace_as_chain_group.html#langchain_core.callbacks.manager.trace_as_chain_group "langchain_core.callbacks.manager.trace_as_chain_group")
(...) | Get a callback manager for a chain group in a context manager. | [chat\_history](chat_history.html#langchain-core-chat-history) [#](#langchain-core-chat-history "Link to this heading") ------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`chat_history.BaseChatMessageHistory`](chat_history/langchain_core.chat_history.BaseChatMessageHistory.html#langchain_core.chat_history.BaseChatMessageHistory "langchain_core.chat_history.BaseChatMessageHistory")
() | Abstract base class for storing chat message history. | | [`chat_history.InMemoryChatMessageHistory`](chat_history/langchain_core.chat_history.InMemoryChatMessageHistory.html#langchain_core.chat_history.InMemoryChatMessageHistory "langchain_core.chat_history.InMemoryChatMessageHistory") | In memory implementation of chat message history. | [chat\_loaders](chat_loaders.html#langchain-core-chat-loaders) [#](#langchain-core-chat-loaders "Link to this heading") ------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`chat_loaders.BaseChatLoader`](chat_loaders/langchain_core.chat_loaders.BaseChatLoader.html#langchain_core.chat_loaders.BaseChatLoader "langchain_core.chat_loaders.BaseChatLoader")
() | Base class for chat loaders. | [chat\_sessions](chat_sessions.html#langchain-core-chat-sessions) [#](#langchain-core-chat-sessions "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`chat_sessions.ChatSession`](chat_sessions/langchain_core.chat_sessions.ChatSession.html#langchain_core.chat_sessions.ChatSession "langchain_core.chat_sessions.ChatSession") | Chat Session represents a single conversation, channel, or other group of messages. | [document\_loaders](document_loaders.html#langchain-core-document-loaders) [#](#langchain-core-document-loaders "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`document_loaders.base.BaseBlobParser`](document_loaders/langchain_core.document_loaders.base.BaseBlobParser.html#langchain_core.document_loaders.base.BaseBlobParser "langchain_core.document_loaders.base.BaseBlobParser")
() | Abstract interface for blob parsers. | | [`document_loaders.base.BaseLoader`](document_loaders/langchain_core.document_loaders.base.BaseLoader.html#langchain_core.document_loaders.base.BaseLoader "langchain_core.document_loaders.base.BaseLoader")
() | Interface for Document Loader. | | [`document_loaders.blob_loaders.BlobLoader`](document_loaders/langchain_core.document_loaders.blob_loaders.BlobLoader.html#langchain_core.document_loaders.blob_loaders.BlobLoader "langchain_core.document_loaders.blob_loaders.BlobLoader")
() | Abstract interface for blob loaders implementation. | | [`document_loaders.langsmith.LangSmithLoader`](document_loaders/langchain_core.document_loaders.langsmith.LangSmithLoader.html#langchain_core.document_loaders.langsmith.LangSmithLoader "langchain_core.document_loaders.langsmith.LangSmithLoader")
(\*) | Load LangSmith Dataset examples as Documents. | [documents](documents.html#langchain-core-documents) [#](#langchain-core-documents "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`documents.base.BaseMedia`](documents/langchain_core.documents.base.BaseMedia.html#langchain_core.documents.base.BaseMedia "langchain_core.documents.base.BaseMedia") | Use to represent media content. | | [`documents.base.Blob`](documents/langchain_core.documents.base.Blob.html#langchain_core.documents.base.Blob "langchain_core.documents.base.Blob") | Blob represents raw data by either reference or value. | | [`documents.base.Document`](documents/langchain_core.documents.base.Document.html#langchain_core.documents.base.Document "langchain_core.documents.base.Document") | Class for storing a piece of text and associated metadata. | | [`documents.compressor.BaseDocumentCompressor`](documents/langchain_core.documents.compressor.BaseDocumentCompressor.html#langchain_core.documents.compressor.BaseDocumentCompressor "langchain_core.documents.compressor.BaseDocumentCompressor") | Base class for document compressors. | | [`documents.transformers.BaseDocumentTransformer`](documents/langchain_core.documents.transformers.BaseDocumentTransformer.html#langchain_core.documents.transformers.BaseDocumentTransformer "langchain_core.documents.transformers.BaseDocumentTransformer")
() | Abstract base class for document transformation. | [embeddings](embeddings.html#langchain-core-embeddings) [#](#langchain-core-embeddings "Link to this heading") --------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`embeddings.embeddings.Embeddings`](embeddings/langchain_core.embeddings.embeddings.Embeddings.html#langchain_core.embeddings.embeddings.Embeddings "langchain_core.embeddings.embeddings.Embeddings")
() | Interface for embedding models. | | [`embeddings.fake.DeterministicFakeEmbedding`](embeddings/langchain_core.embeddings.fake.DeterministicFakeEmbedding.html#langchain_core.embeddings.fake.DeterministicFakeEmbedding "langchain_core.embeddings.fake.DeterministicFakeEmbedding") | Deterministic fake embedding model for unit testing purposes. | | [`embeddings.fake.FakeEmbeddings`](embeddings/langchain_core.embeddings.fake.FakeEmbeddings.html#langchain_core.embeddings.fake.FakeEmbeddings "langchain_core.embeddings.fake.FakeEmbeddings") | Fake embedding model for unit testing purposes. | [example\_selectors](example_selectors.html#langchain-core-example-selectors) [#](#langchain-core-example-selectors "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`example_selectors.base.BaseExampleSelector`](example_selectors/langchain_core.example_selectors.base.BaseExampleSelector.html#langchain_core.example_selectors.base.BaseExampleSelector "langchain_core.example_selectors.base.BaseExampleSelector")
() | Interface for selecting examples to include in prompts. | | [`example_selectors.length_based.LengthBasedExampleSelector`](example_selectors/langchain_core.example_selectors.length_based.LengthBasedExampleSelector.html#langchain_core.example_selectors.length_based.LengthBasedExampleSelector "langchain_core.example_selectors.length_based.LengthBasedExampleSelector") | Select examples based on length. | | [`example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector`](example_selectors/langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector.html#langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector "langchain_core.example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector") | Select examples based on Max Marginal Relevance. | | [`example_selectors.semantic_similarity.SemanticSimilarityExampleSelector`](example_selectors/langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector.html#langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector "langchain_core.example_selectors.semantic_similarity.SemanticSimilarityExampleSelector") | Select examples based on semantic similarity. | **Functions** | | | | --- | --- | | [`example_selectors.semantic_similarity.sorted_values`](example_selectors/langchain_core.example_selectors.semantic_similarity.sorted_values.html#langchain_core.example_selectors.semantic_similarity.sorted_values "langchain_core.example_selectors.semantic_similarity.sorted_values")
(values) | Return a list of values in dict sorted by key. | [exceptions](exceptions.html#langchain-core-exceptions) [#](#langchain-core-exceptions "Link to this heading") --------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`exceptions.ErrorCode`](exceptions/langchain_core.exceptions.ErrorCode.html#langchain_core.exceptions.ErrorCode "langchain_core.exceptions.ErrorCode")
(value\[,Β names,Β module,Β ...\]) | | | [`exceptions.LangChainException`](exceptions/langchain_core.exceptions.LangChainException.html#langchain_core.exceptions.LangChainException "langchain_core.exceptions.LangChainException") | General LangChain exception. | | [`exceptions.OutputParserException`](exceptions/langchain_core.exceptions.OutputParserException.html#langchain_core.exceptions.OutputParserException "langchain_core.exceptions.OutputParserException")
(error\[,Β ...\]) | Exception that output parsers should raise to signify a parsing error. | | [`exceptions.TracerException`](exceptions/langchain_core.exceptions.TracerException.html#langchain_core.exceptions.TracerException "langchain_core.exceptions.TracerException") | Base class for exceptions in tracers module. | **Functions** | | | | --- | --- | | [`exceptions.create_message`](exceptions/langchain_core.exceptions.create_message.html#langchain_core.exceptions.create_message "langchain_core.exceptions.create_message")
(\*,Β message,Β error\_code) | | [globals](globals.html#langchain-core-globals) [#](#langchain-core-globals "Link to this heading") --------------------------------------------------------------------------------------------------- **Functions** | | | | --- | --- | | [`globals.get_debug`](globals/langchain_core.globals.get_debug.html#langchain_core.globals.get_debug "langchain_core.globals.get_debug")
() | Get the value of the debug global setting. | | [`globals.get_llm_cache`](globals/langchain_core.globals.get_llm_cache.html#langchain_core.globals.get_llm_cache "langchain_core.globals.get_llm_cache")
() | Get the value of the llm\_cache global setting. | | [`globals.get_verbose`](globals/langchain_core.globals.get_verbose.html#langchain_core.globals.get_verbose "langchain_core.globals.get_verbose")
() | Get the value of the verbose global setting. | | [`globals.set_debug`](globals/langchain_core.globals.set_debug.html#langchain_core.globals.set_debug "langchain_core.globals.set_debug")
(value) | Set a new value for the debug global setting. | | [`globals.set_llm_cache`](globals/langchain_core.globals.set_llm_cache.html#langchain_core.globals.set_llm_cache "langchain_core.globals.set_llm_cache")
(value) | Set a new LLM cache, overwriting the previous value, if any. | | [`globals.set_verbose`](globals/langchain_core.globals.set_verbose.html#langchain_core.globals.set_verbose "langchain_core.globals.set_verbose")
(value) | Set a new value for the verbose global setting. | [indexing](indexing.html#langchain-core-indexing) [#](#langchain-core-indexing "Link to this heading") ------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`indexing.api.IndexingException`](indexing/langchain_core.indexing.api.IndexingException.html#langchain_core.indexing.api.IndexingException "langchain_core.indexing.api.IndexingException") | Raised when an indexing operation fails. | | [`indexing.api.IndexingResult`](indexing/langchain_core.indexing.api.IndexingResult.html#langchain_core.indexing.api.IndexingResult "langchain_core.indexing.api.IndexingResult") | Return a detailed a breakdown of the result of the indexing operation. | | [`indexing.base.DeleteResponse`](indexing/langchain_core.indexing.base.DeleteResponse.html#langchain_core.indexing.base.DeleteResponse "langchain_core.indexing.base.DeleteResponse") | A generic response for delete operation. | | [`indexing.base.DocumentIndex`](indexing/langchain_core.indexing.base.DocumentIndex.html#langchain_core.indexing.base.DocumentIndex "langchain_core.indexing.base.DocumentIndex") | | | [`indexing.base.InMemoryRecordManager`](indexing/langchain_core.indexing.base.InMemoryRecordManager.html#langchain_core.indexing.base.InMemoryRecordManager "langchain_core.indexing.base.InMemoryRecordManager")
(namespace) | An in-memory record manager for testing purposes. | | [`indexing.base.RecordManager`](indexing/langchain_core.indexing.base.RecordManager.html#langchain_core.indexing.base.RecordManager "langchain_core.indexing.base.RecordManager")
(namespace) | Abstract base class representing the interface for a record manager. | | [`indexing.base.UpsertResponse`](indexing/langchain_core.indexing.base.UpsertResponse.html#langchain_core.indexing.base.UpsertResponse "langchain_core.indexing.base.UpsertResponse") | A generic response for upsert operations. | | [`indexing.in_memory.InMemoryDocumentIndex`](indexing/langchain_core.indexing.in_memory.InMemoryDocumentIndex.html#langchain_core.indexing.in_memory.InMemoryDocumentIndex "langchain_core.indexing.in_memory.InMemoryDocumentIndex") | | **Functions** | | | | --- | --- | | [`indexing.api.aindex`](indexing/langchain_core.indexing.api.aindex.html#langchain_core.indexing.api.aindex "langchain_core.indexing.api.aindex")
(docs\_source,Β ...\[,Β ...\]) | Async index data from the loader into the vector store. | | [`indexing.api.index`](indexing/langchain_core.indexing.api.index.html#langchain_core.indexing.api.index "langchain_core.indexing.api.index")
(docs\_source,Β ...\[,Β ...\]) | Index data from the loader into the vector store. | [language\_models](language_models.html#langchain-core-language-models) [#](#langchain-core-language-models "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`language_models.base.BaseLanguageModel`](language_models/langchain_core.language_models.base.BaseLanguageModel.html#langchain_core.language_models.base.BaseLanguageModel "langchain_core.language_models.base.BaseLanguageModel") | Abstract base class for interfacing with language models. | | `language_models.base.BaseLanguageModel[BaseMessage]` | Abstract base class for interfacing with language models. | | `language_models.base.BaseLanguageModel[str]` | Abstract base class for interfacing with language models. | | [`language_models.base.LangSmithParams`](language_models/langchain_core.language_models.base.LangSmithParams.html#langchain_core.language_models.base.LangSmithParams "langchain_core.language_models.base.LangSmithParams") | LangSmith parameters for tracing. | | [`language_models.chat_models.BaseChatModel`](language_models/langchain_core.language_models.chat_models.BaseChatModel.html#langchain_core.language_models.chat_models.BaseChatModel "langchain_core.language_models.chat_models.BaseChatModel") | Base class for chat models. | | [`language_models.chat_models.SimpleChatModel`](language_models/langchain_core.language_models.chat_models.SimpleChatModel.html#langchain_core.language_models.chat_models.SimpleChatModel "langchain_core.language_models.chat_models.SimpleChatModel") | Simplified implementation for a chat model to inherit from. | | [`language_models.fake.FakeListLLM`](language_models/langchain_core.language_models.fake.FakeListLLM.html#langchain_core.language_models.fake.FakeListLLM "langchain_core.language_models.fake.FakeListLLM") | Fake LLM for testing purposes. | | [`language_models.fake.FakeListLLMError`](language_models/langchain_core.language_models.fake.FakeListLLMError.html#langchain_core.language_models.fake.FakeListLLMError "langchain_core.language_models.fake.FakeListLLMError") | Fake error for testing purposes. | | [`language_models.fake.FakeStreamingListLLM`](language_models/langchain_core.language_models.fake.FakeStreamingListLLM.html#langchain_core.language_models.fake.FakeStreamingListLLM "langchain_core.language_models.fake.FakeStreamingListLLM") | Fake streaming list LLM for testing purposes. | | [`language_models.fake_chat_models.FakeChatModel`](language_models/langchain_core.language_models.fake_chat_models.FakeChatModel.html#langchain_core.language_models.fake_chat_models.FakeChatModel "langchain_core.language_models.fake_chat_models.FakeChatModel") | Fake Chat Model wrapper for testing purposes. | | [`language_models.fake_chat_models.FakeListChatModel`](language_models/langchain_core.language_models.fake_chat_models.FakeListChatModel.html#langchain_core.language_models.fake_chat_models.FakeListChatModel "langchain_core.language_models.fake_chat_models.FakeListChatModel") | Fake ChatModel for testing purposes. | | [`language_models.fake_chat_models.FakeListChatModelError`](language_models/langchain_core.language_models.fake_chat_models.FakeListChatModelError.html#langchain_core.language_models.fake_chat_models.FakeListChatModelError "langchain_core.language_models.fake_chat_models.FakeListChatModelError") | | | [`language_models.fake_chat_models.FakeMessagesListChatModel`](language_models/langchain_core.language_models.fake_chat_models.FakeMessagesListChatModel.html#langchain_core.language_models.fake_chat_models.FakeMessagesListChatModel "langchain_core.language_models.fake_chat_models.FakeMessagesListChatModel") | Fake ChatModel for testing purposes. | | [`language_models.fake_chat_models.GenericFakeChatModel`](language_models/langchain_core.language_models.fake_chat_models.GenericFakeChatModel.html#langchain_core.language_models.fake_chat_models.GenericFakeChatModel "langchain_core.language_models.fake_chat_models.GenericFakeChatModel") | Generic fake chat model that can be used to test the chat model interface. | | [`language_models.fake_chat_models.ParrotFakeChatModel`](language_models/langchain_core.language_models.fake_chat_models.ParrotFakeChatModel.html#langchain_core.language_models.fake_chat_models.ParrotFakeChatModel "langchain_core.language_models.fake_chat_models.ParrotFakeChatModel") | Generic fake chat model that can be used to test the chat model interface. | | [`language_models.llms.BaseLLM`](language_models/langchain_core.language_models.llms.BaseLLM.html#langchain_core.language_models.llms.BaseLLM "langchain_core.language_models.llms.BaseLLM") | Base LLM abstract interface. | | [`language_models.llms.LLM`](language_models/langchain_core.language_models.llms.LLM.html#langchain_core.language_models.llms.LLM "langchain_core.language_models.llms.LLM") | Simple interface for implementing a custom LLM. | **Functions** | | | | --- | --- | | [`language_models.chat_models.agenerate_from_stream`](language_models/langchain_core.language_models.chat_models.agenerate_from_stream.html#langchain_core.language_models.chat_models.agenerate_from_stream "langchain_core.language_models.chat_models.agenerate_from_stream")
(stream) | Async generate from a stream. | | [`language_models.chat_models.generate_from_stream`](language_models/langchain_core.language_models.chat_models.generate_from_stream.html#langchain_core.language_models.chat_models.generate_from_stream "langchain_core.language_models.chat_models.generate_from_stream")
(stream) | Generate from a stream. | | [`language_models.llms.aget_prompts`](language_models/langchain_core.language_models.llms.aget_prompts.html#langchain_core.language_models.llms.aget_prompts "langchain_core.language_models.llms.aget_prompts")
(params,Β ...) | Get prompts that are already cached. | | [`language_models.llms.aupdate_cache`](language_models/langchain_core.language_models.llms.aupdate_cache.html#langchain_core.language_models.llms.aupdate_cache "langchain_core.language_models.llms.aupdate_cache")
(cache,Β ...) | Update the cache and get the LLM output. | | [`language_models.llms.create_base_retry_decorator`](language_models/langchain_core.language_models.llms.create_base_retry_decorator.html#langchain_core.language_models.llms.create_base_retry_decorator "langchain_core.language_models.llms.create_base_retry_decorator")
(...) | Create a retry decorator for a given LLM and provided | | [`language_models.llms.get_prompts`](language_models/langchain_core.language_models.llms.get_prompts.html#langchain_core.language_models.llms.get_prompts "langchain_core.language_models.llms.get_prompts")
(params,Β prompts) | Get prompts that are already cached. | | [`language_models.llms.update_cache`](language_models/langchain_core.language_models.llms.update_cache.html#langchain_core.language_models.llms.update_cache "langchain_core.language_models.llms.update_cache")
(cache,Β ...) | Update the cache and get the LLM output. | [load](load.html#langchain-core-load) [#](#langchain-core-load "Link to this heading") --------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`load.load.Reviver`](load/langchain_core.load.load.Reviver.html#langchain_core.load.load.Reviver "langchain_core.load.load.Reviver")
(\[secrets\_map,Β ...\]) | Reviver for JSON objects. | | [`load.serializable.BaseSerialized`](load/langchain_core.load.serializable.BaseSerialized.html#langchain_core.load.serializable.BaseSerialized "langchain_core.load.serializable.BaseSerialized") | Base class for serialized objects. | | [`load.serializable.Serializable`](load/langchain_core.load.serializable.Serializable.html#langchain_core.load.serializable.Serializable "langchain_core.load.serializable.Serializable") | Serializable base class. | | [`load.serializable.SerializedConstructor`](load/langchain_core.load.serializable.SerializedConstructor.html#langchain_core.load.serializable.SerializedConstructor "langchain_core.load.serializable.SerializedConstructor") | Serialized constructor. | | [`load.serializable.SerializedNotImplemented`](load/langchain_core.load.serializable.SerializedNotImplemented.html#langchain_core.load.serializable.SerializedNotImplemented "langchain_core.load.serializable.SerializedNotImplemented") | Serialized not implemented. | | [`load.serializable.SerializedSecret`](load/langchain_core.load.serializable.SerializedSecret.html#langchain_core.load.serializable.SerializedSecret "langchain_core.load.serializable.SerializedSecret") | Serialized secret. | **Functions** | | | | --- | --- | | [`load.dump.default`](load/langchain_core.load.dump.default.html#langchain_core.load.dump.default "langchain_core.load.dump.default")
(obj) | Return a default value for a Serializable object or a SerializedNotImplemented object. | | [`load.dump.dumpd`](load/langchain_core.load.dump.dumpd.html#langchain_core.load.dump.dumpd "langchain_core.load.dump.dumpd")
(obj) | Return a dict representation of an object. | | [`load.dump.dumps`](load/langchain_core.load.dump.dumps.html#langchain_core.load.dump.dumps "langchain_core.load.dump.dumps")
(obj,Β \*\[,Β pretty\]) | Return a json string representation of an object. | | [`load.load.load`](load/langchain_core.load.load.load.html#langchain_core.load.load.load "langchain_core.load.load.load")
(obj,Β \*\[,Β secrets\_map,Β ...\]) | | | [`load.load.loads`](load/langchain_core.load.load.loads.html#langchain_core.load.load.loads "langchain_core.load.load.loads")
(text,Β \*\[,Β secrets\_map,Β ...\]) | | | [`load.serializable.to_json_not_implemented`](load/langchain_core.load.serializable.to_json_not_implemented.html#langchain_core.load.serializable.to_json_not_implemented "langchain_core.load.serializable.to_json_not_implemented")
(obj) | Serialize a "not implemented" object. | | [`load.serializable.try_neq_default`](load/langchain_core.load.serializable.try_neq_default.html#langchain_core.load.serializable.try_neq_default "langchain_core.load.serializable.try_neq_default")
(value,Β ...) | Try to determine if a value is different from the default. | [messages](messages.html#langchain-core-messages) [#](#langchain-core-messages "Link to this heading") ------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`messages.ai.AIMessage`](messages/langchain_core.messages.ai.AIMessage.html#langchain_core.messages.ai.AIMessage "langchain_core.messages.ai.AIMessage") | Message from an AI. | | [`messages.ai.AIMessageChunk`](messages/langchain_core.messages.ai.AIMessageChunk.html#langchain_core.messages.ai.AIMessageChunk "langchain_core.messages.ai.AIMessageChunk") | Message chunk from an AI. | | [`messages.ai.InputTokenDetails`](messages/langchain_core.messages.ai.InputTokenDetails.html#langchain_core.messages.ai.InputTokenDetails "langchain_core.messages.ai.InputTokenDetails") | Breakdown of input token counts. | | [`messages.ai.OutputTokenDetails`](messages/langchain_core.messages.ai.OutputTokenDetails.html#langchain_core.messages.ai.OutputTokenDetails "langchain_core.messages.ai.OutputTokenDetails") | Breakdown of output token counts. | | [`messages.ai.UsageMetadata`](messages/langchain_core.messages.ai.UsageMetadata.html#langchain_core.messages.ai.UsageMetadata "langchain_core.messages.ai.UsageMetadata") | Usage metadata for a message, such as token counts. | | [`messages.base.BaseMessage`](messages/langchain_core.messages.base.BaseMessage.html#langchain_core.messages.base.BaseMessage "langchain_core.messages.base.BaseMessage") | Base abstract message class. | | [`messages.base.BaseMessageChunk`](messages/langchain_core.messages.base.BaseMessageChunk.html#langchain_core.messages.base.BaseMessageChunk "langchain_core.messages.base.BaseMessageChunk") | Message chunk, which can be concatenated with other Message chunks. | | [`messages.chat.ChatMessage`](messages/langchain_core.messages.chat.ChatMessage.html#langchain_core.messages.chat.ChatMessage "langchain_core.messages.chat.ChatMessage") | Message that can be assigned an arbitrary speaker (i.e. role). | | [`messages.chat.ChatMessageChunk`](messages/langchain_core.messages.chat.ChatMessageChunk.html#langchain_core.messages.chat.ChatMessageChunk "langchain_core.messages.chat.ChatMessageChunk") | Chat Message chunk. | | [`messages.function.FunctionMessage`](messages/langchain_core.messages.function.FunctionMessage.html#langchain_core.messages.function.FunctionMessage "langchain_core.messages.function.FunctionMessage") | Message for passing the result of executing a tool back to a model. | | [`messages.function.FunctionMessageChunk`](messages/langchain_core.messages.function.FunctionMessageChunk.html#langchain_core.messages.function.FunctionMessageChunk "langchain_core.messages.function.FunctionMessageChunk") | Function Message chunk. | | [`messages.human.HumanMessage`](messages/langchain_core.messages.human.HumanMessage.html#langchain_core.messages.human.HumanMessage "langchain_core.messages.human.HumanMessage") | Message from a human. | | [`messages.human.HumanMessageChunk`](messages/langchain_core.messages.human.HumanMessageChunk.html#langchain_core.messages.human.HumanMessageChunk "langchain_core.messages.human.HumanMessageChunk") | Human Message chunk. | | [`messages.modifier.RemoveMessage`](messages/langchain_core.messages.modifier.RemoveMessage.html#langchain_core.messages.modifier.RemoveMessage "langchain_core.messages.modifier.RemoveMessage") | Message responsible for deleting other messages. | | [`messages.system.SystemMessage`](messages/langchain_core.messages.system.SystemMessage.html#langchain_core.messages.system.SystemMessage "langchain_core.messages.system.SystemMessage") | Message for priming AI behavior. | | [`messages.system.SystemMessageChunk`](messages/langchain_core.messages.system.SystemMessageChunk.html#langchain_core.messages.system.SystemMessageChunk "langchain_core.messages.system.SystemMessageChunk") | System Message chunk. | | [`messages.tool.InvalidToolCall`](messages/langchain_core.messages.tool.InvalidToolCall.html#langchain_core.messages.tool.InvalidToolCall "langchain_core.messages.tool.InvalidToolCall") | Allowance for errors made by LLM. | | [`messages.tool.ToolCall`](messages/langchain_core.messages.tool.ToolCall.html#langchain_core.messages.tool.ToolCall "langchain_core.messages.tool.ToolCall") | Represents a request to call a tool. | | [`messages.tool.ToolCallChunk`](messages/langchain_core.messages.tool.ToolCallChunk.html#langchain_core.messages.tool.ToolCallChunk "langchain_core.messages.tool.ToolCallChunk") | A chunk of a tool call (e.g., as part of a stream). | | [`messages.tool.ToolMessage`](messages/langchain_core.messages.tool.ToolMessage.html#langchain_core.messages.tool.ToolMessage "langchain_core.messages.tool.ToolMessage") | Message for passing the result of executing a tool back to a model. | | [`messages.tool.ToolMessageChunk`](messages/langchain_core.messages.tool.ToolMessageChunk.html#langchain_core.messages.tool.ToolMessageChunk "langchain_core.messages.tool.ToolMessageChunk") | Tool Message chunk. | | [`messages.tool.ToolOutputMixin`](messages/langchain_core.messages.tool.ToolOutputMixin.html#langchain_core.messages.tool.ToolOutputMixin "langchain_core.messages.tool.ToolOutputMixin")
() | Mixin for objects that tools can return directly. | **Functions** | | | | --- | --- | | [`messages.ai.add_ai_message_chunks`](messages/langchain_core.messages.ai.add_ai_message_chunks.html#langchain_core.messages.ai.add_ai_message_chunks "langchain_core.messages.ai.add_ai_message_chunks")
(left,Β \*others) | Add multiple AIMessageChunks together. | | [`messages.ai.add_usage`](messages/langchain_core.messages.ai.add_usage.html#langchain_core.messages.ai.add_usage "langchain_core.messages.ai.add_usage")
(left,Β right) | Recursively add two UsageMetadata objects. | | [`messages.ai.subtract_usage`](messages/langchain_core.messages.ai.subtract_usage.html#langchain_core.messages.ai.subtract_usage "langchain_core.messages.ai.subtract_usage")
(left,Β right) | Recursively subtract two UsageMetadata objects. | | [`messages.base.get_msg_title_repr`](messages/langchain_core.messages.base.get_msg_title_repr.html#langchain_core.messages.base.get_msg_title_repr "langchain_core.messages.base.get_msg_title_repr")
(title,Β \*\[,Β ...\]) | Get a title representation for a message. | | [`messages.base.merge_content`](messages/langchain_core.messages.base.merge_content.html#langchain_core.messages.base.merge_content "langchain_core.messages.base.merge_content")
(first\_content,Β ...) | Merge two message contents. | | [`messages.base.message_to_dict`](messages/langchain_core.messages.base.message_to_dict.html#langchain_core.messages.base.message_to_dict "langchain_core.messages.base.message_to_dict")
(message) | Convert a Message to a dictionary. | | [`messages.base.messages_to_dict`](messages/langchain_core.messages.base.messages_to_dict.html#langchain_core.messages.base.messages_to_dict "langchain_core.messages.base.messages_to_dict")
(messages) | Convert a sequence of Messages to a list of dictionaries. | | [`messages.tool.default_tool_chunk_parser`](messages/langchain_core.messages.tool.default_tool_chunk_parser.html#langchain_core.messages.tool.default_tool_chunk_parser "langchain_core.messages.tool.default_tool_chunk_parser")
(...) | Best-effort parsing of tool chunks. | | [`messages.tool.default_tool_parser`](messages/langchain_core.messages.tool.default_tool_parser.html#langchain_core.messages.tool.default_tool_parser "langchain_core.messages.tool.default_tool_parser")
(raw\_tool\_calls) | Best-effort parsing of tools. | | [`messages.tool.invalid_tool_call`](messages/langchain_core.messages.tool.invalid_tool_call.html#langchain_core.messages.tool.invalid_tool_call "langchain_core.messages.tool.invalid_tool_call")
(\*\[,Β name,Β ...\]) | | | [`messages.tool.tool_call`](messages/langchain_core.messages.tool.tool_call.html#langchain_core.messages.tool.tool_call "langchain_core.messages.tool.tool_call")
(\*,Β name,Β args,Β id) | | | [`messages.tool.tool_call_chunk`](messages/langchain_core.messages.tool.tool_call_chunk.html#langchain_core.messages.tool.tool_call_chunk "langchain_core.messages.tool.tool_call_chunk")
(\*\[,Β name,Β ...\]) | | | [`messages.utils.convert_to_messages`](messages/langchain_core.messages.utils.convert_to_messages.html#langchain_core.messages.utils.convert_to_messages "langchain_core.messages.utils.convert_to_messages")
(messages) | Convert a sequence of messages to a list of messages. | | [`messages.utils.convert_to_openai_messages`](messages/langchain_core.messages.utils.convert_to_openai_messages.html#langchain_core.messages.utils.convert_to_openai_messages "langchain_core.messages.utils.convert_to_openai_messages")
(...) | Convert LangChain messages into OpenAI message dicts. | | [`messages.utils.filter_messages`](messages/langchain_core.messages.utils.filter_messages.html#langchain_core.messages.utils.filter_messages "langchain_core.messages.utils.filter_messages")
(\[messages\]) | Filter messages based on name, type or id. | | [`messages.utils.get_buffer_string`](messages/langchain_core.messages.utils.get_buffer_string.html#langchain_core.messages.utils.get_buffer_string "langchain_core.messages.utils.get_buffer_string")
(messages\[,Β ...\]) | Convert a sequence of Messages to strings and concatenate them into one string. | | [`messages.utils.merge_message_runs`](messages/langchain_core.messages.utils.merge_message_runs.html#langchain_core.messages.utils.merge_message_runs "langchain_core.messages.utils.merge_message_runs")
(\[messages\]) | Merge consecutive Messages of the same type. | | [`messages.utils.message_chunk_to_message`](messages/langchain_core.messages.utils.message_chunk_to_message.html#langchain_core.messages.utils.message_chunk_to_message "langchain_core.messages.utils.message_chunk_to_message")
(chunk) | Convert a message chunk to a message. | | [`messages.utils.messages_from_dict`](messages/langchain_core.messages.utils.messages_from_dict.html#langchain_core.messages.utils.messages_from_dict "langchain_core.messages.utils.messages_from_dict")
(messages) | Convert a sequence of messages from dicts to Message objects. | | [`messages.utils.trim_messages`](messages/langchain_core.messages.utils.trim_messages.html#langchain_core.messages.utils.trim_messages "langchain_core.messages.utils.trim_messages")
(\[messages\]) | Trim messages to be below a token count. | [output\_parsers](output_parsers.html#langchain-core-output-parsers) [#](#langchain-core-output-parsers "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`output_parsers.base.BaseGenerationOutputParser`](output_parsers/langchain_core.output_parsers.base.BaseGenerationOutputParser.html#langchain_core.output_parsers.base.BaseGenerationOutputParser "langchain_core.output_parsers.base.BaseGenerationOutputParser") | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseGenerationOutputParser[Any]` | Base class to parse the output of an LLM call. | | [`output_parsers.base.BaseLLMOutputParser`](output_parsers/langchain_core.output_parsers.base.BaseLLMOutputParser.html#langchain_core.output_parsers.base.BaseLLMOutputParser "langchain_core.output_parsers.base.BaseLLMOutputParser")
() | Abstract base class for parsing the outputs of a model. | | [`output_parsers.base.BaseOutputParser`](output_parsers/langchain_core.output_parsers.base.BaseOutputParser.html#langchain_core.output_parsers.base.BaseOutputParser "langchain_core.output_parsers.base.BaseOutputParser") | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[Enum]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[List[str]]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[StructuredQuery]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[bool]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[datetime]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[dict]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[str]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[~T]` | Base class to parse the output of an LLM call. | | `output_parsers.base.BaseOutputParser[~T]_` | | | `output_parsers.base.BaseOutputParser[~T]__` | | | [`output_parsers.json.JsonOutputParser`](output_parsers/langchain_core.output_parsers.json.JsonOutputParser.html#langchain_core.output_parsers.json.JsonOutputParser "langchain_core.output_parsers.json.JsonOutputParser") | Parse the output of an LLM call to a JSON object. | | [`output_parsers.json.SimpleJsonOutputParser`](output_parsers/langchain_core.output_parsers.json.SimpleJsonOutputParser.html#langchain_core.output_parsers.json.SimpleJsonOutputParser "langchain_core.output_parsers.json.SimpleJsonOutputParser") | alias of [`JsonOutputParser`](output_parsers/langchain_core.output_parsers.json.JsonOutputParser.html#langchain_core.output_parsers.json.JsonOutputParser "langchain_core.output_parsers.json.JsonOutputParser") | | [`output_parsers.list.CommaSeparatedListOutputParser`](output_parsers/langchain_core.output_parsers.list.CommaSeparatedListOutputParser.html#langchain_core.output_parsers.list.CommaSeparatedListOutputParser "langchain_core.output_parsers.list.CommaSeparatedListOutputParser") | Parse the output of an LLM call to a comma-separated list. | | [`output_parsers.list.ListOutputParser`](output_parsers/langchain_core.output_parsers.list.ListOutputParser.html#langchain_core.output_parsers.list.ListOutputParser "langchain_core.output_parsers.list.ListOutputParser") | Parse the output of an LLM call to a list. | | [`output_parsers.list.MarkdownListOutputParser`](output_parsers/langchain_core.output_parsers.list.MarkdownListOutputParser.html#langchain_core.output_parsers.list.MarkdownListOutputParser "langchain_core.output_parsers.list.MarkdownListOutputParser") | Parse a Markdown list. | | [`output_parsers.list.NumberedListOutputParser`](output_parsers/langchain_core.output_parsers.list.NumberedListOutputParser.html#langchain_core.output_parsers.list.NumberedListOutputParser "langchain_core.output_parsers.list.NumberedListOutputParser") | Parse a numbered list. | | [`output_parsers.openai_functions.JsonKeyOutputFunctionsParser`](output_parsers/langchain_core.output_parsers.openai_functions.JsonKeyOutputFunctionsParser.html#langchain_core.output_parsers.openai_functions.JsonKeyOutputFunctionsParser "langchain_core.output_parsers.openai_functions.JsonKeyOutputFunctionsParser") | Parse an output as the element of the Json object. | | [`output_parsers.openai_functions.JsonOutputFunctionsParser`](output_parsers/langchain_core.output_parsers.openai_functions.JsonOutputFunctionsParser.html#langchain_core.output_parsers.openai_functions.JsonOutputFunctionsParser "langchain_core.output_parsers.openai_functions.JsonOutputFunctionsParser") | Parse an output as the Json object. | | [`output_parsers.openai_functions.OutputFunctionsParser`](output_parsers/langchain_core.output_parsers.openai_functions.OutputFunctionsParser.html#langchain_core.output_parsers.openai_functions.OutputFunctionsParser "langchain_core.output_parsers.openai_functions.OutputFunctionsParser") | Parse an output that is one of sets of values. | | [`output_parsers.openai_functions.PydanticAttrOutputFunctionsParser`](output_parsers/langchain_core.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser.html#langchain_core.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser "langchain_core.output_parsers.openai_functions.PydanticAttrOutputFunctionsParser") | Parse an output as an attribute of a pydantic object. | | [`output_parsers.openai_functions.PydanticOutputFunctionsParser`](output_parsers/langchain_core.output_parsers.openai_functions.PydanticOutputFunctionsParser.html#langchain_core.output_parsers.openai_functions.PydanticOutputFunctionsParser "langchain_core.output_parsers.openai_functions.PydanticOutputFunctionsParser") | Parse an output as a pydantic object. | | [`output_parsers.openai_tools.JsonOutputKeyToolsParser`](output_parsers/langchain_core.output_parsers.openai_tools.JsonOutputKeyToolsParser.html#langchain_core.output_parsers.openai_tools.JsonOutputKeyToolsParser "langchain_core.output_parsers.openai_tools.JsonOutputKeyToolsParser") | Parse tools from OpenAI response. | | [`output_parsers.openai_tools.JsonOutputToolsParser`](output_parsers/langchain_core.output_parsers.openai_tools.JsonOutputToolsParser.html#langchain_core.output_parsers.openai_tools.JsonOutputToolsParser "langchain_core.output_parsers.openai_tools.JsonOutputToolsParser") | Parse tools from OpenAI response. | | [`output_parsers.openai_tools.PydanticToolsParser`](output_parsers/langchain_core.output_parsers.openai_tools.PydanticToolsParser.html#langchain_core.output_parsers.openai_tools.PydanticToolsParser "langchain_core.output_parsers.openai_tools.PydanticToolsParser") | Parse tools from OpenAI response. | | [`output_parsers.pydantic.PydanticOutputParser`](output_parsers/langchain_core.output_parsers.pydantic.PydanticOutputParser.html#langchain_core.output_parsers.pydantic.PydanticOutputParser "langchain_core.output_parsers.pydantic.PydanticOutputParser") | Parse an output using a pydantic model. | | [`output_parsers.string.StrOutputParser`](output_parsers/langchain_core.output_parsers.string.StrOutputParser.html#langchain_core.output_parsers.string.StrOutputParser "langchain_core.output_parsers.string.StrOutputParser") | OutputParser that parses LLMResult into the top likely string. | | [`output_parsers.transform.BaseCumulativeTransformOutputParser`](output_parsers/langchain_core.output_parsers.transform.BaseCumulativeTransformOutputParser.html#langchain_core.output_parsers.transform.BaseCumulativeTransformOutputParser "langchain_core.output_parsers.transform.BaseCumulativeTransformOutputParser") | Base class for an output parser that can handle streaming input. | | `output_parsers.transform.BaseCumulativeTransformOutputParser[Any]` | Base class for an output parser that can handle streaming input. | | [`output_parsers.transform.BaseTransformOutputParser`](output_parsers/langchain_core.output_parsers.transform.BaseTransformOutputParser.html#langchain_core.output_parsers.transform.BaseTransformOutputParser "langchain_core.output_parsers.transform.BaseTransformOutputParser") | Base class for an output parser that can handle streaming input. | | `output_parsers.transform.BaseTransformOutputParser[list[str]]` | Base class for an output parser that can handle streaming input. | | `output_parsers.transform.BaseTransformOutputParser[str]` | Base class for an output parser that can handle streaming input. | | [`output_parsers.xml.XMLOutputParser`](output_parsers/langchain_core.output_parsers.xml.XMLOutputParser.html#langchain_core.output_parsers.xml.XMLOutputParser "langchain_core.output_parsers.xml.XMLOutputParser") | Parse an output using xml format. | **Functions** | | | | --- | --- | | [`output_parsers.list.droplastn`](output_parsers/langchain_core.output_parsers.list.droplastn.html#langchain_core.output_parsers.list.droplastn "langchain_core.output_parsers.list.droplastn")
(iter,Β n) | Drop the last n elements of an iterator. | | [`output_parsers.openai_tools.make_invalid_tool_call`](output_parsers/langchain_core.output_parsers.openai_tools.make_invalid_tool_call.html#langchain_core.output_parsers.openai_tools.make_invalid_tool_call "langchain_core.output_parsers.openai_tools.make_invalid_tool_call")
(...) | Create an InvalidToolCall from a raw tool call. | | [`output_parsers.openai_tools.parse_tool_call`](output_parsers/langchain_core.output_parsers.openai_tools.parse_tool_call.html#langchain_core.output_parsers.openai_tools.parse_tool_call "langchain_core.output_parsers.openai_tools.parse_tool_call")
(...) | Parse a single tool call. | | [`output_parsers.openai_tools.parse_tool_calls`](output_parsers/langchain_core.output_parsers.openai_tools.parse_tool_calls.html#langchain_core.output_parsers.openai_tools.parse_tool_calls "langchain_core.output_parsers.openai_tools.parse_tool_calls")
(...) | Parse a list of tool calls. | | [`output_parsers.xml.nested_element`](output_parsers/langchain_core.output_parsers.xml.nested_element.html#langchain_core.output_parsers.xml.nested_element "langchain_core.output_parsers.xml.nested_element")
(path,Β elem) | Get nested element from path. | [outputs](outputs.html#langchain-core-outputs) [#](#langchain-core-outputs "Link to this heading") --------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`outputs.chat_generation.ChatGeneration`](outputs/langchain_core.outputs.chat_generation.ChatGeneration.html#langchain_core.outputs.chat_generation.ChatGeneration "langchain_core.outputs.chat_generation.ChatGeneration") | A single chat generation output. | | [`outputs.chat_generation.ChatGenerationChunk`](outputs/langchain_core.outputs.chat_generation.ChatGenerationChunk.html#langchain_core.outputs.chat_generation.ChatGenerationChunk "langchain_core.outputs.chat_generation.ChatGenerationChunk") | ChatGeneration chunk, which can be concatenated with other ChatGeneration chunks. | | [`outputs.chat_result.ChatResult`](outputs/langchain_core.outputs.chat_result.ChatResult.html#langchain_core.outputs.chat_result.ChatResult "langchain_core.outputs.chat_result.ChatResult") | Use to represent the result of a chat model call with a single prompt. | | [`outputs.generation.Generation`](outputs/langchain_core.outputs.generation.Generation.html#langchain_core.outputs.generation.Generation "langchain_core.outputs.generation.Generation") | A single text generation output. | | [`outputs.generation.GenerationChunk`](outputs/langchain_core.outputs.generation.GenerationChunk.html#langchain_core.outputs.generation.GenerationChunk "langchain_core.outputs.generation.GenerationChunk") | Generation chunk, which can be concatenated with other Generation chunks. | | [`outputs.llm_result.LLMResult`](outputs/langchain_core.outputs.llm_result.LLMResult.html#langchain_core.outputs.llm_result.LLMResult "langchain_core.outputs.llm_result.LLMResult") | A container for results of an LLM call. | | [`outputs.run_info.RunInfo`](outputs/langchain_core.outputs.run_info.RunInfo.html#langchain_core.outputs.run_info.RunInfo "langchain_core.outputs.run_info.RunInfo") | Class that contains metadata for a single execution of a Chain or model. | [prompt\_values](prompt_values.html#langchain-core-prompt-values) [#](#langchain-core-prompt-values "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`prompt_values.ChatPromptValue`](prompt_values/langchain_core.prompt_values.ChatPromptValue.html#langchain_core.prompt_values.ChatPromptValue "langchain_core.prompt_values.ChatPromptValue") | Chat prompt value. | | [`prompt_values.ChatPromptValueConcrete`](prompt_values/langchain_core.prompt_values.ChatPromptValueConcrete.html#langchain_core.prompt_values.ChatPromptValueConcrete "langchain_core.prompt_values.ChatPromptValueConcrete") | Chat prompt value which explicitly lists out the message types it accepts. | | [`prompt_values.ImagePromptValue`](prompt_values/langchain_core.prompt_values.ImagePromptValue.html#langchain_core.prompt_values.ImagePromptValue "langchain_core.prompt_values.ImagePromptValue") | Image prompt value. | | [`prompt_values.ImageURL`](prompt_values/langchain_core.prompt_values.ImageURL.html#langchain_core.prompt_values.ImageURL "langchain_core.prompt_values.ImageURL") | Image URL. | | [`prompt_values.PromptValue`](prompt_values/langchain_core.prompt_values.PromptValue.html#langchain_core.prompt_values.PromptValue "langchain_core.prompt_values.PromptValue") | Base abstract class for inputs to any language model. | | [`prompt_values.StringPromptValue`](prompt_values/langchain_core.prompt_values.StringPromptValue.html#langchain_core.prompt_values.StringPromptValue "langchain_core.prompt_values.StringPromptValue") | String prompt value. | [prompts](prompts.html#langchain-core-prompts) [#](#langchain-core-prompts "Link to this heading") --------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`prompts.base.BasePromptTemplate`](prompts/langchain_core.prompts.base.BasePromptTemplate.html#langchain_core.prompts.base.BasePromptTemplate "langchain_core.prompts.base.BasePromptTemplate") | Base class for all prompt templates, returning a prompt. | | `prompts.base.BasePromptTemplate[ImageURL]` | Base class for all prompt templates, returning a prompt. | | [`prompts.chat.AIMessagePromptTemplate`](prompts/langchain_core.prompts.chat.AIMessagePromptTemplate.html#langchain_core.prompts.chat.AIMessagePromptTemplate "langchain_core.prompts.chat.AIMessagePromptTemplate") | AI message prompt template. | | [`prompts.chat.BaseChatPromptTemplate`](prompts/langchain_core.prompts.chat.BaseChatPromptTemplate.html#langchain_core.prompts.chat.BaseChatPromptTemplate "langchain_core.prompts.chat.BaseChatPromptTemplate") | Base class for chat prompt templates. | | [`prompts.chat.BaseMessagePromptTemplate`](prompts/langchain_core.prompts.chat.BaseMessagePromptTemplate.html#langchain_core.prompts.chat.BaseMessagePromptTemplate "langchain_core.prompts.chat.BaseMessagePromptTemplate") | Base class for message prompt templates. | | [`prompts.chat.BaseStringMessagePromptTemplate`](prompts/langchain_core.prompts.chat.BaseStringMessagePromptTemplate.html#langchain_core.prompts.chat.BaseStringMessagePromptTemplate "langchain_core.prompts.chat.BaseStringMessagePromptTemplate") | Base class for message prompt templates that use a string prompt template. | | [`prompts.chat.ChatMessagePromptTemplate`](prompts/langchain_core.prompts.chat.ChatMessagePromptTemplate.html#langchain_core.prompts.chat.ChatMessagePromptTemplate "langchain_core.prompts.chat.ChatMessagePromptTemplate") | Chat message prompt template. | | [`prompts.chat.ChatPromptTemplate`](prompts/langchain_core.prompts.chat.ChatPromptTemplate.html#langchain_core.prompts.chat.ChatPromptTemplate "langchain_core.prompts.chat.ChatPromptTemplate") | Prompt template for chat models. | | [`prompts.chat.HumanMessagePromptTemplate`](prompts/langchain_core.prompts.chat.HumanMessagePromptTemplate.html#langchain_core.prompts.chat.HumanMessagePromptTemplate "langchain_core.prompts.chat.HumanMessagePromptTemplate") | Human message prompt template. | | [`prompts.chat.MessagesPlaceholder`](prompts/langchain_core.prompts.chat.MessagesPlaceholder.html#langchain_core.prompts.chat.MessagesPlaceholder "langchain_core.prompts.chat.MessagesPlaceholder") | Prompt template that assumes variable is already list of messages. | | [`prompts.chat.SystemMessagePromptTemplate`](prompts/langchain_core.prompts.chat.SystemMessagePromptTemplate.html#langchain_core.prompts.chat.SystemMessagePromptTemplate "langchain_core.prompts.chat.SystemMessagePromptTemplate") | System message prompt template. | | [`prompts.few_shot.FewShotChatMessagePromptTemplate`](prompts/langchain_core.prompts.few_shot.FewShotChatMessagePromptTemplate.html#langchain_core.prompts.few_shot.FewShotChatMessagePromptTemplate "langchain_core.prompts.few_shot.FewShotChatMessagePromptTemplate") | Chat prompt template that supports few-shot examples. | | [`prompts.few_shot.FewShotPromptTemplate`](prompts/langchain_core.prompts.few_shot.FewShotPromptTemplate.html#langchain_core.prompts.few_shot.FewShotPromptTemplate "langchain_core.prompts.few_shot.FewShotPromptTemplate") | Prompt template that contains few shot examples. | | [`prompts.few_shot_with_templates.FewShotPromptWithTemplates`](prompts/langchain_core.prompts.few_shot_with_templates.FewShotPromptWithTemplates.html#langchain_core.prompts.few_shot_with_templates.FewShotPromptWithTemplates "langchain_core.prompts.few_shot_with_templates.FewShotPromptWithTemplates") | Prompt template that contains few shot examples. | | [`prompts.image.ImagePromptTemplate`](prompts/langchain_core.prompts.image.ImagePromptTemplate.html#langchain_core.prompts.image.ImagePromptTemplate "langchain_core.prompts.image.ImagePromptTemplate") | Image prompt template for a multimodal model. | | [`prompts.prompt.PromptTemplate`](prompts/langchain_core.prompts.prompt.PromptTemplate.html#langchain_core.prompts.prompt.PromptTemplate "langchain_core.prompts.prompt.PromptTemplate") | Prompt template for a language model. | | [`prompts.string.StringPromptTemplate`](prompts/langchain_core.prompts.string.StringPromptTemplate.html#langchain_core.prompts.string.StringPromptTemplate "langchain_core.prompts.string.StringPromptTemplate") | String prompt that exposes the format method, returning a prompt. | | [`prompts.structured.StructuredPrompt`](prompts/langchain_core.prompts.structured.StructuredPrompt.html#langchain_core.prompts.structured.StructuredPrompt "langchain_core.prompts.structured.StructuredPrompt") | | **Functions** | | | | --- | --- | | [`prompts.base.aformat_document`](prompts/langchain_core.prompts.base.aformat_document.html#langchain_core.prompts.base.aformat_document "langchain_core.prompts.base.aformat_document")
(doc,Β prompt) | Async format a document into a string based on a prompt template. | | [`prompts.base.format_document`](prompts/langchain_core.prompts.base.format_document.html#langchain_core.prompts.base.format_document "langchain_core.prompts.base.format_document")
(doc,Β prompt) | Format a document into a string based on a prompt template. | | [`prompts.loading.load_prompt`](prompts/langchain_core.prompts.loading.load_prompt.html#langchain_core.prompts.loading.load_prompt "langchain_core.prompts.loading.load_prompt")
(path\[,Β encoding\]) | Unified method for loading a prompt from LangChainHub or local fs. | | [`prompts.loading.load_prompt_from_config`](prompts/langchain_core.prompts.loading.load_prompt_from_config.html#langchain_core.prompts.loading.load_prompt_from_config "langchain_core.prompts.loading.load_prompt_from_config")
(config) | Load prompt from Config Dict. | | [`prompts.string.check_valid_template`](prompts/langchain_core.prompts.string.check_valid_template.html#langchain_core.prompts.string.check_valid_template "langchain_core.prompts.string.check_valid_template")
(...) | Check that template string is valid. | | [`prompts.string.get_template_variables`](prompts/langchain_core.prompts.string.get_template_variables.html#langchain_core.prompts.string.get_template_variables "langchain_core.prompts.string.get_template_variables")
(...) | Get the variables from the template. | | [`prompts.string.jinja2_formatter`](prompts/langchain_core.prompts.string.jinja2_formatter.html#langchain_core.prompts.string.jinja2_formatter "langchain_core.prompts.string.jinja2_formatter")
(template,Β /,Β ...) | Format a template using jinja2. | | [`prompts.string.mustache_formatter`](prompts/langchain_core.prompts.string.mustache_formatter.html#langchain_core.prompts.string.mustache_formatter "langchain_core.prompts.string.mustache_formatter")
(template,Β ...) | Format a template using mustache. | | [`prompts.string.mustache_schema`](prompts/langchain_core.prompts.string.mustache_schema.html#langchain_core.prompts.string.mustache_schema "langchain_core.prompts.string.mustache_schema")
(template) | Get the variables from a mustache template. | | [`prompts.string.mustache_template_vars`](prompts/langchain_core.prompts.string.mustache_template_vars.html#langchain_core.prompts.string.mustache_template_vars "langchain_core.prompts.string.mustache_template_vars")
(template) | Get the variables from a mustache template. | | [`prompts.string.validate_jinja2`](prompts/langchain_core.prompts.string.validate_jinja2.html#langchain_core.prompts.string.validate_jinja2 "langchain_core.prompts.string.validate_jinja2")
(template,Β ...) | Validate that the input variables are valid for the template. | **Deprecated classes** | | | | --- | --- | | [`prompts.pipeline.PipelinePromptTemplate`](prompts/langchain_core.prompts.pipeline.PipelinePromptTemplate.html#langchain_core.prompts.pipeline.PipelinePromptTemplate "langchain_core.prompts.pipeline.PipelinePromptTemplate") | | [rate\_limiters](rate_limiters.html#langchain-core-rate-limiters) [#](#langchain-core-rate-limiters "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`rate_limiters.BaseRateLimiter`](rate_limiters/langchain_core.rate_limiters.BaseRateLimiter.html#langchain_core.rate_limiters.BaseRateLimiter "langchain_core.rate_limiters.BaseRateLimiter")
(\*args,Β \*\*kwargs) | | | [`rate_limiters.InMemoryRateLimiter`](rate_limiters/langchain_core.rate_limiters.InMemoryRateLimiter.html#langchain_core.rate_limiters.InMemoryRateLimiter "langchain_core.rate_limiters.InMemoryRateLimiter")
(\*\[,Β ...\]) | | [retrievers](retrievers.html#langchain-core-retrievers) [#](#langchain-core-retrievers "Link to this heading") --------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`retrievers.BaseRetriever`](retrievers/langchain_core.retrievers.BaseRetriever.html#langchain_core.retrievers.BaseRetriever "langchain_core.retrievers.BaseRetriever") | Abstract base class for a Document retrieval system. | | [`retrievers.LangSmithRetrieverParams`](retrievers/langchain_core.retrievers.LangSmithRetrieverParams.html#langchain_core.retrievers.LangSmithRetrieverParams "langchain_core.retrievers.LangSmithRetrieverParams") | LangSmith parameters for tracing. | [runnables](runnables.html#langchain-core-runnables) [#](#langchain-core-runnables "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`runnables.base.Runnable`](runnables/langchain_core.runnables.base.Runnable.html#langchain_core.runnables.base.Runnable "langchain_core.runnables.base.Runnable")
() | A unit of work that can be invoked, batched, streamed, transformed and composed. | | [`runnables.base.RunnableBinding`](runnables/langchain_core.runnables.base.RunnableBinding.html#langchain_core.runnables.base.RunnableBinding "langchain_core.runnables.base.RunnableBinding") | Wrap a Runnable with additional functionality. | | [`runnables.base.RunnableBindingBase`](runnables/langchain_core.runnables.base.RunnableBindingBase.html#langchain_core.runnables.base.RunnableBindingBase "langchain_core.runnables.base.RunnableBindingBase") | Runnable that delegates calls to another Runnable with a set of kwargs. | | [`runnables.base.RunnableEach`](runnables/langchain_core.runnables.base.RunnableEach.html#langchain_core.runnables.base.RunnableEach "langchain_core.runnables.base.RunnableEach") | Runnable that delegates calls to another Runnable with each element of the input sequence. | | [`runnables.base.RunnableEachBase`](runnables/langchain_core.runnables.base.RunnableEachBase.html#langchain_core.runnables.base.RunnableEachBase "langchain_core.runnables.base.RunnableEachBase") | Runnable that delegates calls to another Runnable with each element of the input sequence. | | [`runnables.base.RunnableGenerator`](runnables/langchain_core.runnables.base.RunnableGenerator.html#langchain_core.runnables.base.RunnableGenerator "langchain_core.runnables.base.RunnableGenerator")
(transform) | Runnable that runs a generator function. | | [`runnables.base.RunnableLambda`](runnables/langchain_core.runnables.base.RunnableLambda.html#langchain_core.runnables.base.RunnableLambda "langchain_core.runnables.base.RunnableLambda")
(func\[,Β afunc,Β ...\]) | RunnableLambda converts a python callable into a Runnable. | | [`runnables.base.RunnableMap`](runnables/langchain_core.runnables.base.RunnableMap.html#langchain_core.runnables.base.RunnableMap "langchain_core.runnables.base.RunnableMap") | alias of [`RunnableParallel`](runnables/langchain_core.runnables.base.RunnableParallel.html#langchain_core.runnables.base.RunnableParallel "langchain_core.runnables.base.RunnableParallel") | | [`runnables.base.RunnableParallel`](runnables/langchain_core.runnables.base.RunnableParallel.html#langchain_core.runnables.base.RunnableParallel "langchain_core.runnables.base.RunnableParallel") | Runnable that runs a mapping of Runnables in parallel, and returns a mapping of their outputs. | | [`runnables.base.RunnableSequence`](runnables/langchain_core.runnables.base.RunnableSequence.html#langchain_core.runnables.base.RunnableSequence "langchain_core.runnables.base.RunnableSequence") | Sequence of Runnables, where the output of each is the input of the next. | | [`runnables.base.RunnableSerializable`](runnables/langchain_core.runnables.base.RunnableSerializable.html#langchain_core.runnables.base.RunnableSerializable "langchain_core.runnables.base.RunnableSerializable") | Runnable that can be serialized to JSON. | | [`runnables.branch.RunnableBranch`](runnables/langchain_core.runnables.branch.RunnableBranch.html#langchain_core.runnables.branch.RunnableBranch "langchain_core.runnables.branch.RunnableBranch") | Runnable that selects which branch to run based on a condition. | | [`runnables.config.ContextThreadPoolExecutor`](runnables/langchain_core.runnables.config.ContextThreadPoolExecutor.html#langchain_core.runnables.config.ContextThreadPoolExecutor "langchain_core.runnables.config.ContextThreadPoolExecutor")
(\[...\]) | ThreadPoolExecutor that copies the context to the child thread. | | [`runnables.config.EmptyDict`](runnables/langchain_core.runnables.config.EmptyDict.html#langchain_core.runnables.config.EmptyDict "langchain_core.runnables.config.EmptyDict") | Empty dict type. | | [`runnables.config.RunnableConfig`](runnables/langchain_core.runnables.config.RunnableConfig.html#langchain_core.runnables.config.RunnableConfig "langchain_core.runnables.config.RunnableConfig") | Configuration for a Runnable. | | [`runnables.configurable.DynamicRunnable`](runnables/langchain_core.runnables.configurable.DynamicRunnable.html#langchain_core.runnables.configurable.DynamicRunnable "langchain_core.runnables.configurable.DynamicRunnable") | Serializable Runnable that can be dynamically configured. | | [`runnables.configurable.RunnableConfigurableAlternatives`](runnables/langchain_core.runnables.configurable.RunnableConfigurableAlternatives.html#langchain_core.runnables.configurable.RunnableConfigurableAlternatives "langchain_core.runnables.configurable.RunnableConfigurableAlternatives") | Runnable that can be dynamically configured. | | [`runnables.configurable.RunnableConfigurableFields`](runnables/langchain_core.runnables.configurable.RunnableConfigurableFields.html#langchain_core.runnables.configurable.RunnableConfigurableFields "langchain_core.runnables.configurable.RunnableConfigurableFields") | Runnable that can be dynamically configured. | | [`runnables.configurable.StrEnum`](runnables/langchain_core.runnables.configurable.StrEnum.html#langchain_core.runnables.configurable.StrEnum "langchain_core.runnables.configurable.StrEnum")
(value\[,Β ...\]) | String enum. | | [`runnables.fallbacks.RunnableWithFallbacks`](runnables/langchain_core.runnables.fallbacks.RunnableWithFallbacks.html#langchain_core.runnables.fallbacks.RunnableWithFallbacks "langchain_core.runnables.fallbacks.RunnableWithFallbacks") | Runnable that can fallback to other Runnables if it fails. | | [`runnables.graph.Branch`](runnables/langchain_core.runnables.graph.Branch.html#langchain_core.runnables.graph.Branch "langchain_core.runnables.graph.Branch")
(condition,Β ends) | Branch in a graph. | | [`runnables.graph.CurveStyle`](runnables/langchain_core.runnables.graph.CurveStyle.html#langchain_core.runnables.graph.CurveStyle "langchain_core.runnables.graph.CurveStyle")
(value\[,Β names,Β ...\]) | Enum for different curve styles supported by Mermaid | | [`runnables.graph.Edge`](runnables/langchain_core.runnables.graph.Edge.html#langchain_core.runnables.graph.Edge "langchain_core.runnables.graph.Edge")
(source,Β target\[,Β data,Β ...\]) | Edge in a graph. | | [`runnables.graph.Graph`](runnables/langchain_core.runnables.graph.Graph.html#langchain_core.runnables.graph.Graph "langchain_core.runnables.graph.Graph")
(nodes,Β ...) | Graph of nodes and edges. | | [`runnables.graph.LabelsDict`](runnables/langchain_core.runnables.graph.LabelsDict.html#langchain_core.runnables.graph.LabelsDict "langchain_core.runnables.graph.LabelsDict") | Dictionary of labels for nodes and edges in a graph. | | [`runnables.graph.MermaidDrawMethod`](runnables/langchain_core.runnables.graph.MermaidDrawMethod.html#langchain_core.runnables.graph.MermaidDrawMethod "langchain_core.runnables.graph.MermaidDrawMethod")
(value\[,Β ...\]) | Enum for different draw methods supported by Mermaid | | [`runnables.graph.Node`](runnables/langchain_core.runnables.graph.Node.html#langchain_core.runnables.graph.Node "langchain_core.runnables.graph.Node")
(id,Β name,Β data,Β metadata) | Node in a graph. | | [`runnables.graph.NodeStyles`](runnables/langchain_core.runnables.graph.NodeStyles.html#langchain_core.runnables.graph.NodeStyles "langchain_core.runnables.graph.NodeStyles")
(\[default,Β first,Β ...\]) | Schema for Hexadecimal color codes for different node types. | | [`runnables.graph.Stringifiable`](runnables/langchain_core.runnables.graph.Stringifiable.html#langchain_core.runnables.graph.Stringifiable "langchain_core.runnables.graph.Stringifiable")
(\*args,Β \*\*kwargs) | | | [`runnables.graph_ascii.AsciiCanvas`](runnables/langchain_core.runnables.graph_ascii.AsciiCanvas.html#langchain_core.runnables.graph_ascii.AsciiCanvas "langchain_core.runnables.graph_ascii.AsciiCanvas")
(cols,Β lines) | Class for drawing in ASCII. | | [`runnables.graph_ascii.VertexViewer`](runnables/langchain_core.runnables.graph_ascii.VertexViewer.html#langchain_core.runnables.graph_ascii.VertexViewer "langchain_core.runnables.graph_ascii.VertexViewer")
(name) | Class to define vertex box boundaries that will be accounted for during graph building by grandalf. | | [`runnables.graph_png.PngDrawer`](runnables/langchain_core.runnables.graph_png.PngDrawer.html#langchain_core.runnables.graph_png.PngDrawer "langchain_core.runnables.graph_png.PngDrawer")
(\[fontname,Β labels\]) | Helper class to draw a state graph into a PNG file. | | [`runnables.history.RunnableWithMessageHistory`](runnables/langchain_core.runnables.history.RunnableWithMessageHistory.html#langchain_core.runnables.history.RunnableWithMessageHistory "langchain_core.runnables.history.RunnableWithMessageHistory") | Runnable that manages chat message history for another Runnable. | | [`runnables.passthrough.RunnableAssign`](runnables/langchain_core.runnables.passthrough.RunnableAssign.html#langchain_core.runnables.passthrough.RunnableAssign "langchain_core.runnables.passthrough.RunnableAssign") | Runnable that assigns key-value pairs to Dict\[str, Any\] inputs. | | [`runnables.passthrough.RunnablePassthrough`](runnables/langchain_core.runnables.passthrough.RunnablePassthrough.html#langchain_core.runnables.passthrough.RunnablePassthrough "langchain_core.runnables.passthrough.RunnablePassthrough") | Runnable to passthrough inputs unchanged or with additional keys. | | [`runnables.passthrough.RunnablePick`](runnables/langchain_core.runnables.passthrough.RunnablePick.html#langchain_core.runnables.passthrough.RunnablePick "langchain_core.runnables.passthrough.RunnablePick") | Runnable that picks keys from Dict\[str, Any\] inputs. | | [`runnables.retry.RunnableRetry`](runnables/langchain_core.runnables.retry.RunnableRetry.html#langchain_core.runnables.retry.RunnableRetry "langchain_core.runnables.retry.RunnableRetry") | Retry a Runnable if it fails. | | [`runnables.router.RouterInput`](runnables/langchain_core.runnables.router.RouterInput.html#langchain_core.runnables.router.RouterInput "langchain_core.runnables.router.RouterInput") | Router input. | | [`runnables.router.RouterRunnable`](runnables/langchain_core.runnables.router.RouterRunnable.html#langchain_core.runnables.router.RouterRunnable "langchain_core.runnables.router.RouterRunnable") | Runnable that routes to a set of Runnables based on Input\['key'\]. | | [`runnables.schema.BaseStreamEvent`](runnables/langchain_core.runnables.schema.BaseStreamEvent.html#langchain_core.runnables.schema.BaseStreamEvent "langchain_core.runnables.schema.BaseStreamEvent") | Streaming event. | | [`runnables.schema.CustomStreamEvent`](runnables/langchain_core.runnables.schema.CustomStreamEvent.html#langchain_core.runnables.schema.CustomStreamEvent "langchain_core.runnables.schema.CustomStreamEvent") | Custom stream event created by the user. | | [`runnables.schema.EventData`](runnables/langchain_core.runnables.schema.EventData.html#langchain_core.runnables.schema.EventData "langchain_core.runnables.schema.EventData") | Data associated with a streaming event. | | [`runnables.schema.StandardStreamEvent`](runnables/langchain_core.runnables.schema.StandardStreamEvent.html#langchain_core.runnables.schema.StandardStreamEvent "langchain_core.runnables.schema.StandardStreamEvent") | A standard stream event that follows LangChain convention for event data. | | [`runnables.utils.AddableDict`](runnables/langchain_core.runnables.utils.AddableDict.html#langchain_core.runnables.utils.AddableDict "langchain_core.runnables.utils.AddableDict") | Dictionary that can be added to another dictionary. | | [`runnables.utils.ConfigurableField`](runnables/langchain_core.runnables.utils.ConfigurableField.html#langchain_core.runnables.utils.ConfigurableField "langchain_core.runnables.utils.ConfigurableField")
(id\[,Β ...\]) | Field that can be configured by the user. | | [`runnables.utils.ConfigurableFieldMultiOption`](runnables/langchain_core.runnables.utils.ConfigurableFieldMultiOption.html#langchain_core.runnables.utils.ConfigurableFieldMultiOption "langchain_core.runnables.utils.ConfigurableFieldMultiOption")
(id,Β ...) | Field that can be configured by the user with multiple default values. | | [`runnables.utils.ConfigurableFieldSingleOption`](runnables/langchain_core.runnables.utils.ConfigurableFieldSingleOption.html#langchain_core.runnables.utils.ConfigurableFieldSingleOption "langchain_core.runnables.utils.ConfigurableFieldSingleOption")
(id,Β ...) | Field that can be configured by the user with a default value. | | [`runnables.utils.ConfigurableFieldSpec`](runnables/langchain_core.runnables.utils.ConfigurableFieldSpec.html#langchain_core.runnables.utils.ConfigurableFieldSpec "langchain_core.runnables.utils.ConfigurableFieldSpec")
(id,Β ...) | Field that can be configured by the user. | | [`runnables.utils.FunctionNonLocals`](runnables/langchain_core.runnables.utils.FunctionNonLocals.html#langchain_core.runnables.utils.FunctionNonLocals "langchain_core.runnables.utils.FunctionNonLocals")
() | Get the nonlocal variables accessed of a function. | | [`runnables.utils.GetLambdaSource`](runnables/langchain_core.runnables.utils.GetLambdaSource.html#langchain_core.runnables.utils.GetLambdaSource "langchain_core.runnables.utils.GetLambdaSource")
() | Get the source code of a lambda function. | | [`runnables.utils.IsFunctionArgDict`](runnables/langchain_core.runnables.utils.IsFunctionArgDict.html#langchain_core.runnables.utils.IsFunctionArgDict "langchain_core.runnables.utils.IsFunctionArgDict")
() | Check if the first argument of a function is a dict. | | [`runnables.utils.IsLocalDict`](runnables/langchain_core.runnables.utils.IsLocalDict.html#langchain_core.runnables.utils.IsLocalDict "langchain_core.runnables.utils.IsLocalDict")
(name,Β keys) | Check if a name is a local dict. | | [`runnables.utils.NonLocals`](runnables/langchain_core.runnables.utils.NonLocals.html#langchain_core.runnables.utils.NonLocals "langchain_core.runnables.utils.NonLocals")
() | Get nonlocal variables accessed. | | [`runnables.utils.SupportsAdd`](runnables/langchain_core.runnables.utils.SupportsAdd.html#langchain_core.runnables.utils.SupportsAdd "langchain_core.runnables.utils.SupportsAdd")
(\*args,Β \*\*kwargs) | Protocol for objects that support addition. | **Functions** | | | | --- | --- | | [`runnables.base.chain`](runnables/langchain_core.runnables.base.chain.html#langchain_core.runnables.base.chain "langchain_core.runnables.base.chain")
() | Decorate a function to make it a Runnable. | | [`runnables.base.coerce_to_runnable`](runnables/langchain_core.runnables.base.coerce_to_runnable.html#langchain_core.runnables.base.coerce_to_runnable "langchain_core.runnables.base.coerce_to_runnable")
(thing) | Coerce a Runnable-like object into a Runnable. | | [`runnables.config.acall_func_with_variable_args`](runnables/langchain_core.runnables.config.acall_func_with_variable_args.html#langchain_core.runnables.config.acall_func_with_variable_args "langchain_core.runnables.config.acall_func_with_variable_args")
(...) | Async call function that may optionally accept a run\_manager and/or config. | | [`runnables.config.call_func_with_variable_args`](runnables/langchain_core.runnables.config.call_func_with_variable_args.html#langchain_core.runnables.config.call_func_with_variable_args "langchain_core.runnables.config.call_func_with_variable_args")
(...) | Call function that may optionally accept a run\_manager and/or config. | | [`runnables.config.ensure_config`](runnables/langchain_core.runnables.config.ensure_config.html#langchain_core.runnables.config.ensure_config "langchain_core.runnables.config.ensure_config")
(\[config\]) | Ensure that a config is a dict with all keys present. | | [`runnables.config.get_async_callback_manager_for_config`](runnables/langchain_core.runnables.config.get_async_callback_manager_for_config.html#langchain_core.runnables.config.get_async_callback_manager_for_config "langchain_core.runnables.config.get_async_callback_manager_for_config")
(config) | Get an async callback manager for a config. | | [`runnables.config.get_callback_manager_for_config`](runnables/langchain_core.runnables.config.get_callback_manager_for_config.html#langchain_core.runnables.config.get_callback_manager_for_config "langchain_core.runnables.config.get_callback_manager_for_config")
(config) | Get a callback manager for a config. | | [`runnables.config.get_config_list`](runnables/langchain_core.runnables.config.get_config_list.html#langchain_core.runnables.config.get_config_list "langchain_core.runnables.config.get_config_list")
(config,Β length) | Get a list of configs from a single config or a list of configs. | | [`runnables.config.get_executor_for_config`](runnables/langchain_core.runnables.config.get_executor_for_config.html#langchain_core.runnables.config.get_executor_for_config "langchain_core.runnables.config.get_executor_for_config")
(config) | Get an executor for a config. | | [`runnables.config.merge_configs`](runnables/langchain_core.runnables.config.merge_configs.html#langchain_core.runnables.config.merge_configs "langchain_core.runnables.config.merge_configs")
(\*configs) | Merge multiple configs into one. | | [`runnables.config.patch_config`](runnables/langchain_core.runnables.config.patch_config.html#langchain_core.runnables.config.patch_config "langchain_core.runnables.config.patch_config")
(config,Β \*\[,Β ...\]) | Patch a config with new values. | | [`runnables.config.run_in_executor`](runnables/langchain_core.runnables.config.run_in_executor.html#langchain_core.runnables.config.run_in_executor "langchain_core.runnables.config.run_in_executor")
(...) | Run a function in an executor. | | [`runnables.configurable.make_options_spec`](runnables/langchain_core.runnables.configurable.make_options_spec.html#langchain_core.runnables.configurable.make_options_spec "langchain_core.runnables.configurable.make_options_spec")
(...) | Make a ConfigurableFieldSpec for a ConfigurableFieldSingleOption or ConfigurableFieldMultiOption. | | [`runnables.configurable.prefix_config_spec`](runnables/langchain_core.runnables.configurable.prefix_config_spec.html#langchain_core.runnables.configurable.prefix_config_spec "langchain_core.runnables.configurable.prefix_config_spec")
(...) | Prefix the id of a ConfigurableFieldSpec. | | [`runnables.graph.is_uuid`](runnables/langchain_core.runnables.graph.is_uuid.html#langchain_core.runnables.graph.is_uuid "langchain_core.runnables.graph.is_uuid")
(value) | Check if a string is a valid UUID. | | [`runnables.graph.node_data_json`](runnables/langchain_core.runnables.graph.node_data_json.html#langchain_core.runnables.graph.node_data_json "langchain_core.runnables.graph.node_data_json")
(node,Β \*\[,Β ...\]) | Convert the data of a node to a JSON-serializable format. | | [`runnables.graph.node_data_str`](runnables/langchain_core.runnables.graph.node_data_str.html#langchain_core.runnables.graph.node_data_str "langchain_core.runnables.graph.node_data_str")
(id,Β data) | Convert the data of a node to a string. | | [`runnables.graph_ascii.draw_ascii`](runnables/langchain_core.runnables.graph_ascii.draw_ascii.html#langchain_core.runnables.graph_ascii.draw_ascii "langchain_core.runnables.graph_ascii.draw_ascii")
(vertices,Β edges) | Build a DAG and draw it in ASCII. | | [`runnables.graph_mermaid.draw_mermaid`](runnables/langchain_core.runnables.graph_mermaid.draw_mermaid.html#langchain_core.runnables.graph_mermaid.draw_mermaid "langchain_core.runnables.graph_mermaid.draw_mermaid")
(nodes,Β ...) | Draws a Mermaid graph using the provided graph data. | | [`runnables.graph_mermaid.draw_mermaid_png`](runnables/langchain_core.runnables.graph_mermaid.draw_mermaid_png.html#langchain_core.runnables.graph_mermaid.draw_mermaid_png "langchain_core.runnables.graph_mermaid.draw_mermaid_png")
(...) | Draws a Mermaid graph as PNG using provided syntax. | | [`runnables.passthrough.aidentity`](runnables/langchain_core.runnables.passthrough.aidentity.html#langchain_core.runnables.passthrough.aidentity "langchain_core.runnables.passthrough.aidentity")
(x) | Async identity function. | | [`runnables.passthrough.identity`](runnables/langchain_core.runnables.passthrough.identity.html#langchain_core.runnables.passthrough.identity "langchain_core.runnables.passthrough.identity")
(x) | Identity function. | | [`runnables.utils.aadd`](runnables/langchain_core.runnables.utils.aadd.html#langchain_core.runnables.utils.aadd "langchain_core.runnables.utils.aadd")
(addables) | Asynchronously add a sequence of addable objects together. | | [`runnables.utils.accepts_config`](runnables/langchain_core.runnables.utils.accepts_config.html#langchain_core.runnables.utils.accepts_config "langchain_core.runnables.utils.accepts_config")
(callable) | Check if a callable accepts a config argument. | | [`runnables.utils.accepts_context`](runnables/langchain_core.runnables.utils.accepts_context.html#langchain_core.runnables.utils.accepts_context "langchain_core.runnables.utils.accepts_context")
(callable) | Check if a callable accepts a context argument. | | [`runnables.utils.accepts_run_manager`](runnables/langchain_core.runnables.utils.accepts_run_manager.html#langchain_core.runnables.utils.accepts_run_manager "langchain_core.runnables.utils.accepts_run_manager")
(callable) | Check if a callable accepts a run\_manager argument. | | [`runnables.utils.add`](runnables/langchain_core.runnables.utils.add.html#langchain_core.runnables.utils.add "langchain_core.runnables.utils.add")
(addables) | Add a sequence of addable objects together. | | [`runnables.utils.gated_coro`](runnables/langchain_core.runnables.utils.gated_coro.html#langchain_core.runnables.utils.gated_coro "langchain_core.runnables.utils.gated_coro")
(semaphore,Β coro) | Run a coroutine with a semaphore. | | [`runnables.utils.gather_with_concurrency`](runnables/langchain_core.runnables.utils.gather_with_concurrency.html#langchain_core.runnables.utils.gather_with_concurrency "langchain_core.runnables.utils.gather_with_concurrency")
(n,Β ...) | Gather coroutines with a limit on the number of concurrent coroutines. | | [`runnables.utils.get_function_first_arg_dict_keys`](runnables/langchain_core.runnables.utils.get_function_first_arg_dict_keys.html#langchain_core.runnables.utils.get_function_first_arg_dict_keys "langchain_core.runnables.utils.get_function_first_arg_dict_keys")
(func) | Get the keys of the first argument of a function if it is a dict. | | [`runnables.utils.get_lambda_source`](runnables/langchain_core.runnables.utils.get_lambda_source.html#langchain_core.runnables.utils.get_lambda_source "langchain_core.runnables.utils.get_lambda_source")
(func) | Get the source code of a lambda function. | | [`runnables.utils.get_unique_config_specs`](runnables/langchain_core.runnables.utils.get_unique_config_specs.html#langchain_core.runnables.utils.get_unique_config_specs "langchain_core.runnables.utils.get_unique_config_specs")
(specs) | Get the unique config specs from a sequence of config specs. | | [`runnables.utils.indent_lines_after_first`](runnables/langchain_core.runnables.utils.indent_lines_after_first.html#langchain_core.runnables.utils.indent_lines_after_first "langchain_core.runnables.utils.indent_lines_after_first")
(...) | Indent all lines of text after the first line. | | [`runnables.utils.is_async_callable`](runnables/langchain_core.runnables.utils.is_async_callable.html#langchain_core.runnables.utils.is_async_callable "langchain_core.runnables.utils.is_async_callable")
(func) | Check if a function is async. | | [`runnables.utils.is_async_generator`](runnables/langchain_core.runnables.utils.is_async_generator.html#langchain_core.runnables.utils.is_async_generator "langchain_core.runnables.utils.is_async_generator")
(func) | Check if a function is an async generator. | [stores](stores.html#langchain-core-stores) [#](#langchain-core-stores "Link to this heading") ----------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`stores.BaseStore`](stores/langchain_core.stores.BaseStore.html#langchain_core.stores.BaseStore "langchain_core.stores.BaseStore")
() | Abstract interface for a key-value store. | | [`stores.InMemoryBaseStore`](stores/langchain_core.stores.InMemoryBaseStore.html#langchain_core.stores.InMemoryBaseStore "langchain_core.stores.InMemoryBaseStore")
() | In-memory implementation of the BaseStore using a dictionary. | | [`stores.InMemoryByteStore`](stores/langchain_core.stores.InMemoryByteStore.html#langchain_core.stores.InMemoryByteStore "langchain_core.stores.InMemoryByteStore")
() | In-memory store for bytes. | | [`stores.InMemoryStore`](stores/langchain_core.stores.InMemoryStore.html#langchain_core.stores.InMemoryStore "langchain_core.stores.InMemoryStore")
() | In-memory store for any type of data. | | [`stores.InvalidKeyException`](stores/langchain_core.stores.InvalidKeyException.html#langchain_core.stores.InvalidKeyException "langchain_core.stores.InvalidKeyException") | Raised when a key is invalid; e.g., uses incorrect characters. | [structured\_query](structured_query.html#langchain-core-structured-query) [#](#langchain-core-structured-query "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`structured_query.Comparator`](structured_query/langchain_core.structured_query.Comparator.html#langchain_core.structured_query.Comparator "langchain_core.structured_query.Comparator")
(value\[,Β names,Β ...\]) | Enumerator of the comparison operators. | | [`structured_query.Comparison`](structured_query/langchain_core.structured_query.Comparison.html#langchain_core.structured_query.Comparison "langchain_core.structured_query.Comparison") | Comparison to a value. | | [`structured_query.Expr`](structured_query/langchain_core.structured_query.Expr.html#langchain_core.structured_query.Expr "langchain_core.structured_query.Expr") | Base class for all expressions. | | [`structured_query.FilterDirective`](structured_query/langchain_core.structured_query.FilterDirective.html#langchain_core.structured_query.FilterDirective "langchain_core.structured_query.FilterDirective") | Filtering expression. | | [`structured_query.Operation`](structured_query/langchain_core.structured_query.Operation.html#langchain_core.structured_query.Operation "langchain_core.structured_query.Operation") | Logical operation over other directives. | | [`structured_query.Operator`](structured_query/langchain_core.structured_query.Operator.html#langchain_core.structured_query.Operator "langchain_core.structured_query.Operator")
(value\[,Β names,Β ...\]) | Enumerator of the operations. | | [`structured_query.StructuredQuery`](structured_query/langchain_core.structured_query.StructuredQuery.html#langchain_core.structured_query.StructuredQuery "langchain_core.structured_query.StructuredQuery") | Structured query. | | [`structured_query.Visitor`](structured_query/langchain_core.structured_query.Visitor.html#langchain_core.structured_query.Visitor "langchain_core.structured_query.Visitor")
() | Defines interface for IR translation using a visitor pattern. | [sys\_info](sys_info.html#langchain-core-sys-info) [#](#langchain-core-sys-info "Link to this heading") -------------------------------------------------------------------------------------------------------- **Functions** | | | | --- | --- | | [`sys_info.print_sys_info`](sys_info/langchain_core.sys_info.print_sys_info.html#langchain_core.sys_info.print_sys_info "langchain_core.sys_info.print_sys_info")
(\*\[,Β additional\_pkgs\]) | Print information about the environment for debugging purposes. | [tools](tools.html#langchain-core-tools) [#](#langchain-core-tools "Link to this heading") ------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`tools.base.BaseTool`](tools/langchain_core.tools.base.BaseTool.html#langchain_core.tools.base.BaseTool "langchain_core.tools.base.BaseTool") | Interface LangChain tools must implement. | | [`tools.base.BaseToolkit`](tools/langchain_core.tools.base.BaseToolkit.html#langchain_core.tools.base.BaseToolkit "langchain_core.tools.base.BaseToolkit") | Base Toolkit representing a collection of related tools. | | [`tools.base.InjectedToolArg`](tools/langchain_core.tools.base.InjectedToolArg.html#langchain_core.tools.base.InjectedToolArg "langchain_core.tools.base.InjectedToolArg")
() | Annotation for a Tool arg that is **not** meant to be generated by a model. | | [`tools.base.InjectedToolCallId`](tools/langchain_core.tools.base.InjectedToolCallId.html#langchain_core.tools.base.InjectedToolCallId "langchain_core.tools.base.InjectedToolCallId")
() | Annotation for injecting the tool\_call\_id. | | [`tools.base.SchemaAnnotationError`](tools/langchain_core.tools.base.SchemaAnnotationError.html#langchain_core.tools.base.SchemaAnnotationError "langchain_core.tools.base.SchemaAnnotationError") | Raised when 'args\_schema' is missing or has an incorrect type annotation. | | [`tools.base.ToolException`](tools/langchain_core.tools.base.ToolException.html#langchain_core.tools.base.ToolException "langchain_core.tools.base.ToolException") | Optional exception that tool throws when execution error occurs. | | [`tools.retriever.RetrieverInput`](tools/langchain_core.tools.retriever.RetrieverInput.html#langchain_core.tools.retriever.RetrieverInput "langchain_core.tools.retriever.RetrieverInput") | Input to the retriever. | | [`tools.simple.Tool`](tools/langchain_core.tools.simple.Tool.html#langchain_core.tools.simple.Tool "langchain_core.tools.simple.Tool") | Tool that takes in function or coroutine directly. | | [`tools.structured.StructuredTool`](tools/langchain_core.tools.structured.StructuredTool.html#langchain_core.tools.structured.StructuredTool "langchain_core.tools.structured.StructuredTool") | Tool that can operate on any number of inputs. | **Functions** | | | | --- | --- | | [`tools.base.create_schema_from_function`](tools/langchain_core.tools.base.create_schema_from_function.html#langchain_core.tools.base.create_schema_from_function "langchain_core.tools.base.create_schema_from_function")
(...) | Create a pydantic schema from a function's signature. | | [`tools.base.get_all_basemodel_annotations`](tools/langchain_core.tools.base.get_all_basemodel_annotations.html#langchain_core.tools.base.get_all_basemodel_annotations "langchain_core.tools.base.get_all_basemodel_annotations")
(cls,Β \*) | | | [`tools.convert.convert_runnable_to_tool`](tools/langchain_core.tools.convert.convert_runnable_to_tool.html#langchain_core.tools.convert.convert_runnable_to_tool "langchain_core.tools.convert.convert_runnable_to_tool")
(runnable) | Convert a Runnable into a BaseTool. | | [`tools.convert.tool`](tools/langchain_core.tools.convert.tool.html#langchain_core.tools.convert.tool "langchain_core.tools.convert.tool")
() | Make tools out of functions, can be used with or without arguments. | | [`tools.render.render_text_description`](tools/langchain_core.tools.render.render_text_description.html#langchain_core.tools.render.render_text_description "langchain_core.tools.render.render_text_description")
(tools) | Render the tool name and description in plain text. | | [`tools.render.render_text_description_and_args`](tools/langchain_core.tools.render.render_text_description_and_args.html#langchain_core.tools.render.render_text_description_and_args "langchain_core.tools.render.render_text_description_and_args")
(tools) | Render the tool name, description, and args in plain text. | | [`tools.retriever.create_retriever_tool`](tools/langchain_core.tools.retriever.create_retriever_tool.html#langchain_core.tools.retriever.create_retriever_tool "langchain_core.tools.retriever.create_retriever_tool")
(...\[,Β ...\]) | Create a tool to do retrieval of documents. | [tracers](tracers.html#langchain-core-tracers) [#](#langchain-core-tracers "Link to this heading") --------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`tracers.base.AsyncBaseTracer`](tracers/langchain_core.tracers.base.AsyncBaseTracer.html#langchain_core.tracers.base.AsyncBaseTracer "langchain_core.tracers.base.AsyncBaseTracer")
(\*\[,Β \_schema\_format\]) | Async Base interface for tracers. | | [`tracers.base.BaseTracer`](tracers/langchain_core.tracers.base.BaseTracer.html#langchain_core.tracers.base.BaseTracer "langchain_core.tracers.base.BaseTracer")
(\*\[,Β \_schema\_format\]) | Base interface for tracers. | | [`tracers.evaluation.EvaluatorCallbackHandler`](tracers/langchain_core.tracers.evaluation.EvaluatorCallbackHandler.html#langchain_core.tracers.evaluation.EvaluatorCallbackHandler "langchain_core.tracers.evaluation.EvaluatorCallbackHandler")
(...) | Tracer that runs a run evaluator whenever a run is persisted. | | [`tracers.event_stream.RunInfo`](tracers/langchain_core.tracers.event_stream.RunInfo.html#langchain_core.tracers.event_stream.RunInfo "langchain_core.tracers.event_stream.RunInfo") | Information about a run. | | [`tracers.langchain.LangChainTracer`](tracers/langchain_core.tracers.langchain.LangChainTracer.html#langchain_core.tracers.langchain.LangChainTracer "langchain_core.tracers.langchain.LangChainTracer")
(\[...\]) | Implementation of the SharedTracer that POSTS to the LangChain endpoint. | | [`tracers.log_stream.LogEntry`](tracers/langchain_core.tracers.log_stream.LogEntry.html#langchain_core.tracers.log_stream.LogEntry "langchain_core.tracers.log_stream.LogEntry") | A single entry in the run log. | | [`tracers.log_stream.LogStreamCallbackHandler`](tracers/langchain_core.tracers.log_stream.LogStreamCallbackHandler.html#langchain_core.tracers.log_stream.LogStreamCallbackHandler "langchain_core.tracers.log_stream.LogStreamCallbackHandler")
(\*) | Tracer that streams run logs to a stream. | | [`tracers.log_stream.RunLog`](tracers/langchain_core.tracers.log_stream.RunLog.html#langchain_core.tracers.log_stream.RunLog "langchain_core.tracers.log_stream.RunLog")
(\*ops,Β state) | Run log. | | [`tracers.log_stream.RunLogPatch`](tracers/langchain_core.tracers.log_stream.RunLogPatch.html#langchain_core.tracers.log_stream.RunLogPatch "langchain_core.tracers.log_stream.RunLogPatch")
(\*ops) | Patch to the run log. | | [`tracers.log_stream.RunState`](tracers/langchain_core.tracers.log_stream.RunState.html#langchain_core.tracers.log_stream.RunState "langchain_core.tracers.log_stream.RunState") | State of the run. | | [`tracers.root_listeners.AsyncRootListenersTracer`](tracers/langchain_core.tracers.root_listeners.AsyncRootListenersTracer.html#langchain_core.tracers.root_listeners.AsyncRootListenersTracer "langchain_core.tracers.root_listeners.AsyncRootListenersTracer")
(\*,Β ...) | Async Tracer that calls listeners on run start, end, and error. | | [`tracers.root_listeners.RootListenersTracer`](tracers/langchain_core.tracers.root_listeners.RootListenersTracer.html#langchain_core.tracers.root_listeners.RootListenersTracer "langchain_core.tracers.root_listeners.RootListenersTracer")
(\*,Β ...) | Tracer that calls listeners on run start, end, and error. | | [`tracers.run_collector.RunCollectorCallbackHandler`](tracers/langchain_core.tracers.run_collector.RunCollectorCallbackHandler.html#langchain_core.tracers.run_collector.RunCollectorCallbackHandler "langchain_core.tracers.run_collector.RunCollectorCallbackHandler")
(\[...\]) | Tracer that collects all nested runs in a list. | | [`tracers.stdout.ConsoleCallbackHandler`](tracers/langchain_core.tracers.stdout.ConsoleCallbackHandler.html#langchain_core.tracers.stdout.ConsoleCallbackHandler "langchain_core.tracers.stdout.ConsoleCallbackHandler")
(\*\*kwargs) | Tracer that prints to the console. | | [`tracers.stdout.FunctionCallbackHandler`](tracers/langchain_core.tracers.stdout.FunctionCallbackHandler.html#langchain_core.tracers.stdout.FunctionCallbackHandler "langchain_core.tracers.stdout.FunctionCallbackHandler")
(...) | Tracer that calls a function with a single str parameter. | **Functions** | | | | --- | --- | | [`tracers.context.collect_runs`](tracers/langchain_core.tracers.context.collect_runs.html#langchain_core.tracers.context.collect_runs "langchain_core.tracers.context.collect_runs")
() | Collect all run traces in context. | | [`tracers.context.register_configure_hook`](tracers/langchain_core.tracers.context.register_configure_hook.html#langchain_core.tracers.context.register_configure_hook "langchain_core.tracers.context.register_configure_hook")
(...) | Register a configure hook. | | [`tracers.context.tracing_enabled`](tracers/langchain_core.tracers.context.tracing_enabled.html#langchain_core.tracers.context.tracing_enabled "langchain_core.tracers.context.tracing_enabled")
(\[session\_name\]) | Throw an error because this has been replaced by tracing\_v2\_enabled. | | [`tracers.context.tracing_v2_enabled`](tracers/langchain_core.tracers.context.tracing_v2_enabled.html#langchain_core.tracers.context.tracing_v2_enabled "langchain_core.tracers.context.tracing_v2_enabled")
(\[...\]) | Instruct LangChain to log all runs in context to LangSmith. | | [`tracers.evaluation.wait_for_all_evaluators`](tracers/langchain_core.tracers.evaluation.wait_for_all_evaluators.html#langchain_core.tracers.evaluation.wait_for_all_evaluators "langchain_core.tracers.evaluation.wait_for_all_evaluators")
() | Wait for all tracers to finish. | | [`tracers.langchain.get_client`](tracers/langchain_core.tracers.langchain.get_client.html#langchain_core.tracers.langchain.get_client "langchain_core.tracers.langchain.get_client")
() | Get the client. | | [`tracers.langchain.log_error_once`](tracers/langchain_core.tracers.langchain.log_error_once.html#langchain_core.tracers.langchain.log_error_once "langchain_core.tracers.langchain.log_error_once")
(method,Β ...) | Log an error once. | | [`tracers.langchain.wait_for_all_tracers`](tracers/langchain_core.tracers.langchain.wait_for_all_tracers.html#langchain_core.tracers.langchain.wait_for_all_tracers "langchain_core.tracers.langchain.wait_for_all_tracers")
() | Wait for all tracers to finish. | | [`tracers.langchain_v1.LangChainTracerV1`](tracers/langchain_core.tracers.langchain_v1.LangChainTracerV1.html#langchain_core.tracers.langchain_v1.LangChainTracerV1 "langchain_core.tracers.langchain_v1.LangChainTracerV1")
(...) | Throw an error because this has been replaced by LangChainTracer. | | [`tracers.langchain_v1.get_headers`](tracers/langchain_core.tracers.langchain_v1.get_headers.html#langchain_core.tracers.langchain_v1.get_headers "langchain_core.tracers.langchain_v1.get_headers")
(\*args,Β \*\*kwargs) | Throw an error because this has been replaced by get\_headers. | | [`tracers.stdout.elapsed`](tracers/langchain_core.tracers.stdout.elapsed.html#langchain_core.tracers.stdout.elapsed "langchain_core.tracers.stdout.elapsed")
(run) | Get the elapsed time of a run. | | [`tracers.stdout.try_json_stringify`](tracers/langchain_core.tracers.stdout.try_json_stringify.html#langchain_core.tracers.stdout.try_json_stringify "langchain_core.tracers.stdout.try_json_stringify")
(obj,Β fallback) | Try to stringify an object to JSON. | **Deprecated classes** | | | | --- | --- | | [`tracers.schemas.BaseRun`](tracers/langchain_core.tracers.schemas.BaseRun.html#langchain_core.tracers.schemas.BaseRun "langchain_core.tracers.schemas.BaseRun")
(\*,Β uuid\[,Β ...\]) | | | [`tracers.schemas.ChainRun`](tracers/langchain_core.tracers.schemas.ChainRun.html#langchain_core.tracers.schemas.ChainRun "langchain_core.tracers.schemas.ChainRun")
(\*,Β uuid\[,Β ...\]) | | | [`tracers.schemas.LLMRun`](tracers/langchain_core.tracers.schemas.LLMRun.html#langchain_core.tracers.schemas.LLMRun "langchain_core.tracers.schemas.LLMRun")
(\*,Β uuid\[,Β ...\]) | | | [`tracers.schemas.ToolRun`](tracers/langchain_core.tracers.schemas.ToolRun.html#langchain_core.tracers.schemas.ToolRun "langchain_core.tracers.schemas.ToolRun")
(\*,Β uuid\[,Β ...\]) | | | [`tracers.schemas.TracerSession`](tracers/langchain_core.tracers.schemas.TracerSession.html#langchain_core.tracers.schemas.TracerSession "langchain_core.tracers.schemas.TracerSession")
(\*\[,Β ...\]) | | | [`tracers.schemas.TracerSessionBase`](tracers/langchain_core.tracers.schemas.TracerSessionBase.html#langchain_core.tracers.schemas.TracerSessionBase "langchain_core.tracers.schemas.TracerSessionBase")
(\*\[,Β ...\]) | | | [`tracers.schemas.TracerSessionV1`](tracers/langchain_core.tracers.schemas.TracerSessionV1.html#langchain_core.tracers.schemas.TracerSessionV1 "langchain_core.tracers.schemas.TracerSessionV1")
(\*\[,Β ...\]) | | | [`tracers.schemas.TracerSessionV1Base`](tracers/langchain_core.tracers.schemas.TracerSessionV1Base.html#langchain_core.tracers.schemas.TracerSessionV1Base "langchain_core.tracers.schemas.TracerSessionV1Base")
(\*\[,Β ...\]) | | | [`tracers.schemas.TracerSessionV1Create`](tracers/langchain_core.tracers.schemas.TracerSessionV1Create.html#langchain_core.tracers.schemas.TracerSessionV1Create "langchain_core.tracers.schemas.TracerSessionV1Create")
(\*\[,Β ...\]) | | **Deprecated functions** | | | | --- | --- | | [`tracers.schemas.RunTypeEnum`](tracers/langchain_core.tracers.schemas.RunTypeEnum.html#langchain_core.tracers.schemas.RunTypeEnum "langchain_core.tracers.schemas.RunTypeEnum")
() | | [utils](utils.html#langchain-core-utils) [#](#langchain-core-utils "Link to this heading") ------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`utils.aiter.NoLock`](utils/langchain_core.utils.aiter.NoLock.html#langchain_core.utils.aiter.NoLock "langchain_core.utils.aiter.NoLock")
() | Dummy lock that provides the proper interface but no protection. | | [`utils.aiter.Tee`](utils/langchain_core.utils.aiter.Tee.html#langchain_core.utils.aiter.Tee "langchain_core.utils.aiter.Tee")
(iterable\[,Β n,Β lock\]) | Create `n` separate asynchronous iterators over `iterable`. | | [`utils.aiter.aclosing`](utils/langchain_core.utils.aiter.aclosing.html#langchain_core.utils.aiter.aclosing "langchain_core.utils.aiter.aclosing")
(thing) | Async context manager for safely finalizing an asynchronously cleaned-up resource such as an async generator, calling its `aclose()` method. | | [`utils.aiter.atee`](utils/langchain_core.utils.aiter.atee.html#langchain_core.utils.aiter.atee "langchain_core.utils.aiter.atee") | alias of [`Tee`](utils/langchain_core.utils.aiter.Tee.html#langchain_core.utils.aiter.Tee "langchain_core.utils.aiter.Tee") | | [`utils.formatting.StrictFormatter`](utils/langchain_core.utils.formatting.StrictFormatter.html#langchain_core.utils.formatting.StrictFormatter "langchain_core.utils.formatting.StrictFormatter")
() | Formatter that checks for extra keys. | | [`utils.function_calling.FunctionDescription`](utils/langchain_core.utils.function_calling.FunctionDescription.html#langchain_core.utils.function_calling.FunctionDescription "langchain_core.utils.function_calling.FunctionDescription") | Representation of a callable function to send to an LLM. | | [`utils.function_calling.ToolDescription`](utils/langchain_core.utils.function_calling.ToolDescription.html#langchain_core.utils.function_calling.ToolDescription "langchain_core.utils.function_calling.ToolDescription") | Representation of a callable function to the OpenAI API. | | [`utils.iter.NoLock`](utils/langchain_core.utils.iter.NoLock.html#langchain_core.utils.iter.NoLock "langchain_core.utils.iter.NoLock")
() | Dummy lock that provides the proper interface but no protection. | | [`utils.iter.Tee`](utils/langchain_core.utils.iter.Tee.html#langchain_core.utils.iter.Tee "langchain_core.utils.iter.Tee")
(iterable\[,Β n,Β lock\]) | Create `n` separate asynchronous iterators over `iterable` | | [`utils.iter.safetee`](utils/langchain_core.utils.iter.safetee.html#langchain_core.utils.iter.safetee "langchain_core.utils.iter.safetee") | alias of [`Tee`](utils/langchain_core.utils.iter.Tee.html#langchain_core.utils.iter.Tee "langchain_core.utils.iter.Tee") | | [`utils.mustache.ChevronError`](utils/langchain_core.utils.mustache.ChevronError.html#langchain_core.utils.mustache.ChevronError "langchain_core.utils.mustache.ChevronError") | Custom exception for Chevron errors. | **Functions** | | | | --- | --- | | [`utils.aiter.abatch_iterate`](utils/langchain_core.utils.aiter.abatch_iterate.html#langchain_core.utils.aiter.abatch_iterate "langchain_core.utils.aiter.abatch_iterate")
(size,Β iterable) | Utility batching function for async iterables. | | [`utils.aiter.py_anext`](utils/langchain_core.utils.aiter.py_anext.html#langchain_core.utils.aiter.py_anext "langchain_core.utils.aiter.py_anext")
(iterator\[,Β default\]) | Pure-Python implementation of anext() for testing purposes. | | [`utils.aiter.tee_peer`](utils/langchain_core.utils.aiter.tee_peer.html#langchain_core.utils.aiter.tee_peer "langchain_core.utils.aiter.tee_peer")
(iterator,Β buffer,Β ...) | An individual iterator of a `tee()`. | | [`utils.env.env_var_is_set`](utils/langchain_core.utils.env.env_var_is_set.html#langchain_core.utils.env.env_var_is_set "langchain_core.utils.env.env_var_is_set")
(env\_var) | Check if an environment variable is set. | | [`utils.env.get_from_dict_or_env`](utils/langchain_core.utils.env.get_from_dict_or_env.html#langchain_core.utils.env.get_from_dict_or_env "langchain_core.utils.env.get_from_dict_or_env")
(data,Β key,Β ...) | Get a value from a dictionary or an environment variable. | | [`utils.env.get_from_env`](utils/langchain_core.utils.env.get_from_env.html#langchain_core.utils.env.get_from_env "langchain_core.utils.env.get_from_env")
(key,Β env\_key\[,Β default\]) | Get a value from a dictionary or an environment variable. | | [`utils.function_calling.convert_to_openai_function`](utils/langchain_core.utils.function_calling.convert_to_openai_function.html#langchain_core.utils.function_calling.convert_to_openai_function "langchain_core.utils.function_calling.convert_to_openai_function")
(...) | Convert a raw function/class to an OpenAI function. :param function: A dictionary, Pydantic BaseModel class, TypedDict class, a LangChain Tool object, or a Python function. If a dictionary is passed in, it is assumed to already be a valid OpenAI function, a JSON schema with top-level 'title' key specified, an Anthropic format tool, or an Amazon Bedrock Converse format tool. :param strict: If True, model output is guaranteed to exactly match the JSON Schema provided in the function definition. If None, `strict` argument will not be included in function definition. | | [`utils.function_calling.convert_to_openai_tool`](utils/langchain_core.utils.function_calling.convert_to_openai_tool.html#langchain_core.utils.function_calling.convert_to_openai_tool "langchain_core.utils.function_calling.convert_to_openai_tool")
(tool,Β \*) | Convert a tool-like object to an OpenAI tool schema. | | [`utils.function_calling.tool_example_to_messages`](utils/langchain_core.utils.function_calling.tool_example_to_messages.html#langchain_core.utils.function_calling.tool_example_to_messages "langchain_core.utils.function_calling.tool_example_to_messages")
(...) | | | [`utils.html.extract_sub_links`](utils/langchain_core.utils.html.extract_sub_links.html#langchain_core.utils.html.extract_sub_links "langchain_core.utils.html.extract_sub_links")
(raw\_html,Β url,Β \*) | Extract all links from a raw HTML string and convert into absolute paths. | | [`utils.html.find_all_links`](utils/langchain_core.utils.html.find_all_links.html#langchain_core.utils.html.find_all_links "langchain_core.utils.html.find_all_links")
(raw\_html,Β \*\[,Β pattern\]) | Extract all links from a raw HTML string. | | [`utils.input.get_bolded_text`](utils/langchain_core.utils.input.get_bolded_text.html#langchain_core.utils.input.get_bolded_text "langchain_core.utils.input.get_bolded_text")
(text) | Get bolded text. | | [`utils.input.get_color_mapping`](utils/langchain_core.utils.input.get_color_mapping.html#langchain_core.utils.input.get_color_mapping "langchain_core.utils.input.get_color_mapping")
(items\[,Β ...\]) | Get mapping for items to a support color. | | [`utils.input.get_colored_text`](utils/langchain_core.utils.input.get_colored_text.html#langchain_core.utils.input.get_colored_text "langchain_core.utils.input.get_colored_text")
(text,Β color) | Get colored text. | | [`utils.input.print_text`](utils/langchain_core.utils.input.print_text.html#langchain_core.utils.input.print_text "langchain_core.utils.input.print_text")
(text\[,Β color,Β end,Β file\]) | Print text with highlighting and no end characters. | | [`utils.interactive_env.is_interactive_env`](utils/langchain_core.utils.interactive_env.is_interactive_env.html#langchain_core.utils.interactive_env.is_interactive_env "langchain_core.utils.interactive_env.is_interactive_env")
() | Determine if running within IPython or Jupyter. | | [`utils.iter.batch_iterate`](utils/langchain_core.utils.iter.batch_iterate.html#langchain_core.utils.iter.batch_iterate "langchain_core.utils.iter.batch_iterate")
(size,Β iterable) | Utility batching function. | | [`utils.iter.tee_peer`](utils/langchain_core.utils.iter.tee_peer.html#langchain_core.utils.iter.tee_peer "langchain_core.utils.iter.tee_peer")
(iterator,Β buffer,Β peers,Β ...) | An individual iterator of a `tee()`. | | [`utils.json.parse_and_check_json_markdown`](utils/langchain_core.utils.json.parse_and_check_json_markdown.html#langchain_core.utils.json.parse_and_check_json_markdown "langchain_core.utils.json.parse_and_check_json_markdown")
(...) | Parse a JSON string from a Markdown string and check that it contains the expected keys. | | [`utils.json.parse_json_markdown`](utils/langchain_core.utils.json.parse_json_markdown.html#langchain_core.utils.json.parse_json_markdown "langchain_core.utils.json.parse_json_markdown")
(json\_string,Β \*) | Parse a JSON string from a Markdown string. | | [`utils.json.parse_partial_json`](utils/langchain_core.utils.json.parse_partial_json.html#langchain_core.utils.json.parse_partial_json "langchain_core.utils.json.parse_partial_json")
(s,Β \*\[,Β strict\]) | Parse a JSON string that may be missing closing braces. | | [`utils.json_schema.dereference_refs`](utils/langchain_core.utils.json_schema.dereference_refs.html#langchain_core.utils.json_schema.dereference_refs "langchain_core.utils.json_schema.dereference_refs")
(schema\_obj,Β \*) | Try to substitute $refs in JSON Schema. | | [`utils.mustache.grab_literal`](utils/langchain_core.utils.mustache.grab_literal.html#langchain_core.utils.mustache.grab_literal "langchain_core.utils.mustache.grab_literal")
(template,Β l\_del) | Parse a literal from the template. | | [`utils.mustache.l_sa_check`](utils/langchain_core.utils.mustache.l_sa_check.html#langchain_core.utils.mustache.l_sa_check "langchain_core.utils.mustache.l_sa_check")
(template,Β literal,Β ...) | Do a preliminary check to see if a tag could be a standalone. | | [`utils.mustache.parse_tag`](utils/langchain_core.utils.mustache.parse_tag.html#langchain_core.utils.mustache.parse_tag "langchain_core.utils.mustache.parse_tag")
(template,Β l\_del,Β r\_del) | Parse a tag from a template. | | [`utils.mustache.r_sa_check`](utils/langchain_core.utils.mustache.r_sa_check.html#langchain_core.utils.mustache.r_sa_check "langchain_core.utils.mustache.r_sa_check")
(template,Β ...) | Do a final check to see if a tag could be a standalone. | | [`utils.mustache.render`](utils/langchain_core.utils.mustache.render.html#langchain_core.utils.mustache.render "langchain_core.utils.mustache.render")
(\[template,Β data,Β ...\]) | Render a mustache template. | | [`utils.mustache.tokenize`](utils/langchain_core.utils.mustache.tokenize.html#langchain_core.utils.mustache.tokenize "langchain_core.utils.mustache.tokenize")
(template\[,Β ...\]) | Tokenize a mustache template. | | [`utils.pydantic.create_model`](utils/langchain_core.utils.pydantic.create_model.html#langchain_core.utils.pydantic.create_model "langchain_core.utils.pydantic.create_model")
(\_\_model\_name\[,Β ...\]) | Create a pydantic model with the given field definitions. | | [`utils.pydantic.create_model_v2`](utils/langchain_core.utils.pydantic.create_model_v2.html#langchain_core.utils.pydantic.create_model_v2 "langchain_core.utils.pydantic.create_model_v2")
(model\_name,Β \*) | Create a pydantic model with the given field definitions. | | [`utils.pydantic.get_fields`](utils/langchain_core.utils.pydantic.get_fields.html#langchain_core.utils.pydantic.get_fields "langchain_core.utils.pydantic.get_fields")
() | Get the field names of a Pydantic model. | | [`utils.pydantic.get_pydantic_major_version`](utils/langchain_core.utils.pydantic.get_pydantic_major_version.html#langchain_core.utils.pydantic.get_pydantic_major_version "langchain_core.utils.pydantic.get_pydantic_major_version")
() | Get the major version of Pydantic. | | [`utils.pydantic.is_basemodel_instance`](utils/langchain_core.utils.pydantic.is_basemodel_instance.html#langchain_core.utils.pydantic.is_basemodel_instance "langchain_core.utils.pydantic.is_basemodel_instance")
(obj) | Check if the given class is an instance of Pydantic BaseModel. | | [`utils.pydantic.is_basemodel_subclass`](utils/langchain_core.utils.pydantic.is_basemodel_subclass.html#langchain_core.utils.pydantic.is_basemodel_subclass "langchain_core.utils.pydantic.is_basemodel_subclass")
(cls) | Check if the given class is a subclass of Pydantic BaseModel. | | [`utils.pydantic.is_pydantic_v1_subclass`](utils/langchain_core.utils.pydantic.is_pydantic_v1_subclass.html#langchain_core.utils.pydantic.is_pydantic_v1_subclass "langchain_core.utils.pydantic.is_pydantic_v1_subclass")
(cls) | Check if the installed Pydantic version is 1.x-like. | | [`utils.pydantic.is_pydantic_v2_subclass`](utils/langchain_core.utils.pydantic.is_pydantic_v2_subclass.html#langchain_core.utils.pydantic.is_pydantic_v2_subclass "langchain_core.utils.pydantic.is_pydantic_v2_subclass")
(cls) | Check if the installed Pydantic version is 1.x-like. | | [`utils.pydantic.pre_init`](utils/langchain_core.utils.pydantic.pre_init.html#langchain_core.utils.pydantic.pre_init "langchain_core.utils.pydantic.pre_init")
(func) | Decorator to run a function before model initialization. | | [`utils.strings.comma_list`](utils/langchain_core.utils.strings.comma_list.html#langchain_core.utils.strings.comma_list "langchain_core.utils.strings.comma_list")
(items) | Convert a list to a comma-separated string. | | [`utils.strings.stringify_dict`](utils/langchain_core.utils.strings.stringify_dict.html#langchain_core.utils.strings.stringify_dict "langchain_core.utils.strings.stringify_dict")
(data) | Stringify a dictionary. | | [`utils.strings.stringify_value`](utils/langchain_core.utils.strings.stringify_value.html#langchain_core.utils.strings.stringify_value "langchain_core.utils.strings.stringify_value")
(val) | Stringify a value. | | [`utils.utils.build_extra_kwargs`](utils/langchain_core.utils.utils.build_extra_kwargs.html#langchain_core.utils.utils.build_extra_kwargs "langchain_core.utils.utils.build_extra_kwargs")
(extra\_kwargs,Β ...) | Build extra kwargs from values and extra\_kwargs. | | [`utils.utils.check_package_version`](utils/langchain_core.utils.utils.check_package_version.html#langchain_core.utils.utils.check_package_version "langchain_core.utils.utils.check_package_version")
(package\[,Β ...\]) | Check the version of a package. | | [`utils.utils.convert_to_secret_str`](utils/langchain_core.utils.utils.convert_to_secret_str.html#langchain_core.utils.utils.convert_to_secret_str "langchain_core.utils.utils.convert_to_secret_str")
(value) | Convert a string to a SecretStr if needed. | | [`utils.utils.from_env`](utils/langchain_core.utils.utils.from_env.html#langchain_core.utils.utils.from_env "langchain_core.utils.utils.from_env")
() | Create a factory method that gets a value from an environment variable. | | [`utils.utils.get_pydantic_field_names`](utils/langchain_core.utils.utils.get_pydantic_field_names.html#langchain_core.utils.utils.get_pydantic_field_names "langchain_core.utils.utils.get_pydantic_field_names")
(...) | Get field names, including aliases, for a pydantic class. | | [`utils.utils.guard_import`](utils/langchain_core.utils.utils.guard_import.html#langchain_core.utils.utils.guard_import "langchain_core.utils.utils.guard_import")
(module\_name,Β \*\[,Β ...\]) | Dynamically import a module and raise an exception if the module is not installed. | | [`utils.utils.mock_now`](utils/langchain_core.utils.utils.mock_now.html#langchain_core.utils.utils.mock_now "langchain_core.utils.utils.mock_now")
(dt\_value) | Context manager for mocking out datetime.now() in unit tests. | | [`utils.utils.raise_for_status_with_text`](utils/langchain_core.utils.utils.raise_for_status_with_text.html#langchain_core.utils.utils.raise_for_status_with_text "langchain_core.utils.utils.raise_for_status_with_text")
(response) | Raise an error with the response text. | | [`utils.utils.secret_from_env`](utils/langchain_core.utils.utils.secret_from_env.html#langchain_core.utils.utils.secret_from_env "langchain_core.utils.utils.secret_from_env")
() | Secret from env. | | [`utils.utils.xor_args`](utils/langchain_core.utils.utils.xor_args.html#langchain_core.utils.utils.xor_args "langchain_core.utils.utils.xor_args")
(\*arg\_groups) | Validate specified keyword args are mutually exclusive." | **Deprecated functions** | | | | --- | --- | | [`utils.function_calling.convert_pydantic_to_openai_function`](utils/langchain_core.utils.function_calling.convert_pydantic_to_openai_function.html#langchain_core.utils.function_calling.convert_pydantic_to_openai_function "langchain_core.utils.function_calling.convert_pydantic_to_openai_function")
(...) | | | [`utils.function_calling.convert_pydantic_to_openai_tool`](utils/langchain_core.utils.function_calling.convert_pydantic_to_openai_tool.html#langchain_core.utils.function_calling.convert_pydantic_to_openai_tool "langchain_core.utils.function_calling.convert_pydantic_to_openai_tool")
(...) | | | [`utils.function_calling.convert_python_function_to_openai_function`](utils/langchain_core.utils.function_calling.convert_python_function_to_openai_function.html#langchain_core.utils.function_calling.convert_python_function_to_openai_function "langchain_core.utils.function_calling.convert_python_function_to_openai_function")
(...) | | | [`utils.function_calling.format_tool_to_openai_function`](utils/langchain_core.utils.function_calling.format_tool_to_openai_function.html#langchain_core.utils.function_calling.format_tool_to_openai_function "langchain_core.utils.function_calling.format_tool_to_openai_function")
(tool) | | | [`utils.function_calling.format_tool_to_openai_tool`](utils/langchain_core.utils.function_calling.format_tool_to_openai_tool.html#langchain_core.utils.function_calling.format_tool_to_openai_tool "langchain_core.utils.function_calling.format_tool_to_openai_tool")
(tool) | | | [`utils.loading.try_load_from_hub`](utils/langchain_core.utils.loading.try_load_from_hub.html#langchain_core.utils.loading.try_load_from_hub "langchain_core.utils.loading.try_load_from_hub")
(\*args,Β \*\*kwargs) | | [vectorstores](vectorstores.html#langchain-core-vectorstores) [#](#langchain-core-vectorstores "Link to this heading") ----------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`vectorstores.base.VectorStore`](vectorstores/langchain_core.vectorstores.base.VectorStore.html#langchain_core.vectorstores.base.VectorStore "langchain_core.vectorstores.base.VectorStore")
() | Interface for vector store. | | [`vectorstores.base.VectorStoreRetriever`](vectorstores/langchain_core.vectorstores.base.VectorStoreRetriever.html#langchain_core.vectorstores.base.VectorStoreRetriever "langchain_core.vectorstores.base.VectorStoreRetriever") | Base Retriever class for VectorStore. | | [`vectorstores.in_memory.InMemoryVectorStore`](vectorstores/langchain_core.vectorstores.in_memory.InMemoryVectorStore.html#langchain_core.vectorstores.in_memory.InMemoryVectorStore "langchain_core.vectorstores.in_memory.InMemoryVectorStore")
(...) | In-memory vector store implementation. | **Functions** | | | | --- | --- | | [`vectorstores.utils.maximal_marginal_relevance`](vectorstores/langchain_core.vectorstores.utils.maximal_marginal_relevance.html#langchain_core.vectorstores.utils.maximal_marginal_relevance "langchain_core.vectorstores.utils.maximal_marginal_relevance")
(...) | Calculate maximal marginal relevance. | --- # Build a Chatbot | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/chatbot.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/chatbot.ipynb) note This tutorial previously used the [RunnableWithMessageHistory](https://python.langchain.com/api_reference/core/runnables/langchain_core.runnables.history.RunnableWithMessageHistory.html) abstraction. You can access that version of the documentation in the [v0.2 docs](https://python.langchain.com/v0.2/docs/tutorials/chatbot/) . As of the v0.3 release of LangChain, we recommend that LangChain users take advantage of [LangGraph persistence](https://langchain-ai.github.io/langgraph/concepts/persistence/) to incorporate `memory` into new LangChain applications. If your code is already relying on `RunnableWithMessageHistory` or `BaseChatMessageHistory`, you do **not** need to make any changes. We do not plan on deprecating this functionality in the near future as it works for simple chat applications and any code that uses `RunnableWithMessageHistory` will continue to work as expected. Please see [How to migrate to LangGraph Memory](/docs/versions/migrating_memory/) for more details. Overview[​](#overview "Direct link to Overview") ------------------------------------------------- We'll go over an example of how to design and implement an LLM-powered chatbot. This chatbot will be able to have a conversation and remember previous interactions with a [chat model](/docs/concepts/chat_models/) . Note that this chatbot that we build will only use the language model to have a conversation. There are several other related concepts that you may be looking for: * [Conversational RAG](/docs/tutorials/qa_chat_history/) : Enable a chatbot experience over an external source of data * [Agents](/docs/tutorials/agents/) : Build a chatbot that can take actions This tutorial will cover the basics which will be helpful for those two more advanced topics, but feel free to skip directly to there should you choose. Setup[​](#setup "Direct link to Setup") ---------------------------------------- ### Jupyter Notebook[​](#jupyter-notebook "Direct link to Jupyter Notebook") This guide (and most of the other guides in the documentation) uses [Jupyter notebooks](https://jupyter.org/) and assumes the reader is as well. Jupyter notebooks are perfect for learning how to work with LLM systems because oftentimes things can go wrong (unexpected output, API down, etc) and going through guides in an interactive environment is a great way to better understand them. This and other tutorials are perhaps most conveniently run in a Jupyter notebook. See [here](https://jupyter.org/install) for instructions on how to install. ### Installation[​](#installation "Direct link to Installation") For this tutorial we will need `langchain-core` and `langgraph`. This guide requires `langgraph >= 0.2.28`. * Pip * Conda pip install langchain-core langgraph>0.2.27 conda install langchain-core langgraph>0.2.27 -c conda-forge For more details, see our [Installation guide](/docs/how_to/installation/) . ### LangSmith[​](#langsmith "Direct link to LangSmith") Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent. The best way to do this is with [LangSmith](https://smith.langchain.com) . After you sign up at the link above, make sure to set your environment variables to start logging traces: export LANGCHAIN_TRACING_V2="true"export LANGCHAIN_API_KEY="..." Or, if in a notebook, you can set them with: import getpassimport osos.environ["LANGCHAIN_TRACING_V2"] = "true"os.environ["LANGCHAIN_API_KEY"] = getpass.getpass() Quickstart[​](#quickstart "Direct link to Quickstart") ------------------------------------------------------- First up, let's learn how to use a language model by itself. LangChain supports many different language models that you can use interchangeably - select the one you want to use below! Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAImodel = ChatOpenAI(model="gpt-4o-mini") Let's first use the model directly. `ChatModel`s are instances of LangChain "Runnables", which means they expose a standard interface for interacting with them. To just simply call the model, we can pass in a list of messages to the `.invoke` method. from langchain_core.messages import HumanMessagemodel.invoke([HumanMessage(content="Hi! I'm Bob")]) **API Reference:**[HumanMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.human.HumanMessage.html) AIMessage(content='Hi Bob! How can I assist you today?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 10, 'prompt_tokens': 11, 'total_tokens': 21, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-mini-2024-07-18', 'system_fingerprint': 'fp_0705bf87c0', 'finish_reason': 'stop', 'logprobs': None}, id='run-5211544f-da9f-4325-8b8e-b3d92b2fc71a-0', usage_metadata={'input_tokens': 11, 'output_tokens': 10, 'total_tokens': 21, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}}) The model on its own does not have any concept of state. For example, if you ask a followup question: model.invoke([HumanMessage(content="What's my name?")]) AIMessage(content="I'm sorry, but I don't have access to personal information about users unless it has been shared with me in the course of our conversation. How can I assist you today?", additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 34, 'prompt_tokens': 11, 'total_tokens': 45, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-mini-2024-07-18', 'system_fingerprint': 'fp_0705bf87c0', 'finish_reason': 'stop', 'logprobs': None}, id='run-a2d13a18-7022-4784-b54f-f85c097d1075-0', usage_metadata={'input_tokens': 11, 'output_tokens': 34, 'total_tokens': 45, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}}) Let's take a look at the example [LangSmith trace](https://smith.langchain.com/public/5c21cb92-2814-4119-bae9-d02b8db577ac/r) We can see that it doesn't take the previous conversation turn into context, and cannot answer the question. This makes for a terrible chatbot experience! To get around this, we need to pass the entire [conversation history](/docs/concepts/chat_history/) into the model. Let's see what happens when we do that: from langchain_core.messages import AIMessagemodel.invoke( [ HumanMessage(content="Hi! I'm Bob"), AIMessage(content="Hello Bob! How can I assist you today?"), HumanMessage(content="What's my name?"), ]) **API Reference:**[AIMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.ai.AIMessage.html) AIMessage(content='Your name is Bob! How can I help you today, Bob?', additional_kwargs={'refusal': None}, response_metadata={'token_usage': {'completion_tokens': 14, 'prompt_tokens': 33, 'total_tokens': 47, 'completion_tokens_details': {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}, 'prompt_tokens_details': {'audio_tokens': 0, 'cached_tokens': 0}}, 'model_name': 'gpt-4o-mini-2024-07-18', 'system_fingerprint': 'fp_0705bf87c0', 'finish_reason': 'stop', 'logprobs': None}, id='run-34bcccb3-446e-42f2-b1de-52c09936c02c-0', usage_metadata={'input_tokens': 33, 'output_tokens': 14, 'total_tokens': 47, 'input_token_details': {'audio': 0, 'cache_read': 0}, 'output_token_details': {'audio': 0, 'reasoning': 0}}) And now we can see that we get a good response! This is the basic idea underpinning a chatbot's ability to interact conversationally. So how do we best implement this? Message persistence[​](#message-persistence "Direct link to Message persistence") ---------------------------------------------------------------------------------- [LangGraph](https://langchain-ai.github.io/langgraph/) implements a built-in persistence layer, making it ideal for chat applications that support multiple conversational turns. Wrapping our chat model in a minimal LangGraph application allows us to automatically persist the message history, simplifying the development of multi-turn applications. LangGraph comes with a simple in-memory checkpointer, which we use below. See its [documentation](https://langchain-ai.github.io/langgraph/concepts/persistence/) for more detail, including how to use different persistence backends (e.g., SQLite or Postgres). from langgraph.checkpoint.memory import MemorySaverfrom langgraph.graph import START, MessagesState, StateGraph# Define a new graphworkflow = StateGraph(state_schema=MessagesState)# Define the function that calls the modeldef call_model(state: MessagesState): response = model.invoke(state["messages"]) return {"messages": response}# Define the (single) node in the graphworkflow.add_edge(START, "model")workflow.add_node("model", call_model)# Add memorymemory = MemorySaver()app = workflow.compile(checkpointer=memory) **API Reference:**[MemorySaver](https://langchain-ai.github.io/langgraph/reference/checkpoints/#langgraph.checkpoint.memory.MemorySaver) | [StateGraph](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.state.StateGraph) We now need to create a `config` that we pass into the runnable every time. This config contains information that is not part of the input directly, but is still useful. In this case, we want to include a `thread_id`. This should look like: config = {"configurable": {"thread_id": "abc123"}} This enables us to support multiple conversation threads with a single application, a common requirement when your application has multiple users. We can then invoke the application: query = "Hi! I'm Bob."input_messages = [HumanMessage(query)]output = app.invoke({"messages": input_messages}, config)output["messages"][-1].pretty_print() # output contains all messages in state ================================== Ai Message ==================================Hi Bob! How can I assist you today?\ \ query = "What's my name?"input_messages = [HumanMessage(query)]output = app.invoke({"messages": input_messages}, config)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================Your name is Bob! How can I help you today, Bob?\ \ Great! Our chatbot now remembers things about us. If we change the config to reference a different `thread_id`, we can see that it starts the conversation fresh.\ \ config = {"configurable": {"thread_id": "abc234"}}input_messages = [HumanMessage(query)]output = app.invoke({"messages": input_messages}, config)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================I'm sorry, but I don't have access to personal information about you unless you've shared it in this conversation. How can I assist you today?\ \ However, we can always go back to the original conversation (since we are persisting it in a database)\ \ config = {"configurable": {"thread_id": "abc123"}}input_messages = [HumanMessage(query)]output = app.invoke({"messages": input_messages}, config)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================Your name is Bob. What would you like to discuss today?\ \ This is how we can support a chatbot having conversations with many users!\ \ tip\ \ For async support, update the `call_model` node to be an async function and use `.ainvoke` when invoking the application:\ \ # Async function for node:async def call_model(state: MessagesState): response = await model.ainvoke(state["messages"]) return {"messages": response}# Define graph as before:workflow = StateGraph(state_schema=MessagesState)workflow.add_edge(START, "model")workflow.add_node("model", call_model)app = workflow.compile(checkpointer=MemorySaver())# Async invocation:output = await app.ainvoke({"messages": input_messages}, config)output["messages"][-1].pretty_print()\ \ Right now, all we've done is add a simple persistence layer around the model. We can start to make the chatbot more complicated and personalized by adding in a prompt template.\ \ Prompt templates[​](#prompt-templates "Direct link to Prompt templates")\ \ -------------------------------------------------------------------------\ \ [Prompt Templates](/docs/concepts/prompt_templates/)\ help to turn raw user information into a format that the LLM can work with. In this case, the raw user input is just a message, which we are passing to the LLM. Let's now make that a bit more complicated. First, let's add in a system message with some custom instructions (but still taking messages as input). Next, we'll add in more input besides just the messages.\ \ To add in a system message, we will create a `ChatPromptTemplate`. We will utilize `MessagesPlaceholder` to pass all the messages in.\ \ from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholderprompt_template = ChatPromptTemplate.from_messages( [ ( "system", "You talk like a pirate. Answer all questions to the best of your ability.", ), MessagesPlaceholder(variable_name="messages"), ])\ \ **API Reference:**[ChatPromptTemplate](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.ChatPromptTemplate.html)\ | [MessagesPlaceholder](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.MessagesPlaceholder.html)\ \ We can now update our application to incorporate this template:\ \ workflow = StateGraph(state_schema=MessagesState)def call_model(state: MessagesState): prompt = prompt_template.invoke(state) response = model.invoke(prompt) return {"messages": response}workflow.add_edge(START, "model")workflow.add_node("model", call_model)memory = MemorySaver()app = workflow.compile(checkpointer=memory)\ \ We invoke the application in the same way:\ \ config = {"configurable": {"thread_id": "abc345"}}query = "Hi! I'm Jim."input_messages = [HumanMessage(query)]output = app.invoke({"messages": input_messages}, config)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================Ahoy there, Jim! What brings ye to these waters today? Be ye seekin' treasure, knowledge, or perhaps a good tale from the high seas? Arrr!\ \ query = "What is my name?"input_messages = [HumanMessage(query)]output = app.invoke({"messages": input_messages}, config)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================Ye be called Jim, matey! A fine name fer a swashbuckler such as yerself! What else can I do fer ye? Arrr!\ \ Awesome! Let's now make our prompt a little bit more complicated. Let's assume that the prompt template now looks something like this:\ \ prompt_template = ChatPromptTemplate.from_messages( [ ( "system", "You are a helpful assistant. Answer all questions to the best of your ability in {language}.", ), MessagesPlaceholder(variable_name="messages"), ])\ \ Note that we have added a new `language` input to the prompt. Our application now has two parameters-- the input `messages` and `language`. We should update our application's state to reflect this:\ \ from typing import Sequencefrom langchain_core.messages import BaseMessagefrom langgraph.graph.message import add_messagesfrom typing_extensions import Annotated, TypedDictclass State(TypedDict): messages: Annotated[Sequence[BaseMessage], add_messages] language: strworkflow = StateGraph(state_schema=State)def call_model(state: State): prompt = prompt_template.invoke(state) response = model.invoke(prompt) return {"messages": [response]}workflow.add_edge(START, "model")workflow.add_node("model", call_model)memory = MemorySaver()app = workflow.compile(checkpointer=memory)\ \ **API Reference:**[BaseMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.base.BaseMessage.html)\ | [add\_messages](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.message.add_messages)\ \ config = {"configurable": {"thread_id": "abc456"}}query = "Hi! I'm Bob."language = "Spanish"input_messages = [HumanMessage(query)]output = app.invoke( {"messages": input_messages, "language": language}, config,)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================Β‘Hola, Bob! ΒΏCΓ³mo puedo ayudarte hoy?\ \ Note that the entire state is persisted, so we can omit parameters like `language` if no changes are desired:\ \ query = "What is my name?"input_messages = [HumanMessage(query)]output = app.invoke( {"messages": input_messages}, config,)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================Tu nombre es Bob. ΒΏHay algo mΓ‘s en lo que pueda ayudarte?\ \ To help you understand what's happening internally, check out [this LangSmith trace](https://smith.langchain.com/public/15bd8589-005c-4812-b9b9-23e74ba4c3c6/r)\ .\ \ Managing Conversation History[​](#managing-conversation-history "Direct link to Managing Conversation History")\ \ ----------------------------------------------------------------------------------------------------------------\ \ One important concept to understand when building chatbots is how to manage conversation history. If left unmanaged, the list of messages will grow unbounded and potentially overflow the context window of the LLM. Therefore, it is important to add a step that limits the size of the messages you are passing in.\ \ **Importantly, you will want to do this BEFORE the prompt template but AFTER you load previous messages from Message History.**\ \ We can do this by adding a simple step in front of the prompt that modifies the `messages` key appropriately, and then wrap that new chain in the Message History class.\ \ LangChain comes with a few built-in helpers for [managing a list of messages](/docs/how_to/#messages)\ . In this case we'll use the [trim\_messages](/docs/how_to/trim_messages/)\ helper to reduce how many messages we're sending to the model. The trimmer allows us to specify how many tokens we want to keep, along with other parameters like if we want to always keep the system message and whether to allow partial messages:\ \ from langchain_core.messages import SystemMessage, trim_messagestrimmer = trim_messages( max_tokens=65, strategy="last", token_counter=model, include_system=True, allow_partial=False, start_on="human",)messages = [ SystemMessage(content="you're a good assistant"), HumanMessage(content="hi! I'm bob"), AIMessage(content="hi!"), HumanMessage(content="I like vanilla ice cream"), AIMessage(content="nice"), HumanMessage(content="whats 2 + 2"), AIMessage(content="4"), HumanMessage(content="thanks"), AIMessage(content="no problem!"), HumanMessage(content="having fun?"), AIMessage(content="yes!"),]trimmer.invoke(messages)\ \ **API Reference:**[SystemMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.system.SystemMessage.html)\ | [trim\_messages](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.utils.trim_messages.html)\ \ [SystemMessage(content="you're a good assistant", additional_kwargs={}, response_metadata={}), HumanMessage(content='whats 2 + 2', additional_kwargs={}, response_metadata={}), AIMessage(content='4', additional_kwargs={}, response_metadata={}), HumanMessage(content='thanks', additional_kwargs={}, response_metadata={}), AIMessage(content='no problem!', additional_kwargs={}, response_metadata={}), HumanMessage(content='having fun?', additional_kwargs={}, response_metadata={}), AIMessage(content='yes!', additional_kwargs={}, response_metadata={})]\ \ To use it in our chain, we just need to run the trimmer before we pass the `messages` input to our prompt.\ \ workflow = StateGraph(state_schema=State)def call_model(state: State): trimmed_messages = trimmer.invoke(state["messages"]) prompt = prompt_template.invoke( {"messages": trimmed_messages, "language": state["language"]} ) response = model.invoke(prompt) return {"messages": [response]}workflow.add_edge(START, "model")workflow.add_node("model", call_model)memory = MemorySaver()app = workflow.compile(checkpointer=memory)\ \ Now if we try asking the model our name, it won't know it since we trimmed that part of the chat history:\ \ config = {"configurable": {"thread_id": "abc567"}}query = "What is my name?"language = "English"input_messages = messages + [HumanMessage(query)]output = app.invoke( {"messages": input_messages, "language": language}, config,)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================I don't know your name. You haven't told me yet!\ \ But if we ask about information that is within the last few messages, it remembers:\ \ config = {"configurable": {"thread_id": "abc678"}}query = "What math problem did I ask?"language = "English"input_messages = messages + [HumanMessage(query)]output = app.invoke( {"messages": input_messages, "language": language}, config,)output["messages"][-1].pretty_print()\ \ ================================== Ai Message ==================================You asked what 2 + 2 equals.\ \ If you take a look at LangSmith, you can see exactly what is happening under the hood in the [LangSmith trace](https://smith.langchain.com/public/04402eaa-29e6-4bb1-aa91-885b730b6c21/r)\ .\ \ Streaming[​](#streaming "Direct link to Streaming")\ \ ----------------------------------------------------\ \ Now we've got a functioning chatbot. However, one _really_ important UX consideration for chatbot applications is streaming. LLMs can sometimes take a while to respond, and so in order to improve the user experience one thing that most applications do is stream back each token as it is generated. This allows the user to see progress.\ \ It's actually super easy to do this!\ \ By default, `.stream` in our LangGraph application streams application steps-- in this case, the single step of the model response. Setting `stream_mode="messages"` allows us to stream output tokens instead:\ \ config = {"configurable": {"thread_id": "abc789"}}query = "Hi I'm Todd, please tell me a joke."language = "English"input_messages = [HumanMessage(query)]for chunk, metadata in app.stream( {"messages": input_messages, "language": language}, config, stream_mode="messages",): if isinstance(chunk, AIMessage): # Filter to just model responses print(chunk.content, end="|")\ \ |Hi| Todd|!| Here|’s| a| joke| for| you|:|Why| don|’t| skeleton|s| fight| each| other|?|Because| they| don|’t| have| the| guts|!||\ \ Next Steps[​](#next-steps "Direct link to Next Steps")\ \ -------------------------------------------------------\ \ Now that you understand the basics of how to create a chatbot in LangChain, some more advanced tutorials you may be interested in are:\ \ * [Conversational RAG](/docs/tutorials/qa_chat_history/)\ : Enable a chatbot experience over an external source of data\ * [Agents](/docs/tutorials/agents/)\ : Build a chatbot that can take actions\ \ If you want to dive deeper on specifics, some things worth checking out are:\ \ * [Streaming](/docs/how_to/streaming/)\ : streaming is _crucial_ for chat applications\ * [How to add message history](/docs/how_to/message_history/)\ : for a deeper dive into all things related to message history\ * [How to manage large message history](/docs/how_to/trim_messages/)\ : more techniques for managing a large chat history\ * [LangGraph main docs](https://langchain-ai.github.io/langgraph/)\ : for more detail on building with LangGraph\ \ * * *\ \ #### Was this page helpful?\ \ * [Overview](#overview)\ \ * [Setup](#setup)\ * [Jupyter Notebook](#jupyter-notebook)\ \ * [Installation](#installation)\ \ * [LangSmith](#langsmith)\ \ * [Quickstart](#quickstart)\ \ * [Message persistence](#message-persistence)\ \ * [Prompt templates](#prompt-templates)\ \ * [Managing Conversation History](#managing-conversation-history)\ \ * [Streaming](#streaming)\ \ * [Next Steps](#next-steps) --- # Anthropic | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/providers/anthropic.mdx) > [Anthropic](https://www.anthropic.com/) > is an AI safety and research company, and is the creator of `Claude`. This page covers all integrations between `Anthropic` models and `LangChain`. Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup") ------------------------------------------------------------------------------------------- To use `Anthropic` models, you need to install a python package: pip install -U langchain-anthropic You need to set the `ANTHROPIC_API_KEY` environment variable. You can get an Anthropic API key [here](https://console.anthropic.com/settings/keys) Chat Models[​](#chat-models "Direct link to Chat Models") ---------------------------------------------------------- ### ChatAnthropic[​](#chatanthropic "Direct link to ChatAnthropic") See a [usage example](/docs/integrations/chat/anthropic/) . from langchain_anthropic import ChatAnthropicmodel = ChatAnthropic(model='claude-3-opus-20240229') **API Reference:**[ChatAnthropic](https://python.langchain.com/api_reference/anthropic/chat_models/langchain_anthropic.chat_models.ChatAnthropic.html) LLMs[​](#llms "Direct link to LLMs") ------------------------------------- ### \[Legacy\] AnthropicLLM[​](#legacy-anthropicllm "Direct link to [Legacy] AnthropicLLM") **NOTE**: `AnthropicLLM` only supports legacy `Claude 2` models. To use the newest `Claude 3` models, please use `ChatAnthropic` instead. See a [usage example](/docs/integrations/llms/anthropic/) . from langchain_anthropic import AnthropicLLMmodel = AnthropicLLM(model='claude-2.1') **API Reference:**[AnthropicLLM](https://python.langchain.com/api_reference/anthropic/llms/langchain_anthropic.llms.AnthropicLLM.html) * * * #### Was this page helpful? * [Installation and Setup](#installation-and-setup) * [Chat Models](#chat-models) * [ChatAnthropic](#chatanthropic) * [LLMs](#llms) * [\[Legacy\] AnthropicLLM](#legacy-anthropicllm) --- # langchain: 0.3.13 β€” πŸ¦œπŸ”— LangChain documentation [Skip to main content](#main-content) Back to top Ctrl+K [Docs](https://python.langchain.com/) * [GitHub](https://github.com/langchain-ai/langchain "GitHub") * [X / Twitter](https://twitter.com/langchainai "X / Twitter") langchain: 0.3.13[#](#module-langchain "Link to this heading") =============================================================== Main entrypoint into package. [agents](agents.html#langchain-agents) [#](#langchain-agents "Link to this heading") ------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`agents.agent.AgentExecutor`](agents/langchain.agents.agent.AgentExecutor.html#langchain.agents.agent.AgentExecutor "langchain.agents.agent.AgentExecutor") | Agent that is using tools. | | [`agents.agent.AgentOutputParser`](agents/langchain.agents.agent.AgentOutputParser.html#langchain.agents.agent.AgentOutputParser "langchain.agents.agent.AgentOutputParser") | Base class for parsing agent output into agent action/finish. | | [`agents.agent.BaseMultiActionAgent`](agents/langchain.agents.agent.BaseMultiActionAgent.html#langchain.agents.agent.BaseMultiActionAgent "langchain.agents.agent.BaseMultiActionAgent") | Base Multi Action Agent class. | | [`agents.agent.BaseSingleActionAgent`](agents/langchain.agents.agent.BaseSingleActionAgent.html#langchain.agents.agent.BaseSingleActionAgent "langchain.agents.agent.BaseSingleActionAgent") | Base Single Action Agent class. | | [`agents.agent.ExceptionTool`](agents/langchain.agents.agent.ExceptionTool.html#langchain.agents.agent.ExceptionTool "langchain.agents.agent.ExceptionTool") | Tool that just returns the query. | | [`agents.agent.MultiActionAgentOutputParser`](agents/langchain.agents.agent.MultiActionAgentOutputParser.html#langchain.agents.agent.MultiActionAgentOutputParser "langchain.agents.agent.MultiActionAgentOutputParser") | Base class for parsing agent output into agent actions/finish. | | [`agents.agent.RunnableAgent`](agents/langchain.agents.agent.RunnableAgent.html#langchain.agents.agent.RunnableAgent "langchain.agents.agent.RunnableAgent") | Agent powered by Runnables. | | [`agents.agent.RunnableMultiActionAgent`](agents/langchain.agents.agent.RunnableMultiActionAgent.html#langchain.agents.agent.RunnableMultiActionAgent "langchain.agents.agent.RunnableMultiActionAgent") | Agent powered by Runnables. | | [`agents.agent_iterator.AgentExecutorIterator`](agents/langchain.agents.agent_iterator.AgentExecutorIterator.html#langchain.agents.agent_iterator.AgentExecutorIterator "langchain.agents.agent_iterator.AgentExecutorIterator")
(...) | Iterator for AgentExecutor. | | [`agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo`](agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo.html#langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo "langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreInfo") | Information about a VectorStore. | | [`agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit`](agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit.html#langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit "langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreRouterToolkit") | Toolkit for routing between Vector Stores. | | [`agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit`](agents/langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit.html#langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit "langchain.agents.agent_toolkits.vectorstore.toolkit.VectorStoreToolkit") | Toolkit for interacting with a Vector Store. | | [`agents.chat.output_parser.ChatOutputParser`](agents/langchain.agents.chat.output_parser.ChatOutputParser.html#langchain.agents.chat.output_parser.ChatOutputParser "langchain.agents.chat.output_parser.ChatOutputParser") | Output parser for the chat agent. | | [`agents.conversational.output_parser.ConvoOutputParser`](agents/langchain.agents.conversational.output_parser.ConvoOutputParser.html#langchain.agents.conversational.output_parser.ConvoOutputParser "langchain.agents.conversational.output_parser.ConvoOutputParser") | Output parser for the conversational agent. | | [`agents.conversational_chat.output_parser.ConvoOutputParser`](agents/langchain.agents.conversational_chat.output_parser.ConvoOutputParser.html#langchain.agents.conversational_chat.output_parser.ConvoOutputParser "langchain.agents.conversational_chat.output_parser.ConvoOutputParser") | Output parser for the conversational agent. | | [`agents.mrkl.base.ChainConfig`](agents/langchain.agents.mrkl.base.ChainConfig.html#langchain.agents.mrkl.base.ChainConfig "langchain.agents.mrkl.base.ChainConfig")
(action\_name,Β ...) | Configuration for a chain to use in MRKL system. | | [`agents.mrkl.output_parser.MRKLOutputParser`](agents/langchain.agents.mrkl.output_parser.MRKLOutputParser.html#langchain.agents.mrkl.output_parser.MRKLOutputParser "langchain.agents.mrkl.output_parser.MRKLOutputParser") | MRKL Output parser for the chat agent. | | [`agents.openai_assistant.base.OpenAIAssistantAction`](agents/langchain.agents.openai_assistant.base.OpenAIAssistantAction.html#langchain.agents.openai_assistant.base.OpenAIAssistantAction "langchain.agents.openai_assistant.base.OpenAIAssistantAction") | AgentAction with info needed to submit custom tool output to existing run. | | [`agents.openai_assistant.base.OpenAIAssistantFinish`](agents/langchain.agents.openai_assistant.base.OpenAIAssistantFinish.html#langchain.agents.openai_assistant.base.OpenAIAssistantFinish "langchain.agents.openai_assistant.base.OpenAIAssistantFinish") | AgentFinish with run and thread metadata. | | [`agents.openai_assistant.base.OpenAIAssistantRunnable`](agents/langchain.agents.openai_assistant.base.OpenAIAssistantRunnable.html#langchain.agents.openai_assistant.base.OpenAIAssistantRunnable "langchain.agents.openai_assistant.base.OpenAIAssistantRunnable") | Run an OpenAI Assistant. | | [`agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory`](agents/langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory.html#langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory "langchain.agents.openai_functions_agent.agent_token_buffer_memory.AgentTokenBufferMemory") | Memory used to save agent output AND intermediate steps. | | [`agents.output_parsers.json.JSONAgentOutputParser`](agents/langchain.agents.output_parsers.json.JSONAgentOutputParser.html#langchain.agents.output_parsers.json.JSONAgentOutputParser "langchain.agents.output_parsers.json.JSONAgentOutputParser") | Parses tool invocations and final answers in JSON format. | | [`agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser`](agents/langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser.html#langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser "langchain.agents.output_parsers.openai_functions.OpenAIFunctionsAgentOutputParser") | Parses a message into agent action/finish. | | [`agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser`](agents/langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser.html#langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser "langchain.agents.output_parsers.openai_tools.OpenAIToolsAgentOutputParser") | Parses a message into agent actions/finish. | | [`agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser`](agents/langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser.html#langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser "langchain.agents.output_parsers.react_json_single_input.ReActJsonSingleInputOutputParser") | Parses ReAct-style LLM calls that have a single tool input in json format. | | [`agents.output_parsers.react_single_input.ReActSingleInputOutputParser`](agents/langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser.html#langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser "langchain.agents.output_parsers.react_single_input.ReActSingleInputOutputParser") | Parses ReAct-style LLM calls that have a single tool input. | | [`agents.output_parsers.self_ask.SelfAskOutputParser`](agents/langchain.agents.output_parsers.self_ask.SelfAskOutputParser.html#langchain.agents.output_parsers.self_ask.SelfAskOutputParser "langchain.agents.output_parsers.self_ask.SelfAskOutputParser") | Parses self-ask style LLM calls. | | [`agents.output_parsers.tools.ToolAgentAction`](agents/langchain.agents.output_parsers.tools.ToolAgentAction.html#langchain.agents.output_parsers.tools.ToolAgentAction "langchain.agents.output_parsers.tools.ToolAgentAction") | | | [`agents.output_parsers.tools.ToolsAgentOutputParser`](agents/langchain.agents.output_parsers.tools.ToolsAgentOutputParser.html#langchain.agents.output_parsers.tools.ToolsAgentOutputParser "langchain.agents.output_parsers.tools.ToolsAgentOutputParser") | Parses a message into agent actions/finish. | | [`agents.output_parsers.xml.XMLAgentOutputParser`](agents/langchain.agents.output_parsers.xml.XMLAgentOutputParser.html#langchain.agents.output_parsers.xml.XMLAgentOutputParser "langchain.agents.output_parsers.xml.XMLAgentOutputParser") | Parses tool invocations and final answers in XML format. | | [`agents.react.output_parser.ReActOutputParser`](agents/langchain.agents.react.output_parser.ReActOutputParser.html#langchain.agents.react.output_parser.ReActOutputParser "langchain.agents.react.output_parser.ReActOutputParser") | Output parser for the ReAct agent. | | [`agents.schema.AgentScratchPadChatPromptTemplate`](agents/langchain.agents.schema.AgentScratchPadChatPromptTemplate.html#langchain.agents.schema.AgentScratchPadChatPromptTemplate "langchain.agents.schema.AgentScratchPadChatPromptTemplate") | Chat prompt template for the agent scratchpad. | | [`agents.structured_chat.output_parser.StructuredChatOutputParser`](agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParser.html#langchain.agents.structured_chat.output_parser.StructuredChatOutputParser "langchain.agents.structured_chat.output_parser.StructuredChatOutputParser") | Output parser for the structured chat agent. | | [`agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries`](agents/langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries.html#langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries "langchain.agents.structured_chat.output_parser.StructuredChatOutputParserWithRetries") | Output parser with retries for the structured chat agent. | | [`agents.tools.InvalidTool`](agents/langchain.agents.tools.InvalidTool.html#langchain.agents.tools.InvalidTool "langchain.agents.tools.InvalidTool") | Tool that is run when invalid tool name is encountered by agent. | **Functions** | | | | --- | --- | | [`agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent`](agents/langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent.html#langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent "langchain.agents.agent_toolkits.conversational_retrieval.openai_functions.create_conversational_retrieval_agent")
(...) | A convenience method for creating a conversational retrieval agent. | | [`agents.format_scratchpad.log.format_log_to_str`](agents/langchain.agents.format_scratchpad.log.format_log_to_str.html#langchain.agents.format_scratchpad.log.format_log_to_str "langchain.agents.format_scratchpad.log.format_log_to_str")
(...) | Construct the scratchpad that lets the agent continue its thought process. | | [`agents.format_scratchpad.log_to_messages.format_log_to_messages`](agents/langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages.html#langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages "langchain.agents.format_scratchpad.log_to_messages.format_log_to_messages")
(...) | Construct the scratchpad that lets the agent continue its thought process. | | [`agents.format_scratchpad.openai_functions.format_to_openai_function_messages`](agents/langchain.agents.format_scratchpad.openai_functions.format_to_openai_function_messages.html#langchain.agents.format_scratchpad.openai_functions.format_to_openai_function_messages "langchain.agents.format_scratchpad.openai_functions.format_to_openai_function_messages")
(...) | Convert (AgentAction, tool output) tuples into FunctionMessages. | | [`agents.format_scratchpad.openai_functions.format_to_openai_functions`](agents/langchain.agents.format_scratchpad.openai_functions.format_to_openai_functions.html#langchain.agents.format_scratchpad.openai_functions.format_to_openai_functions "langchain.agents.format_scratchpad.openai_functions.format_to_openai_functions")
(...) | Convert (AgentAction, tool output) tuples into FunctionMessages. | | [`agents.format_scratchpad.tools.format_to_tool_messages`](agents/langchain.agents.format_scratchpad.tools.format_to_tool_messages.html#langchain.agents.format_scratchpad.tools.format_to_tool_messages "langchain.agents.format_scratchpad.tools.format_to_tool_messages")
(...) | Convert (AgentAction, tool output) tuples into ToolMessages. | | [`agents.format_scratchpad.xml.format_xml`](agents/langchain.agents.format_scratchpad.xml.format_xml.html#langchain.agents.format_scratchpad.xml.format_xml "langchain.agents.format_scratchpad.xml.format_xml")
(...) | Format the intermediate steps as XML. | | [`agents.json_chat.base.create_json_chat_agent`](agents/langchain.agents.json_chat.base.create_json_chat_agent.html#langchain.agents.json_chat.base.create_json_chat_agent "langchain.agents.json_chat.base.create_json_chat_agent")
(...) | Create an agent that uses JSON to format its logic, build for Chat Models. | | [`agents.openai_functions_agent.base.create_openai_functions_agent`](agents/langchain.agents.openai_functions_agent.base.create_openai_functions_agent.html#langchain.agents.openai_functions_agent.base.create_openai_functions_agent "langchain.agents.openai_functions_agent.base.create_openai_functions_agent")
(...) | Create an agent that uses OpenAI function calling. | | [`agents.openai_tools.base.create_openai_tools_agent`](agents/langchain.agents.openai_tools.base.create_openai_tools_agent.html#langchain.agents.openai_tools.base.create_openai_tools_agent "langchain.agents.openai_tools.base.create_openai_tools_agent")
(...) | Create an agent that uses OpenAI tools. | | [`agents.output_parsers.openai_tools.parse_ai_message_to_openai_tool_action`](agents/langchain.agents.output_parsers.openai_tools.parse_ai_message_to_openai_tool_action.html#langchain.agents.output_parsers.openai_tools.parse_ai_message_to_openai_tool_action "langchain.agents.output_parsers.openai_tools.parse_ai_message_to_openai_tool_action")
(message) | Parse an AI message potentially containing tool\_calls. | | [`agents.output_parsers.tools.parse_ai_message_to_tool_action`](agents/langchain.agents.output_parsers.tools.parse_ai_message_to_tool_action.html#langchain.agents.output_parsers.tools.parse_ai_message_to_tool_action "langchain.agents.output_parsers.tools.parse_ai_message_to_tool_action")
(message) | Parse an AI message potentially containing tool\_calls. | | [`agents.react.agent.create_react_agent`](agents/langchain.agents.react.agent.create_react_agent.html#langchain.agents.react.agent.create_react_agent "langchain.agents.react.agent.create_react_agent")
(llm,Β ...) | Create an agent that uses ReAct prompting. | | [`agents.self_ask_with_search.base.create_self_ask_with_search_agent`](agents/langchain.agents.self_ask_with_search.base.create_self_ask_with_search_agent.html#langchain.agents.self_ask_with_search.base.create_self_ask_with_search_agent "langchain.agents.self_ask_with_search.base.create_self_ask_with_search_agent")
(...) | Create an agent that uses self-ask with search prompting. | | [`agents.structured_chat.base.create_structured_chat_agent`](agents/langchain.agents.structured_chat.base.create_structured_chat_agent.html#langchain.agents.structured_chat.base.create_structured_chat_agent "langchain.agents.structured_chat.base.create_structured_chat_agent")
(...) | Create an agent aimed at supporting tools with multiple inputs. | | [`agents.tool_calling_agent.base.create_tool_calling_agent`](agents/langchain.agents.tool_calling_agent.base.create_tool_calling_agent.html#langchain.agents.tool_calling_agent.base.create_tool_calling_agent "langchain.agents.tool_calling_agent.base.create_tool_calling_agent")
(...) | Create an agent that uses tools. | | [`agents.utils.validate_tools_single_input`](agents/langchain.agents.utils.validate_tools_single_input.html#langchain.agents.utils.validate_tools_single_input "langchain.agents.utils.validate_tools_single_input")
(...) | Validate tools for single input. | | [`agents.xml.base.create_xml_agent`](agents/langchain.agents.xml.base.create_xml_agent.html#langchain.agents.xml.base.create_xml_agent "langchain.agents.xml.base.create_xml_agent")
(llm,Β tools,Β ...) | Create an agent that uses XML to format its logic. | **Deprecated classes** | | | | --- | --- | | [`agents.agent.Agent`](agents/langchain.agents.agent.Agent.html#langchain.agents.agent.Agent "langchain.agents.agent.Agent") | | | [`agents.agent.LLMSingleActionAgent`](agents/langchain.agents.agent.LLMSingleActionAgent.html#langchain.agents.agent.LLMSingleActionAgent "langchain.agents.agent.LLMSingleActionAgent") | | | [`agents.agent_types.AgentType`](agents/langchain.agents.agent_types.AgentType.html#langchain.agents.agent_types.AgentType "langchain.agents.agent_types.AgentType")
(value\[,Β names,Β ...\]) | | | [`agents.chat.base.ChatAgent`](agents/langchain.agents.chat.base.ChatAgent.html#langchain.agents.chat.base.ChatAgent "langchain.agents.chat.base.ChatAgent") | | | [`agents.conversational.base.ConversationalAgent`](agents/langchain.agents.conversational.base.ConversationalAgent.html#langchain.agents.conversational.base.ConversationalAgent "langchain.agents.conversational.base.ConversationalAgent") | | | [`agents.conversational_chat.base.ConversationalChatAgent`](agents/langchain.agents.conversational_chat.base.ConversationalChatAgent.html#langchain.agents.conversational_chat.base.ConversationalChatAgent "langchain.agents.conversational_chat.base.ConversationalChatAgent") | | | [`agents.mrkl.base.MRKLChain`](agents/langchain.agents.mrkl.base.MRKLChain.html#langchain.agents.mrkl.base.MRKLChain "langchain.agents.mrkl.base.MRKLChain") | | | [`agents.mrkl.base.ZeroShotAgent`](agents/langchain.agents.mrkl.base.ZeroShotAgent.html#langchain.agents.mrkl.base.ZeroShotAgent "langchain.agents.mrkl.base.ZeroShotAgent") | | | [`agents.openai_functions_agent.base.OpenAIFunctionsAgent`](agents/langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent.html#langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent "langchain.agents.openai_functions_agent.base.OpenAIFunctionsAgent") | | | [`agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent`](agents/langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent.html#langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent "langchain.agents.openai_functions_multi_agent.base.OpenAIMultiFunctionsAgent") | | | [`agents.react.base.DocstoreExplorer`](agents/langchain.agents.react.base.DocstoreExplorer.html#langchain.agents.react.base.DocstoreExplorer "langchain.agents.react.base.DocstoreExplorer")
(docstore) | | | [`agents.react.base.ReActChain`](agents/langchain.agents.react.base.ReActChain.html#langchain.agents.react.base.ReActChain "langchain.agents.react.base.ReActChain") | | | [`agents.react.base.ReActDocstoreAgent`](agents/langchain.agents.react.base.ReActDocstoreAgent.html#langchain.agents.react.base.ReActDocstoreAgent "langchain.agents.react.base.ReActDocstoreAgent") | | | [`agents.react.base.ReActTextWorldAgent`](agents/langchain.agents.react.base.ReActTextWorldAgent.html#langchain.agents.react.base.ReActTextWorldAgent "langchain.agents.react.base.ReActTextWorldAgent") | | | [`agents.self_ask_with_search.base.SelfAskWithSearchAgent`](agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent.html#langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent "langchain.agents.self_ask_with_search.base.SelfAskWithSearchAgent") | | | [`agents.self_ask_with_search.base.SelfAskWithSearchChain`](agents/langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain.html#langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain "langchain.agents.self_ask_with_search.base.SelfAskWithSearchChain") | | | [`agents.structured_chat.base.StructuredChatAgent`](agents/langchain.agents.structured_chat.base.StructuredChatAgent.html#langchain.agents.structured_chat.base.StructuredChatAgent "langchain.agents.structured_chat.base.StructuredChatAgent") | | | [`agents.xml.base.XMLAgent`](agents/langchain.agents.xml.base.XMLAgent.html#langchain.agents.xml.base.XMLAgent "langchain.agents.xml.base.XMLAgent") | | **Deprecated functions** | | | | --- | --- | | [`agents.agent_toolkits.vectorstore.base.create_vectorstore_agent`](agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent.html#langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent "langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_agent")
(...) | | | [`agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent`](agents/langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent.html#langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent "langchain.agents.agent_toolkits.vectorstore.base.create_vectorstore_router_agent")
(...) | | | [`agents.initialize.initialize_agent`](agents/langchain.agents.initialize.initialize_agent.html#langchain.agents.initialize.initialize_agent "langchain.agents.initialize.initialize_agent")
(tools,Β llm) | | | [`agents.loading.load_agent`](agents/langchain.agents.loading.load_agent.html#langchain.agents.loading.load_agent "langchain.agents.loading.load_agent")
(path,Β \*\*kwargs) | | | [`agents.loading.load_agent_from_config`](agents/langchain.agents.loading.load_agent_from_config.html#langchain.agents.loading.load_agent_from_config "langchain.agents.loading.load_agent_from_config")
(config) | | [callbacks](callbacks.html#langchain-callbacks) [#](#langchain-callbacks "Link to this heading") ------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`callbacks.streaming_aiter.AsyncIteratorCallbackHandler`](callbacks/langchain.callbacks.streaming_aiter.AsyncIteratorCallbackHandler.html#langchain.callbacks.streaming_aiter.AsyncIteratorCallbackHandler "langchain.callbacks.streaming_aiter.AsyncIteratorCallbackHandler")
() | Callback handler that returns an async iterator. | | [`callbacks.streaming_aiter_final_only.AsyncFinalIteratorCallbackHandler`](callbacks/langchain.callbacks.streaming_aiter_final_only.AsyncFinalIteratorCallbackHandler.html#langchain.callbacks.streaming_aiter_final_only.AsyncFinalIteratorCallbackHandler "langchain.callbacks.streaming_aiter_final_only.AsyncFinalIteratorCallbackHandler")
(\*) | Callback handler that returns an async iterator. | | [`callbacks.streaming_stdout_final_only.FinalStreamingStdOutCallbackHandler`](callbacks/langchain.callbacks.streaming_stdout_final_only.FinalStreamingStdOutCallbackHandler.html#langchain.callbacks.streaming_stdout_final_only.FinalStreamingStdOutCallbackHandler "langchain.callbacks.streaming_stdout_final_only.FinalStreamingStdOutCallbackHandler")
(\*) | Callback handler for streaming in agents. | | [`callbacks.tracers.logging.LoggingCallbackHandler`](callbacks/langchain.callbacks.tracers.logging.LoggingCallbackHandler.html#langchain.callbacks.tracers.logging.LoggingCallbackHandler "langchain.callbacks.tracers.logging.LoggingCallbackHandler")
(logger) | Tracer that logs via the input Logger. | [chains](chains.html#langchain-chains) [#](#langchain-chains "Link to this heading") ------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`chains.base.Chain`](chains/langchain.chains.base.Chain.html#langchain.chains.base.Chain "langchain.chains.base.Chain") | Abstract base class for creating structured sequences of calls to components. | | [`chains.combine_documents.base.BaseCombineDocumentsChain`](chains/langchain.chains.combine_documents.base.BaseCombineDocumentsChain.html#langchain.chains.combine_documents.base.BaseCombineDocumentsChain "langchain.chains.combine_documents.base.BaseCombineDocumentsChain") | Base interface for chains combining documents. | | [`chains.combine_documents.reduce.AsyncCombineDocsProtocol`](chains/langchain.chains.combine_documents.reduce.AsyncCombineDocsProtocol.html#langchain.chains.combine_documents.reduce.AsyncCombineDocsProtocol "langchain.chains.combine_documents.reduce.AsyncCombineDocsProtocol")
(...) | Interface for the combine\_docs method. | | [`chains.combine_documents.reduce.CombineDocsProtocol`](chains/langchain.chains.combine_documents.reduce.CombineDocsProtocol.html#langchain.chains.combine_documents.reduce.CombineDocsProtocol "langchain.chains.combine_documents.reduce.CombineDocsProtocol")
(...) | Interface for the combine\_docs method. | | [`chains.constitutional_ai.models.ConstitutionalPrinciple`](chains/langchain.chains.constitutional_ai.models.ConstitutionalPrinciple.html#langchain.chains.constitutional_ai.models.ConstitutionalPrinciple "langchain.chains.constitutional_ai.models.ConstitutionalPrinciple") | Class for a constitutional principle. | | [`chains.conversational_retrieval.base.BaseConversationalRetrievalChain`](chains/langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain.html#langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain "langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain") | Chain for chatting with an index. | | [`chains.conversational_retrieval.base.ChatVectorDBChain`](chains/langchain.chains.conversational_retrieval.base.ChatVectorDBChain.html#langchain.chains.conversational_retrieval.base.ChatVectorDBChain "langchain.chains.conversational_retrieval.base.ChatVectorDBChain") | Chain for chatting with a vector database. | | [`chains.conversational_retrieval.base.InputType`](chains/langchain.chains.conversational_retrieval.base.InputType.html#langchain.chains.conversational_retrieval.base.InputType "langchain.chains.conversational_retrieval.base.InputType") | Input type for ConversationalRetrievalChain. | | [`chains.elasticsearch_database.base.ElasticsearchDatabaseChain`](chains/langchain.chains.elasticsearch_database.base.ElasticsearchDatabaseChain.html#langchain.chains.elasticsearch_database.base.ElasticsearchDatabaseChain "langchain.chains.elasticsearch_database.base.ElasticsearchDatabaseChain") | Chain for interacting with Elasticsearch Database. | | [`chains.flare.base.FlareChain`](chains/langchain.chains.flare.base.FlareChain.html#langchain.chains.flare.base.FlareChain "langchain.chains.flare.base.FlareChain") | Chain that combines a retriever, a question generator, and a response generator. | | [`chains.flare.base.QuestionGeneratorChain`](chains/langchain.chains.flare.base.QuestionGeneratorChain.html#langchain.chains.flare.base.QuestionGeneratorChain "langchain.chains.flare.base.QuestionGeneratorChain") | Chain that generates questions from uncertain spans. | | [`chains.flare.prompts.FinishedOutputParser`](chains/langchain.chains.flare.prompts.FinishedOutputParser.html#langchain.chains.flare.prompts.FinishedOutputParser "langchain.chains.flare.prompts.FinishedOutputParser") | Output parser that checks if the output is finished. | | [`chains.hyde.base.HypotheticalDocumentEmbedder`](chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html#langchain.chains.hyde.base.HypotheticalDocumentEmbedder "langchain.chains.hyde.base.HypotheticalDocumentEmbedder") | Generate hypothetical document for query, and then embed that. | | [`chains.moderation.OpenAIModerationChain`](chains/langchain.chains.moderation.OpenAIModerationChain.html#langchain.chains.moderation.OpenAIModerationChain "langchain.chains.moderation.OpenAIModerationChain") | Pass input through a moderation endpoint. | | [`chains.natbot.crawler.Crawler`](chains/langchain.chains.natbot.crawler.Crawler.html#langchain.chains.natbot.crawler.Crawler "langchain.chains.natbot.crawler.Crawler")
() | A crawler for web pages. | | [`chains.natbot.crawler.ElementInViewPort`](chains/langchain.chains.natbot.crawler.ElementInViewPort.html#langchain.chains.natbot.crawler.ElementInViewPort "langchain.chains.natbot.crawler.ElementInViewPort") | A typed dictionary containing information about elements in the viewport. | | [`chains.openai_functions.citation_fuzzy_match.FactWithEvidence`](chains/langchain.chains.openai_functions.citation_fuzzy_match.FactWithEvidence.html#langchain.chains.openai_functions.citation_fuzzy_match.FactWithEvidence "langchain.chains.openai_functions.citation_fuzzy_match.FactWithEvidence") | Class representing a single statement. | | [`chains.openai_functions.citation_fuzzy_match.QuestionAnswer`](chains/langchain.chains.openai_functions.citation_fuzzy_match.QuestionAnswer.html#langchain.chains.openai_functions.citation_fuzzy_match.QuestionAnswer "langchain.chains.openai_functions.citation_fuzzy_match.QuestionAnswer") | A question and its answer as a list of facts each one should have a source. | | [`chains.openai_functions.openapi.SimpleRequestChain`](chains/langchain.chains.openai_functions.openapi.SimpleRequestChain.html#langchain.chains.openai_functions.openapi.SimpleRequestChain "langchain.chains.openai_functions.openapi.SimpleRequestChain") | Chain for making a simple request to an API endpoint. | | [`chains.openai_functions.qa_with_structure.AnswerWithSources`](chains/langchain.chains.openai_functions.qa_with_structure.AnswerWithSources.html#langchain.chains.openai_functions.qa_with_structure.AnswerWithSources "langchain.chains.openai_functions.qa_with_structure.AnswerWithSources") | An answer to the question, with sources. | | [`chains.prompt_selector.BasePromptSelector`](chains/langchain.chains.prompt_selector.BasePromptSelector.html#langchain.chains.prompt_selector.BasePromptSelector "langchain.chains.prompt_selector.BasePromptSelector") | Base class for prompt selectors. | | [`chains.prompt_selector.ConditionalPromptSelector`](chains/langchain.chains.prompt_selector.ConditionalPromptSelector.html#langchain.chains.prompt_selector.ConditionalPromptSelector "langchain.chains.prompt_selector.ConditionalPromptSelector") | Prompt collection that goes through conditionals. | | [`chains.qa_with_sources.loading.LoadingCallable`](chains/langchain.chains.qa_with_sources.loading.LoadingCallable.html#langchain.chains.qa_with_sources.loading.LoadingCallable "langchain.chains.qa_with_sources.loading.LoadingCallable")
(...) | Interface for loading the combine documents chain. | | [`chains.qa_with_sources.retrieval.RetrievalQAWithSourcesChain`](chains/langchain.chains.qa_with_sources.retrieval.RetrievalQAWithSourcesChain.html#langchain.chains.qa_with_sources.retrieval.RetrievalQAWithSourcesChain "langchain.chains.qa_with_sources.retrieval.RetrievalQAWithSourcesChain") | Question-answering with sources over an index. | | [`chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain`](chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html#langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain "langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain") | Question-answering with sources over a vector database. | | [`chains.query_constructor.base.StructuredQueryOutputParser`](chains/langchain.chains.query_constructor.base.StructuredQueryOutputParser.html#langchain.chains.query_constructor.base.StructuredQueryOutputParser "langchain.chains.query_constructor.base.StructuredQueryOutputParser") | Output parser that parses a structured query. | | [`chains.query_constructor.parser.ISO8601Date`](chains/langchain.chains.query_constructor.parser.ISO8601Date.html#langchain.chains.query_constructor.parser.ISO8601Date "langchain.chains.query_constructor.parser.ISO8601Date") | A date in ISO 8601 format (YYYY-MM-DD). | | [`chains.query_constructor.parser.ISO8601DateTime`](chains/langchain.chains.query_constructor.parser.ISO8601DateTime.html#langchain.chains.query_constructor.parser.ISO8601DateTime "langchain.chains.query_constructor.parser.ISO8601DateTime") | A datetime in ISO 8601 format (YYYY-MM-DDTHH:MM:SS). | | [`chains.query_constructor.schema.AttributeInfo`](chains/langchain.chains.query_constructor.schema.AttributeInfo.html#langchain.chains.query_constructor.schema.AttributeInfo "langchain.chains.query_constructor.schema.AttributeInfo") | Information about a data source attribute. | | [`chains.question_answering.chain.LoadingCallable`](chains/langchain.chains.question_answering.chain.LoadingCallable.html#langchain.chains.question_answering.chain.LoadingCallable "langchain.chains.question_answering.chain.LoadingCallable")
(...) | Interface for loading the combine documents chain. | | [`chains.router.base.MultiRouteChain`](chains/langchain.chains.router.base.MultiRouteChain.html#langchain.chains.router.base.MultiRouteChain "langchain.chains.router.base.MultiRouteChain") | Use a single chain to route an input to one of multiple candidate chains. | | [`chains.router.base.Route`](chains/langchain.chains.router.base.Route.html#langchain.chains.router.base.Route "langchain.chains.router.base.Route")
(destination,Β ...) | Create new instance of Route(destination, next\_inputs) | | [`chains.router.base.RouterChain`](chains/langchain.chains.router.base.RouterChain.html#langchain.chains.router.base.RouterChain "langchain.chains.router.base.RouterChain") | Chain that outputs the name of a destination chain and the inputs to it. | | [`chains.router.embedding_router.EmbeddingRouterChain`](chains/langchain.chains.router.embedding_router.EmbeddingRouterChain.html#langchain.chains.router.embedding_router.EmbeddingRouterChain "langchain.chains.router.embedding_router.EmbeddingRouterChain") | Chain that uses embeddings to route between options. | | [`chains.router.llm_router.RouterOutputParser`](chains/langchain.chains.router.llm_router.RouterOutputParser.html#langchain.chains.router.llm_router.RouterOutputParser "langchain.chains.router.llm_router.RouterOutputParser") | Parser for output of router chain in the multi-prompt chain. | | [`chains.router.multi_retrieval_qa.MultiRetrievalQAChain`](chains/langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain.html#langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain "langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain") | A multi-route chain that uses an LLM router chain to choose amongst retrieval qa chains. | | [`chains.sequential.SequentialChain`](chains/langchain.chains.sequential.SequentialChain.html#langchain.chains.sequential.SequentialChain "langchain.chains.sequential.SequentialChain") | Chain where the outputs of one chain feed directly into next. | | [`chains.sequential.SimpleSequentialChain`](chains/langchain.chains.sequential.SimpleSequentialChain.html#langchain.chains.sequential.SimpleSequentialChain "langchain.chains.sequential.SimpleSequentialChain") | Simple chain where the outputs of one step feed directly into next. | | [`chains.sql_database.query.SQLInput`](chains/langchain.chains.sql_database.query.SQLInput.html#langchain.chains.sql_database.query.SQLInput "langchain.chains.sql_database.query.SQLInput") | Input for a SQL Chain. | | [`chains.sql_database.query.SQLInputWithTables`](chains/langchain.chains.sql_database.query.SQLInputWithTables.html#langchain.chains.sql_database.query.SQLInputWithTables "langchain.chains.sql_database.query.SQLInputWithTables") | Input for a SQL Chain. | | [`chains.summarize.chain.LoadingCallable`](chains/langchain.chains.summarize.chain.LoadingCallable.html#langchain.chains.summarize.chain.LoadingCallable "langchain.chains.summarize.chain.LoadingCallable")
(...) | Interface for loading the combine documents chain. | | [`chains.transform.TransformChain`](chains/langchain.chains.transform.TransformChain.html#langchain.chains.transform.TransformChain "langchain.chains.transform.TransformChain") | Chain that transforms the chain output. | **Functions** | | | | --- | --- | | [`chains.combine_documents.reduce.acollapse_docs`](chains/langchain.chains.combine_documents.reduce.acollapse_docs.html#langchain.chains.combine_documents.reduce.acollapse_docs "langchain.chains.combine_documents.reduce.acollapse_docs")
(...) | Execute a collapse function on a set of documents and merge their metadatas. | | [`chains.combine_documents.reduce.collapse_docs`](chains/langchain.chains.combine_documents.reduce.collapse_docs.html#langchain.chains.combine_documents.reduce.collapse_docs "langchain.chains.combine_documents.reduce.collapse_docs")
(...) | Execute a collapse function on a set of documents and merge their metadatas. | | [`chains.combine_documents.reduce.split_list_of_docs`](chains/langchain.chains.combine_documents.reduce.split_list_of_docs.html#langchain.chains.combine_documents.reduce.split_list_of_docs "langchain.chains.combine_documents.reduce.split_list_of_docs")
(...) | Split Documents into subsets that each meet a cumulative length constraint. | | [`chains.combine_documents.stuff.create_stuff_documents_chain`](chains/langchain.chains.combine_documents.stuff.create_stuff_documents_chain.html#langchain.chains.combine_documents.stuff.create_stuff_documents_chain "langchain.chains.combine_documents.stuff.create_stuff_documents_chain")
(...) | Create a chain for passing a list of Documents to a model. | | [`chains.example_generator.generate_example`](chains/langchain.chains.example_generator.generate_example.html#langchain.chains.example_generator.generate_example "langchain.chains.example_generator.generate_example")
(...) | Return another example given a list of examples for a prompt. | | [`chains.history_aware_retriever.create_history_aware_retriever`](chains/langchain.chains.history_aware_retriever.create_history_aware_retriever.html#langchain.chains.history_aware_retriever.create_history_aware_retriever "langchain.chains.history_aware_retriever.create_history_aware_retriever")
(...) | Create a chain that takes conversation history and returns documents. | | [`chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_runnable`](chains/langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_runnable.html#langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_runnable "langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_runnable")
(llm) | Create a citation fuzzy match Runnable. | | [`chains.openai_functions.openapi.openapi_spec_to_openai_fn`](chains/langchain.chains.openai_functions.openapi.openapi_spec_to_openai_fn.html#langchain.chains.openai_functions.openapi.openapi_spec_to_openai_fn "langchain.chains.openai_functions.openapi.openapi_spec_to_openai_fn")
(spec) | Convert a valid OpenAPI spec to the JSON Schema format expected for OpenAI | | [`chains.openai_functions.utils.get_llm_kwargs`](chains/langchain.chains.openai_functions.utils.get_llm_kwargs.html#langchain.chains.openai_functions.utils.get_llm_kwargs "langchain.chains.openai_functions.utils.get_llm_kwargs")
(...) | Return the kwargs for the LLMChain constructor. | | [`chains.prompt_selector.is_chat_model`](chains/langchain.chains.prompt_selector.is_chat_model.html#langchain.chains.prompt_selector.is_chat_model "langchain.chains.prompt_selector.is_chat_model")
(llm) | Check if the language model is a chat model. | | [`chains.prompt_selector.is_llm`](chains/langchain.chains.prompt_selector.is_llm.html#langchain.chains.prompt_selector.is_llm "langchain.chains.prompt_selector.is_llm")
(llm) | Check if the language model is a LLM. | | [`chains.query_constructor.base.construct_examples`](chains/langchain.chains.query_constructor.base.construct_examples.html#langchain.chains.query_constructor.base.construct_examples "langchain.chains.query_constructor.base.construct_examples")
(...) | Construct examples from input-output pairs. | | [`chains.query_constructor.base.fix_filter_directive`](chains/langchain.chains.query_constructor.base.fix_filter_directive.html#langchain.chains.query_constructor.base.fix_filter_directive "langchain.chains.query_constructor.base.fix_filter_directive")
(...) | Fix invalid filter directive. | | [`chains.query_constructor.base.get_query_constructor_prompt`](chains/langchain.chains.query_constructor.base.get_query_constructor_prompt.html#langchain.chains.query_constructor.base.get_query_constructor_prompt "langchain.chains.query_constructor.base.get_query_constructor_prompt")
(...) | Create query construction prompt. | | [`chains.query_constructor.base.load_query_constructor_runnable`](chains/langchain.chains.query_constructor.base.load_query_constructor_runnable.html#langchain.chains.query_constructor.base.load_query_constructor_runnable "langchain.chains.query_constructor.base.load_query_constructor_runnable")
(...) | Load a query constructor runnable chain. | | [`chains.query_constructor.parser.get_parser`](chains/langchain.chains.query_constructor.parser.get_parser.html#langchain.chains.query_constructor.parser.get_parser "langchain.chains.query_constructor.parser.get_parser")
(\[...\]) | Return a parser for the query language. | | [`chains.query_constructor.parser.v_args`](chains/langchain.chains.query_constructor.parser.v_args.html#langchain.chains.query_constructor.parser.v_args "langchain.chains.query_constructor.parser.v_args")
(...) | Dummy decorator for when lark is not installed. | | [`chains.retrieval.create_retrieval_chain`](chains/langchain.chains.retrieval.create_retrieval_chain.html#langchain.chains.retrieval.create_retrieval_chain "langchain.chains.retrieval.create_retrieval_chain")
(...) | Create retrieval chain that retrieves documents and then passes them on. | | [`chains.sql_database.query.create_sql_query_chain`](chains/langchain.chains.sql_database.query.create_sql_query_chain.html#langchain.chains.sql_database.query.create_sql_query_chain "langchain.chains.sql_database.query.create_sql_query_chain")
(llm,Β db) | Create a chain that generates SQL queries. | | [`chains.structured_output.base.get_openai_output_parser`](chains/langchain.chains.structured_output.base.get_openai_output_parser.html#langchain.chains.structured_output.base.get_openai_output_parser "langchain.chains.structured_output.base.get_openai_output_parser")
(...) | Get the appropriate function output parser given the user functions. | | [`chains.summarize.chain.load_summarize_chain`](chains/langchain.chains.summarize.chain.load_summarize_chain.html#langchain.chains.summarize.chain.load_summarize_chain "langchain.chains.summarize.chain.load_summarize_chain")
(llm) | Load summarizing chain. | **Deprecated classes** | | | | --- | --- | | [`chains.api.base.APIChain`](chains/langchain.chains.api.base.APIChain.html#langchain.chains.api.base.APIChain "langchain.chains.api.base.APIChain") | | | [`chains.combine_documents.base.AnalyzeDocumentChain`](chains/langchain.chains.combine_documents.base.AnalyzeDocumentChain.html#langchain.chains.combine_documents.base.AnalyzeDocumentChain "langchain.chains.combine_documents.base.AnalyzeDocumentChain") | | | [`chains.combine_documents.map_reduce.MapReduceDocumentsChain`](chains/langchain.chains.combine_documents.map_reduce.MapReduceDocumentsChain.html#langchain.chains.combine_documents.map_reduce.MapReduceDocumentsChain "langchain.chains.combine_documents.map_reduce.MapReduceDocumentsChain") | | | [`chains.combine_documents.map_rerank.MapRerankDocumentsChain`](chains/langchain.chains.combine_documents.map_rerank.MapRerankDocumentsChain.html#langchain.chains.combine_documents.map_rerank.MapRerankDocumentsChain "langchain.chains.combine_documents.map_rerank.MapRerankDocumentsChain") | | | [`chains.combine_documents.reduce.ReduceDocumentsChain`](chains/langchain.chains.combine_documents.reduce.ReduceDocumentsChain.html#langchain.chains.combine_documents.reduce.ReduceDocumentsChain "langchain.chains.combine_documents.reduce.ReduceDocumentsChain") | | | [`chains.combine_documents.refine.RefineDocumentsChain`](chains/langchain.chains.combine_documents.refine.RefineDocumentsChain.html#langchain.chains.combine_documents.refine.RefineDocumentsChain "langchain.chains.combine_documents.refine.RefineDocumentsChain") | | | [`chains.combine_documents.stuff.StuffDocumentsChain`](chains/langchain.chains.combine_documents.stuff.StuffDocumentsChain.html#langchain.chains.combine_documents.stuff.StuffDocumentsChain "langchain.chains.combine_documents.stuff.StuffDocumentsChain") | | | [`chains.constitutional_ai.base.ConstitutionalChain`](chains/langchain.chains.constitutional_ai.base.ConstitutionalChain.html#langchain.chains.constitutional_ai.base.ConstitutionalChain "langchain.chains.constitutional_ai.base.ConstitutionalChain") | | | [`chains.conversation.base.ConversationChain`](chains/langchain.chains.conversation.base.ConversationChain.html#langchain.chains.conversation.base.ConversationChain "langchain.chains.conversation.base.ConversationChain") | | | [`chains.conversational_retrieval.base.ConversationalRetrievalChain`](chains/langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain.html#langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain "langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain") | | | [`chains.llm.LLMChain`](chains/langchain.chains.llm.LLMChain.html#langchain.chains.llm.LLMChain "langchain.chains.llm.LLMChain") | | | [`chains.llm_checker.base.LLMCheckerChain`](chains/langchain.chains.llm_checker.base.LLMCheckerChain.html#langchain.chains.llm_checker.base.LLMCheckerChain "langchain.chains.llm_checker.base.LLMCheckerChain") | | | [`chains.llm_math.base.LLMMathChain`](chains/langchain.chains.llm_math.base.LLMMathChain.html#langchain.chains.llm_math.base.LLMMathChain "langchain.chains.llm_math.base.LLMMathChain") | | | [`chains.llm_summarization_checker.base.LLMSummarizationCheckerChain`](chains/langchain.chains.llm_summarization_checker.base.LLMSummarizationCheckerChain.html#langchain.chains.llm_summarization_checker.base.LLMSummarizationCheckerChain "langchain.chains.llm_summarization_checker.base.LLMSummarizationCheckerChain") | | | [`chains.mapreduce.MapReduceChain`](chains/langchain.chains.mapreduce.MapReduceChain.html#langchain.chains.mapreduce.MapReduceChain "langchain.chains.mapreduce.MapReduceChain") | | | [`chains.natbot.base.NatBotChain`](chains/langchain.chains.natbot.base.NatBotChain.html#langchain.chains.natbot.base.NatBotChain "langchain.chains.natbot.base.NatBotChain") | | | [`chains.qa_generation.base.QAGenerationChain`](chains/langchain.chains.qa_generation.base.QAGenerationChain.html#langchain.chains.qa_generation.base.QAGenerationChain "langchain.chains.qa_generation.base.QAGenerationChain") | | | [`chains.qa_with_sources.base.BaseQAWithSourcesChain`](chains/langchain.chains.qa_with_sources.base.BaseQAWithSourcesChain.html#langchain.chains.qa_with_sources.base.BaseQAWithSourcesChain "langchain.chains.qa_with_sources.base.BaseQAWithSourcesChain") | | | [`chains.qa_with_sources.base.QAWithSourcesChain`](chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html#langchain.chains.qa_with_sources.base.QAWithSourcesChain "langchain.chains.qa_with_sources.base.QAWithSourcesChain") | | | [`chains.retrieval_qa.base.BaseRetrievalQA`](chains/langchain.chains.retrieval_qa.base.BaseRetrievalQA.html#langchain.chains.retrieval_qa.base.BaseRetrievalQA "langchain.chains.retrieval_qa.base.BaseRetrievalQA") | | | [`chains.retrieval_qa.base.RetrievalQA`](chains/langchain.chains.retrieval_qa.base.RetrievalQA.html#langchain.chains.retrieval_qa.base.RetrievalQA "langchain.chains.retrieval_qa.base.RetrievalQA") | | | [`chains.retrieval_qa.base.VectorDBQA`](chains/langchain.chains.retrieval_qa.base.VectorDBQA.html#langchain.chains.retrieval_qa.base.VectorDBQA "langchain.chains.retrieval_qa.base.VectorDBQA") | | | [`chains.router.llm_router.LLMRouterChain`](chains/langchain.chains.router.llm_router.LLMRouterChain.html#langchain.chains.router.llm_router.LLMRouterChain "langchain.chains.router.llm_router.LLMRouterChain") | | | [`chains.router.multi_prompt.MultiPromptChain`](chains/langchain.chains.router.multi_prompt.MultiPromptChain.html#langchain.chains.router.multi_prompt.MultiPromptChain "langchain.chains.router.multi_prompt.MultiPromptChain") | | **Deprecated functions** | | | | --- | --- | | [`chains.loading.load_chain`](chains/langchain.chains.loading.load_chain.html#langchain.chains.loading.load_chain "langchain.chains.loading.load_chain")
(path,Β \*\*kwargs) | | | [`chains.loading.load_chain_from_config`](chains/langchain.chains.loading.load_chain_from_config.html#langchain.chains.loading.load_chain_from_config "langchain.chains.loading.load_chain_from_config")
(...) | | | [`chains.openai_functions.base.create_openai_fn_chain`](chains/langchain.chains.openai_functions.base.create_openai_fn_chain.html#langchain.chains.openai_functions.base.create_openai_fn_chain "langchain.chains.openai_functions.base.create_openai_fn_chain")
(...) | | | [`chains.openai_functions.base.create_structured_output_chain`](chains/langchain.chains.openai_functions.base.create_structured_output_chain.html#langchain.chains.openai_functions.base.create_structured_output_chain "langchain.chains.openai_functions.base.create_structured_output_chain")
(...) | | | [`chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain`](chains/langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain.html#langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain "langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain")
(llm) | | | [`chains.openai_functions.extraction.create_extraction_chain`](chains/langchain.chains.openai_functions.extraction.create_extraction_chain.html#langchain.chains.openai_functions.extraction.create_extraction_chain "langchain.chains.openai_functions.extraction.create_extraction_chain")
(...) | | | [`chains.openai_functions.extraction.create_extraction_chain_pydantic`](chains/langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic.html#langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic "langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic")
(...) | | | [`chains.openai_functions.openapi.get_openapi_chain`](chains/langchain.chains.openai_functions.openapi.get_openapi_chain.html#langchain.chains.openai_functions.openapi.get_openapi_chain "langchain.chains.openai_functions.openapi.get_openapi_chain")
(spec) | | | [`chains.openai_functions.qa_with_structure.create_qa_with_sources_chain`](chains/langchain.chains.openai_functions.qa_with_structure.create_qa_with_sources_chain.html#langchain.chains.openai_functions.qa_with_structure.create_qa_with_sources_chain "langchain.chains.openai_functions.qa_with_structure.create_qa_with_sources_chain")
(llm) | | | [`chains.openai_functions.qa_with_structure.create_qa_with_structure_chain`](chains/langchain.chains.openai_functions.qa_with_structure.create_qa_with_structure_chain.html#langchain.chains.openai_functions.qa_with_structure.create_qa_with_structure_chain "langchain.chains.openai_functions.qa_with_structure.create_qa_with_structure_chain")
(...) | | | [`chains.openai_functions.tagging.create_tagging_chain`](chains/langchain.chains.openai_functions.tagging.create_tagging_chain.html#langchain.chains.openai_functions.tagging.create_tagging_chain "langchain.chains.openai_functions.tagging.create_tagging_chain")
(...) | | | [`chains.openai_functions.tagging.create_tagging_chain_pydantic`](chains/langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic.html#langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic "langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic")
(...) | | | [`chains.openai_tools.extraction.create_extraction_chain_pydantic`](chains/langchain.chains.openai_tools.extraction.create_extraction_chain_pydantic.html#langchain.chains.openai_tools.extraction.create_extraction_chain_pydantic "langchain.chains.openai_tools.extraction.create_extraction_chain_pydantic")
(...) | | | [`chains.qa_with_sources.loading.load_qa_with_sources_chain`](chains/langchain.chains.qa_with_sources.loading.load_qa_with_sources_chain.html#langchain.chains.qa_with_sources.loading.load_qa_with_sources_chain "langchain.chains.qa_with_sources.loading.load_qa_with_sources_chain")
(llm) | | | [`chains.query_constructor.base.load_query_constructor_chain`](chains/langchain.chains.query_constructor.base.load_query_constructor_chain.html#langchain.chains.query_constructor.base.load_query_constructor_chain "langchain.chains.query_constructor.base.load_query_constructor_chain")
(...) | | | [`chains.question_answering.chain.load_qa_chain`](chains/langchain.chains.question_answering.chain.load_qa_chain.html#langchain.chains.question_answering.chain.load_qa_chain "langchain.chains.question_answering.chain.load_qa_chain")
(llm) | | | [`chains.structured_output.base.create_openai_fn_runnable`](chains/langchain.chains.structured_output.base.create_openai_fn_runnable.html#langchain.chains.structured_output.base.create_openai_fn_runnable "langchain.chains.structured_output.base.create_openai_fn_runnable")
(...) | | | [`chains.structured_output.base.create_structured_output_runnable`](chains/langchain.chains.structured_output.base.create_structured_output_runnable.html#langchain.chains.structured_output.base.create_structured_output_runnable "langchain.chains.structured_output.base.create_structured_output_runnable")
(...) | | [chat\_models](chat_models.html#langchain-chat-models) [#](#langchain-chat-models "Link to this heading") ---------------------------------------------------------------------------------------------------------- **Functions** | | | | --- | --- | | [`chat_models.base.init_chat_model`](chat_models/langchain.chat_models.base.init_chat_model.html#langchain.chat_models.base.init_chat_model "langchain.chat_models.base.init_chat_model")
() | Initialize a ChatModel from the model name and provider. | [embeddings](embeddings.html#langchain-embeddings) [#](#langchain-embeddings "Link to this heading") ----------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`embeddings.cache.CacheBackedEmbeddings`](embeddings/langchain.embeddings.cache.CacheBackedEmbeddings.html#langchain.embeddings.cache.CacheBackedEmbeddings "langchain.embeddings.cache.CacheBackedEmbeddings")
(...) | Interface for caching results from embedding models. | **Functions** | | | | --- | --- | | [`embeddings.base.init_embeddings`](embeddings/langchain.embeddings.base.init_embeddings.html#langchain.embeddings.base.init_embeddings "langchain.embeddings.base.init_embeddings")
(model,Β \*\[,Β ...\]) | | [evaluation](evaluation.html#langchain-evaluation) [#](#langchain-evaluation "Link to this heading") ----------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`evaluation.agents.trajectory_eval_chain.TrajectoryEval`](evaluation/langchain.evaluation.agents.trajectory_eval_chain.TrajectoryEval.html#langchain.evaluation.agents.trajectory_eval_chain.TrajectoryEval "langchain.evaluation.agents.trajectory_eval_chain.TrajectoryEval") | A named tuple containing the score and reasoning for a trajectory. | | [`evaluation.agents.trajectory_eval_chain.TrajectoryEvalChain`](evaluation/langchain.evaluation.agents.trajectory_eval_chain.TrajectoryEvalChain.html#langchain.evaluation.agents.trajectory_eval_chain.TrajectoryEvalChain "langchain.evaluation.agents.trajectory_eval_chain.TrajectoryEvalChain") | A chain for evaluating ReAct style agents. | | [`evaluation.agents.trajectory_eval_chain.TrajectoryOutputParser`](evaluation/langchain.evaluation.agents.trajectory_eval_chain.TrajectoryOutputParser.html#langchain.evaluation.agents.trajectory_eval_chain.TrajectoryOutputParser "langchain.evaluation.agents.trajectory_eval_chain.TrajectoryOutputParser") | Trajectory output parser. | | [`evaluation.comparison.eval_chain.LabeledPairwiseStringEvalChain`](evaluation/langchain.evaluation.comparison.eval_chain.LabeledPairwiseStringEvalChain.html#langchain.evaluation.comparison.eval_chain.LabeledPairwiseStringEvalChain "langchain.evaluation.comparison.eval_chain.LabeledPairwiseStringEvalChain") | A chain for comparing two outputs, such as the outputs | | [`evaluation.comparison.eval_chain.PairwiseStringEvalChain`](evaluation/langchain.evaluation.comparison.eval_chain.PairwiseStringEvalChain.html#langchain.evaluation.comparison.eval_chain.PairwiseStringEvalChain "langchain.evaluation.comparison.eval_chain.PairwiseStringEvalChain") | A chain for comparing two outputs, such as the outputs | | [`evaluation.comparison.eval_chain.PairwiseStringResultOutputParser`](evaluation/langchain.evaluation.comparison.eval_chain.PairwiseStringResultOutputParser.html#langchain.evaluation.comparison.eval_chain.PairwiseStringResultOutputParser "langchain.evaluation.comparison.eval_chain.PairwiseStringResultOutputParser") | A parser for the output of the PairwiseStringEvalChain. | | [`evaluation.criteria.eval_chain.Criteria`](evaluation/langchain.evaluation.criteria.eval_chain.Criteria.html#langchain.evaluation.criteria.eval_chain.Criteria "langchain.evaluation.criteria.eval_chain.Criteria")
(value) | A Criteria to evaluate. | | [`evaluation.criteria.eval_chain.CriteriaEvalChain`](evaluation/langchain.evaluation.criteria.eval_chain.CriteriaEvalChain.html#langchain.evaluation.criteria.eval_chain.CriteriaEvalChain "langchain.evaluation.criteria.eval_chain.CriteriaEvalChain") | LLM Chain for evaluating runs against criteria. | | [`evaluation.criteria.eval_chain.CriteriaResultOutputParser`](evaluation/langchain.evaluation.criteria.eval_chain.CriteriaResultOutputParser.html#langchain.evaluation.criteria.eval_chain.CriteriaResultOutputParser "langchain.evaluation.criteria.eval_chain.CriteriaResultOutputParser") | A parser for the output of the CriteriaEvalChain. | | [`evaluation.criteria.eval_chain.LabeledCriteriaEvalChain`](evaluation/langchain.evaluation.criteria.eval_chain.LabeledCriteriaEvalChain.html#langchain.evaluation.criteria.eval_chain.LabeledCriteriaEvalChain "langchain.evaluation.criteria.eval_chain.LabeledCriteriaEvalChain") | Criteria evaluation chain that requires references. | | [`evaluation.embedding_distance.base.EmbeddingDistance`](evaluation/langchain.evaluation.embedding_distance.base.EmbeddingDistance.html#langchain.evaluation.embedding_distance.base.EmbeddingDistance "langchain.evaluation.embedding_distance.base.EmbeddingDistance")
(value) | Embedding Distance Metric. | | [`evaluation.embedding_distance.base.EmbeddingDistanceEvalChain`](evaluation/langchain.evaluation.embedding_distance.base.EmbeddingDistanceEvalChain.html#langchain.evaluation.embedding_distance.base.EmbeddingDistanceEvalChain "langchain.evaluation.embedding_distance.base.EmbeddingDistanceEvalChain") | Use embedding distances to score semantic difference between a prediction and reference. | | [`evaluation.embedding_distance.base.PairwiseEmbeddingDistanceEvalChain`](evaluation/langchain.evaluation.embedding_distance.base.PairwiseEmbeddingDistanceEvalChain.html#langchain.evaluation.embedding_distance.base.PairwiseEmbeddingDistanceEvalChain "langchain.evaluation.embedding_distance.base.PairwiseEmbeddingDistanceEvalChain") | Use embedding distances to score semantic difference between two predictions. | | [`evaluation.exact_match.base.ExactMatchStringEvaluator`](evaluation/langchain.evaluation.exact_match.base.ExactMatchStringEvaluator.html#langchain.evaluation.exact_match.base.ExactMatchStringEvaluator "langchain.evaluation.exact_match.base.ExactMatchStringEvaluator")
(\*) | Compute an exact match between the prediction and the reference. | | [`evaluation.parsing.base.JsonEqualityEvaluator`](evaluation/langchain.evaluation.parsing.base.JsonEqualityEvaluator.html#langchain.evaluation.parsing.base.JsonEqualityEvaluator "langchain.evaluation.parsing.base.JsonEqualityEvaluator")
(\[...\]) | Evaluate whether the prediction is equal to the reference after | | [`evaluation.parsing.base.JsonValidityEvaluator`](evaluation/langchain.evaluation.parsing.base.JsonValidityEvaluator.html#langchain.evaluation.parsing.base.JsonValidityEvaluator "langchain.evaluation.parsing.base.JsonValidityEvaluator")
(...) | Evaluate whether the prediction is valid JSON. | | [`evaluation.parsing.json_distance.JsonEditDistanceEvaluator`](evaluation/langchain.evaluation.parsing.json_distance.JsonEditDistanceEvaluator.html#langchain.evaluation.parsing.json_distance.JsonEditDistanceEvaluator "langchain.evaluation.parsing.json_distance.JsonEditDistanceEvaluator")
(\[...\]) | An evaluator that calculates the edit distance between JSON strings. | | [`evaluation.parsing.json_schema.JsonSchemaEvaluator`](evaluation/langchain.evaluation.parsing.json_schema.JsonSchemaEvaluator.html#langchain.evaluation.parsing.json_schema.JsonSchemaEvaluator "langchain.evaluation.parsing.json_schema.JsonSchemaEvaluator")
(...) | An evaluator that validates a JSON prediction against a JSON schema reference. | | [`evaluation.qa.eval_chain.ContextQAEvalChain`](evaluation/langchain.evaluation.qa.eval_chain.ContextQAEvalChain.html#langchain.evaluation.qa.eval_chain.ContextQAEvalChain "langchain.evaluation.qa.eval_chain.ContextQAEvalChain") | LLM Chain for evaluating QA w/o GT based on context | | [`evaluation.qa.eval_chain.CotQAEvalChain`](evaluation/langchain.evaluation.qa.eval_chain.CotQAEvalChain.html#langchain.evaluation.qa.eval_chain.CotQAEvalChain "langchain.evaluation.qa.eval_chain.CotQAEvalChain") | LLM Chain for evaluating QA using chain of thought reasoning. | | [`evaluation.qa.eval_chain.QAEvalChain`](evaluation/langchain.evaluation.qa.eval_chain.QAEvalChain.html#langchain.evaluation.qa.eval_chain.QAEvalChain "langchain.evaluation.qa.eval_chain.QAEvalChain") | LLM Chain for evaluating question answering. | | [`evaluation.qa.generate_chain.QAGenerateChain`](evaluation/langchain.evaluation.qa.generate_chain.QAGenerateChain.html#langchain.evaluation.qa.generate_chain.QAGenerateChain "langchain.evaluation.qa.generate_chain.QAGenerateChain") | LLM Chain for generating examples for question answering. | | [`evaluation.regex_match.base.RegexMatchStringEvaluator`](evaluation/langchain.evaluation.regex_match.base.RegexMatchStringEvaluator.html#langchain.evaluation.regex_match.base.RegexMatchStringEvaluator "langchain.evaluation.regex_match.base.RegexMatchStringEvaluator")
(\*) | Compute a regex match between the prediction and the reference. | | [`evaluation.schema.AgentTrajectoryEvaluator`](evaluation/langchain.evaluation.schema.AgentTrajectoryEvaluator.html#langchain.evaluation.schema.AgentTrajectoryEvaluator "langchain.evaluation.schema.AgentTrajectoryEvaluator")
() | Interface for evaluating agent trajectories. | | [`evaluation.schema.EvaluatorType`](evaluation/langchain.evaluation.schema.EvaluatorType.html#langchain.evaluation.schema.EvaluatorType "langchain.evaluation.schema.EvaluatorType")
(value\[,Β ...\]) | The types of the evaluators. | | [`evaluation.schema.LLMEvalChain`](evaluation/langchain.evaluation.schema.LLMEvalChain.html#langchain.evaluation.schema.LLMEvalChain "langchain.evaluation.schema.LLMEvalChain") | A base class for evaluators that use an LLM. | | [`evaluation.schema.PairwiseStringEvaluator`](evaluation/langchain.evaluation.schema.PairwiseStringEvaluator.html#langchain.evaluation.schema.PairwiseStringEvaluator "langchain.evaluation.schema.PairwiseStringEvaluator")
() | Compare the output of two models (or two outputs of the same model). | | [`evaluation.schema.StringEvaluator`](evaluation/langchain.evaluation.schema.StringEvaluator.html#langchain.evaluation.schema.StringEvaluator "langchain.evaluation.schema.StringEvaluator")
() | Grade, tag, or otherwise evaluate predictions relative to their inputs and/or reference labels. | | [`evaluation.scoring.eval_chain.LabeledScoreStringEvalChain`](evaluation/langchain.evaluation.scoring.eval_chain.LabeledScoreStringEvalChain.html#langchain.evaluation.scoring.eval_chain.LabeledScoreStringEvalChain "langchain.evaluation.scoring.eval_chain.LabeledScoreStringEvalChain") | A chain for scoring the output of a model on a scale of 1-10. | | [`evaluation.scoring.eval_chain.ScoreStringEvalChain`](evaluation/langchain.evaluation.scoring.eval_chain.ScoreStringEvalChain.html#langchain.evaluation.scoring.eval_chain.ScoreStringEvalChain "langchain.evaluation.scoring.eval_chain.ScoreStringEvalChain") | A chain for scoring on a scale of 1-10 the output of a model. | | [`evaluation.scoring.eval_chain.ScoreStringResultOutputParser`](evaluation/langchain.evaluation.scoring.eval_chain.ScoreStringResultOutputParser.html#langchain.evaluation.scoring.eval_chain.ScoreStringResultOutputParser "langchain.evaluation.scoring.eval_chain.ScoreStringResultOutputParser") | A parser for the output of the ScoreStringEvalChain. | | [`evaluation.string_distance.base.PairwiseStringDistanceEvalChain`](evaluation/langchain.evaluation.string_distance.base.PairwiseStringDistanceEvalChain.html#langchain.evaluation.string_distance.base.PairwiseStringDistanceEvalChain "langchain.evaluation.string_distance.base.PairwiseStringDistanceEvalChain") | Compute string edit distances between two predictions. | | [`evaluation.string_distance.base.StringDistance`](evaluation/langchain.evaluation.string_distance.base.StringDistance.html#langchain.evaluation.string_distance.base.StringDistance "langchain.evaluation.string_distance.base.StringDistance")
(value) | Distance metric to use. | | [`evaluation.string_distance.base.StringDistanceEvalChain`](evaluation/langchain.evaluation.string_distance.base.StringDistanceEvalChain.html#langchain.evaluation.string_distance.base.StringDistanceEvalChain "langchain.evaluation.string_distance.base.StringDistanceEvalChain") | Compute string distances between the prediction and the reference. | **Functions** | | | | --- | --- | | [`evaluation.comparison.eval_chain.resolve_pairwise_criteria`](evaluation/langchain.evaluation.comparison.eval_chain.resolve_pairwise_criteria.html#langchain.evaluation.comparison.eval_chain.resolve_pairwise_criteria "langchain.evaluation.comparison.eval_chain.resolve_pairwise_criteria")
(...) | Resolve the criteria for the pairwise evaluator. | | [`evaluation.criteria.eval_chain.resolve_criteria`](evaluation/langchain.evaluation.criteria.eval_chain.resolve_criteria.html#langchain.evaluation.criteria.eval_chain.resolve_criteria "langchain.evaluation.criteria.eval_chain.resolve_criteria")
(...) | Resolve the criteria to evaluate. | | [`evaluation.loading.load_dataset`](evaluation/langchain.evaluation.loading.load_dataset.html#langchain.evaluation.loading.load_dataset "langchain.evaluation.loading.load_dataset")
(uri) | Load a dataset from the [LangChainDatasets on HuggingFace](https://huggingface.co/LangChainDatasets)
. | | [`evaluation.loading.load_evaluator`](evaluation/langchain.evaluation.loading.load_evaluator.html#langchain.evaluation.loading.load_evaluator "langchain.evaluation.loading.load_evaluator")
(evaluator,Β \*) | Load the requested evaluation chain specified by a string. | | [`evaluation.loading.load_evaluators`](evaluation/langchain.evaluation.loading.load_evaluators.html#langchain.evaluation.loading.load_evaluators "langchain.evaluation.loading.load_evaluators")
(evaluators,Β \*) | Load evaluators specified by a list of evaluator types. | | [`evaluation.scoring.eval_chain.resolve_criteria`](evaluation/langchain.evaluation.scoring.eval_chain.resolve_criteria.html#langchain.evaluation.scoring.eval_chain.resolve_criteria "langchain.evaluation.scoring.eval_chain.resolve_criteria")
(...) | Resolve the criteria for the pairwise evaluator. | [globals](globals.html#langchain-globals) [#](#langchain-globals "Link to this heading") ----------------------------------------------------------------------------------------- **Functions** | | | | --- | --- | | [`globals.get_debug`](globals/langchain.globals.get_debug.html#langchain.globals.get_debug "langchain.globals.get_debug")
() | Get the value of the debug global setting. | | [`globals.get_llm_cache`](globals/langchain.globals.get_llm_cache.html#langchain.globals.get_llm_cache "langchain.globals.get_llm_cache")
() | Get the value of the llm\_cache global setting. | | [`globals.get_verbose`](globals/langchain.globals.get_verbose.html#langchain.globals.get_verbose "langchain.globals.get_verbose")
() | Get the value of the verbose global setting. | | [`globals.set_debug`](globals/langchain.globals.set_debug.html#langchain.globals.set_debug "langchain.globals.set_debug")
(value) | Set a new value for the debug global setting. | | [`globals.set_llm_cache`](globals/langchain.globals.set_llm_cache.html#langchain.globals.set_llm_cache "langchain.globals.set_llm_cache")
(value) | Set a new LLM cache, overwriting the previous value, if any. | | [`globals.set_verbose`](globals/langchain.globals.set_verbose.html#langchain.globals.set_verbose "langchain.globals.set_verbose")
(value) | Set a new value for the verbose global setting. | [hub](hub.html#langchain-hub) [#](#langchain-hub "Link to this heading") ------------------------------------------------------------------------- **Functions** | | | | --- | --- | | [`hub.pull`](hub/langchain.hub.pull.html#langchain.hub.pull "langchain.hub.pull")
(owner\_repo\_commit,Β \*\[,Β ...\]) | Pull an object from the hub and returns it as a LangChain object. | | [`hub.push`](hub/langchain.hub.push.html#langchain.hub.push "langchain.hub.push")
(repo\_full\_name,Β object,Β \*\[,Β ...\]) | Push an object to the hub and returns the URL it can be viewed at in a browser. | [indexes](indexes.html#langchain-indexes) [#](#langchain-indexes "Link to this heading") ----------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`indexes.vectorstore.VectorStoreIndexWrapper`](indexes/langchain.indexes.vectorstore.VectorStoreIndexWrapper.html#langchain.indexes.vectorstore.VectorStoreIndexWrapper "langchain.indexes.vectorstore.VectorStoreIndexWrapper") | Wrapper around a vectorstore for easy access. | | [`indexes.vectorstore.VectorstoreIndexCreator`](indexes/langchain.indexes.vectorstore.VectorstoreIndexCreator.html#langchain.indexes.vectorstore.VectorstoreIndexCreator "langchain.indexes.vectorstore.VectorstoreIndexCreator") | Logic for creating indexes. | [memory](memory.html#langchain-memory) [#](#langchain-memory "Link to this heading") ------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`memory.combined.CombinedMemory`](memory/langchain.memory.combined.CombinedMemory.html#langchain.memory.combined.CombinedMemory "langchain.memory.combined.CombinedMemory") | Combining multiple memories' data together. | | [`memory.readonly.ReadOnlySharedMemory`](memory/langchain.memory.readonly.ReadOnlySharedMemory.html#langchain.memory.readonly.ReadOnlySharedMemory "langchain.memory.readonly.ReadOnlySharedMemory") | Memory wrapper that is read-only and cannot be changed. | | [`memory.simple.SimpleMemory`](memory/langchain.memory.simple.SimpleMemory.html#langchain.memory.simple.SimpleMemory "langchain.memory.simple.SimpleMemory") | Simple memory for storing context or other information that shouldn't ever change between prompts. | | [`memory.vectorstore_token_buffer_memory.ConversationVectorStoreTokenBufferMemory`](memory/langchain.memory.vectorstore_token_buffer_memory.ConversationVectorStoreTokenBufferMemory.html#langchain.memory.vectorstore_token_buffer_memory.ConversationVectorStoreTokenBufferMemory "langchain.memory.vectorstore_token_buffer_memory.ConversationVectorStoreTokenBufferMemory") | Conversation chat memory with token limit and vectordb backing. | **Functions** | | | | --- | --- | | [`memory.utils.get_prompt_input_key`](memory/langchain.memory.utils.get_prompt_input_key.html#langchain.memory.utils.get_prompt_input_key "langchain.memory.utils.get_prompt_input_key")
(inputs,Β ...) | Get the prompt input key. | **Deprecated classes** | | | | --- | --- | | [`memory.buffer.ConversationBufferMemory`](memory/langchain.memory.buffer.ConversationBufferMemory.html#langchain.memory.buffer.ConversationBufferMemory "langchain.memory.buffer.ConversationBufferMemory") | | | [`memory.buffer.ConversationStringBufferMemory`](memory/langchain.memory.buffer.ConversationStringBufferMemory.html#langchain.memory.buffer.ConversationStringBufferMemory "langchain.memory.buffer.ConversationStringBufferMemory") | | | [`memory.buffer_window.ConversationBufferWindowMemory`](memory/langchain.memory.buffer_window.ConversationBufferWindowMemory.html#langchain.memory.buffer_window.ConversationBufferWindowMemory "langchain.memory.buffer_window.ConversationBufferWindowMemory") | | | [`memory.chat_memory.BaseChatMemory`](memory/langchain.memory.chat_memory.BaseChatMemory.html#langchain.memory.chat_memory.BaseChatMemory "langchain.memory.chat_memory.BaseChatMemory") | | | [`memory.entity.BaseEntityStore`](memory/langchain.memory.entity.BaseEntityStore.html#langchain.memory.entity.BaseEntityStore "langchain.memory.entity.BaseEntityStore") | | | [`memory.entity.ConversationEntityMemory`](memory/langchain.memory.entity.ConversationEntityMemory.html#langchain.memory.entity.ConversationEntityMemory "langchain.memory.entity.ConversationEntityMemory") | | | [`memory.entity.InMemoryEntityStore`](memory/langchain.memory.entity.InMemoryEntityStore.html#langchain.memory.entity.InMemoryEntityStore "langchain.memory.entity.InMemoryEntityStore") | | | [`memory.entity.RedisEntityStore`](memory/langchain.memory.entity.RedisEntityStore.html#langchain.memory.entity.RedisEntityStore "langchain.memory.entity.RedisEntityStore") | | | [`memory.entity.SQLiteEntityStore`](memory/langchain.memory.entity.SQLiteEntityStore.html#langchain.memory.entity.SQLiteEntityStore "langchain.memory.entity.SQLiteEntityStore") | | | [`memory.entity.UpstashRedisEntityStore`](memory/langchain.memory.entity.UpstashRedisEntityStore.html#langchain.memory.entity.UpstashRedisEntityStore "langchain.memory.entity.UpstashRedisEntityStore") | | | [`memory.summary.ConversationSummaryMemory`](memory/langchain.memory.summary.ConversationSummaryMemory.html#langchain.memory.summary.ConversationSummaryMemory "langchain.memory.summary.ConversationSummaryMemory") | | | [`memory.summary.SummarizerMixin`](memory/langchain.memory.summary.SummarizerMixin.html#langchain.memory.summary.SummarizerMixin "langchain.memory.summary.SummarizerMixin") | | | [`memory.summary_buffer.ConversationSummaryBufferMemory`](memory/langchain.memory.summary_buffer.ConversationSummaryBufferMemory.html#langchain.memory.summary_buffer.ConversationSummaryBufferMemory "langchain.memory.summary_buffer.ConversationSummaryBufferMemory") | | | [`memory.token_buffer.ConversationTokenBufferMemory`](memory/langchain.memory.token_buffer.ConversationTokenBufferMemory.html#langchain.memory.token_buffer.ConversationTokenBufferMemory "langchain.memory.token_buffer.ConversationTokenBufferMemory") | | | [`memory.vectorstore.VectorStoreRetrieverMemory`](memory/langchain.memory.vectorstore.VectorStoreRetrieverMemory.html#langchain.memory.vectorstore.VectorStoreRetrieverMemory "langchain.memory.vectorstore.VectorStoreRetrieverMemory") | | [model\_laboratory](model_laboratory.html#langchain-model-laboratory) [#](#langchain-model-laboratory "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`model_laboratory.ModelLaboratory`](model_laboratory/langchain.model_laboratory.ModelLaboratory.html#langchain.model_laboratory.ModelLaboratory "langchain.model_laboratory.ModelLaboratory")
(chains\[,Β names\]) | Experiment with different models. | [output\_parsers](output_parsers.html#langchain-output-parsers) [#](#langchain-output-parsers "Link to this heading") ---------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`output_parsers.boolean.BooleanOutputParser`](output_parsers/langchain.output_parsers.boolean.BooleanOutputParser.html#langchain.output_parsers.boolean.BooleanOutputParser "langchain.output_parsers.boolean.BooleanOutputParser") | Parse the output of an LLM call to a boolean. | | [`output_parsers.combining.CombiningOutputParser`](output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html#langchain.output_parsers.combining.CombiningOutputParser "langchain.output_parsers.combining.CombiningOutputParser") | Combine multiple output parsers into one. | | [`output_parsers.datetime.DatetimeOutputParser`](output_parsers/langchain.output_parsers.datetime.DatetimeOutputParser.html#langchain.output_parsers.datetime.DatetimeOutputParser "langchain.output_parsers.datetime.DatetimeOutputParser") | Parse the output of an LLM call to a datetime. | | [`output_parsers.enum.EnumOutputParser`](output_parsers/langchain.output_parsers.enum.EnumOutputParser.html#langchain.output_parsers.enum.EnumOutputParser "langchain.output_parsers.enum.EnumOutputParser") | Parse an output that is one of a set of values. | | [`output_parsers.fix.OutputFixingParser`](output_parsers/langchain.output_parsers.fix.OutputFixingParser.html#langchain.output_parsers.fix.OutputFixingParser "langchain.output_parsers.fix.OutputFixingParser") | Wrap a parser and try to fix parsing errors. | | [`output_parsers.fix.OutputFixingParserRetryChainInput`](output_parsers/langchain.output_parsers.fix.OutputFixingParserRetryChainInput.html#langchain.output_parsers.fix.OutputFixingParserRetryChainInput "langchain.output_parsers.fix.OutputFixingParserRetryChainInput") | | | [`output_parsers.pandas_dataframe.PandasDataFrameOutputParser`](output_parsers/langchain.output_parsers.pandas_dataframe.PandasDataFrameOutputParser.html#langchain.output_parsers.pandas_dataframe.PandasDataFrameOutputParser "langchain.output_parsers.pandas_dataframe.PandasDataFrameOutputParser") | Parse an output using Pandas DataFrame format. | | [`output_parsers.regex.RegexParser`](output_parsers/langchain.output_parsers.regex.RegexParser.html#langchain.output_parsers.regex.RegexParser "langchain.output_parsers.regex.RegexParser") | Parse the output of an LLM call using a regex. | | [`output_parsers.regex_dict.RegexDictParser`](output_parsers/langchain.output_parsers.regex_dict.RegexDictParser.html#langchain.output_parsers.regex_dict.RegexDictParser "langchain.output_parsers.regex_dict.RegexDictParser") | Parse the output of an LLM call into a Dictionary using a regex. | | [`output_parsers.retry.RetryOutputParser`](output_parsers/langchain.output_parsers.retry.RetryOutputParser.html#langchain.output_parsers.retry.RetryOutputParser "langchain.output_parsers.retry.RetryOutputParser") | Wrap a parser and try to fix parsing errors. | | [`output_parsers.retry.RetryOutputParserRetryChainInput`](output_parsers/langchain.output_parsers.retry.RetryOutputParserRetryChainInput.html#langchain.output_parsers.retry.RetryOutputParserRetryChainInput "langchain.output_parsers.retry.RetryOutputParserRetryChainInput") | | | [`output_parsers.retry.RetryWithErrorOutputParser`](output_parsers/langchain.output_parsers.retry.RetryWithErrorOutputParser.html#langchain.output_parsers.retry.RetryWithErrorOutputParser "langchain.output_parsers.retry.RetryWithErrorOutputParser") | Wrap a parser and try to fix parsing errors. | | [`output_parsers.retry.RetryWithErrorOutputParserRetryChainInput`](output_parsers/langchain.output_parsers.retry.RetryWithErrorOutputParserRetryChainInput.html#langchain.output_parsers.retry.RetryWithErrorOutputParserRetryChainInput "langchain.output_parsers.retry.RetryWithErrorOutputParserRetryChainInput") | | | [`output_parsers.structured.ResponseSchema`](output_parsers/langchain.output_parsers.structured.ResponseSchema.html#langchain.output_parsers.structured.ResponseSchema "langchain.output_parsers.structured.ResponseSchema") | Schema for a response from a structured output parser. | | [`output_parsers.structured.StructuredOutputParser`](output_parsers/langchain.output_parsers.structured.StructuredOutputParser.html#langchain.output_parsers.structured.StructuredOutputParser "langchain.output_parsers.structured.StructuredOutputParser") | Parse the output of an LLM call to a structured output. | | [`output_parsers.yaml.YamlOutputParser`](output_parsers/langchain.output_parsers.yaml.YamlOutputParser.html#langchain.output_parsers.yaml.YamlOutputParser "langchain.output_parsers.yaml.YamlOutputParser") | Parse YAML output using a pydantic model. | **Functions** | | | | --- | --- | | [`output_parsers.loading.load_output_parser`](output_parsers/langchain.output_parsers.loading.load_output_parser.html#langchain.output_parsers.loading.load_output_parser "langchain.output_parsers.loading.load_output_parser")
(config) | Load an output parser. | [retrievers](retrievers.html#langchain-retrievers) [#](#langchain-retrievers "Link to this heading") ----------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`retrievers.contextual_compression.ContextualCompressionRetriever`](retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html#langchain.retrievers.contextual_compression.ContextualCompressionRetriever "langchain.retrievers.contextual_compression.ContextualCompressionRetriever") | Retriever that wraps a base retriever and compresses the results. | | [`retrievers.document_compressors.base.DocumentCompressorPipeline`](retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html#langchain.retrievers.document_compressors.base.DocumentCompressorPipeline "langchain.retrievers.document_compressors.base.DocumentCompressorPipeline") | Document compressor that uses a pipeline of Transformers. | | [`retrievers.document_compressors.chain_extract.LLMChainExtractor`](retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html#langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor "langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor") | Document compressor that uses an LLM chain to extract the relevant parts of documents. | | [`retrievers.document_compressors.chain_extract.NoOutputParser`](retrievers/langchain.retrievers.document_compressors.chain_extract.NoOutputParser.html#langchain.retrievers.document_compressors.chain_extract.NoOutputParser "langchain.retrievers.document_compressors.chain_extract.NoOutputParser") | Parse outputs that could return a null string of some sort. | | [`retrievers.document_compressors.chain_filter.LLMChainFilter`](retrievers/langchain.retrievers.document_compressors.chain_filter.LLMChainFilter.html#langchain.retrievers.document_compressors.chain_filter.LLMChainFilter "langchain.retrievers.document_compressors.chain_filter.LLMChainFilter") | Filter that drops documents that aren't relevant to the query. | | [`retrievers.document_compressors.cross_encoder.BaseCrossEncoder`](retrievers/langchain.retrievers.document_compressors.cross_encoder.BaseCrossEncoder.html#langchain.retrievers.document_compressors.cross_encoder.BaseCrossEncoder "langchain.retrievers.document_compressors.cross_encoder.BaseCrossEncoder")
() | Interface for cross encoder models. | | [`retrievers.document_compressors.cross_encoder_rerank.CrossEncoderReranker`](retrievers/langchain.retrievers.document_compressors.cross_encoder_rerank.CrossEncoderReranker.html#langchain.retrievers.document_compressors.cross_encoder_rerank.CrossEncoderReranker "langchain.retrievers.document_compressors.cross_encoder_rerank.CrossEncoderReranker") | Document compressor that uses CrossEncoder for reranking. | | [`retrievers.document_compressors.embeddings_filter.EmbeddingsFilter`](retrievers/langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter.html#langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter "langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter") | Document compressor that uses embeddings to drop documents unrelated to the query. | | [`retrievers.document_compressors.listwise_rerank.LLMListwiseRerank`](retrievers/langchain.retrievers.document_compressors.listwise_rerank.LLMListwiseRerank.html#langchain.retrievers.document_compressors.listwise_rerank.LLMListwiseRerank "langchain.retrievers.document_compressors.listwise_rerank.LLMListwiseRerank") | Document compressor that uses Zero-Shot Listwise Document Reranking. | | [`retrievers.ensemble.EnsembleRetriever`](retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html#langchain.retrievers.ensemble.EnsembleRetriever "langchain.retrievers.ensemble.EnsembleRetriever") | Retriever that ensembles the multiple retrievers. | | [`retrievers.merger_retriever.MergerRetriever`](retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html#langchain.retrievers.merger_retriever.MergerRetriever "langchain.retrievers.merger_retriever.MergerRetriever") | Retriever that merges the results of multiple retrievers. | | [`retrievers.multi_query.LineListOutputParser`](retrievers/langchain.retrievers.multi_query.LineListOutputParser.html#langchain.retrievers.multi_query.LineListOutputParser "langchain.retrievers.multi_query.LineListOutputParser") | Output parser for a list of lines. | | [`retrievers.multi_query.MultiQueryRetriever`](retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html#langchain.retrievers.multi_query.MultiQueryRetriever "langchain.retrievers.multi_query.MultiQueryRetriever") | Given a query, use an LLM to write a set of queries. | | [`retrievers.multi_vector.MultiVectorRetriever`](retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html#langchain.retrievers.multi_vector.MultiVectorRetriever "langchain.retrievers.multi_vector.MultiVectorRetriever") | Retrieve from a set of multiple embeddings for the same document. | | [`retrievers.multi_vector.SearchType`](retrievers/langchain.retrievers.multi_vector.SearchType.html#langchain.retrievers.multi_vector.SearchType "langchain.retrievers.multi_vector.SearchType")
(value\[,Β ...\]) | Enumerator of the types of search to perform. | | [`retrievers.parent_document_retriever.ParentDocumentRetriever`](retrievers/langchain.retrievers.parent_document_retriever.ParentDocumentRetriever.html#langchain.retrievers.parent_document_retriever.ParentDocumentRetriever "langchain.retrievers.parent_document_retriever.ParentDocumentRetriever") | Retrieve small chunks then retrieve their parent documents. | | [`retrievers.re_phraser.RePhraseQueryRetriever`](retrievers/langchain.retrievers.re_phraser.RePhraseQueryRetriever.html#langchain.retrievers.re_phraser.RePhraseQueryRetriever "langchain.retrievers.re_phraser.RePhraseQueryRetriever") | Given a query, use an LLM to re-phrase it. | | [`retrievers.self_query.base.SelfQueryRetriever`](retrievers/langchain.retrievers.self_query.base.SelfQueryRetriever.html#langchain.retrievers.self_query.base.SelfQueryRetriever "langchain.retrievers.self_query.base.SelfQueryRetriever") | Retriever that uses a vector store and an LLM to generate the vector store queries. | | [`retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever`](retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html#langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever "langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever") | Retriever that combines embedding similarity with recency in retrieving values. | **Functions** | | | | --- | --- | | [`retrievers.document_compressors.chain_extract.default_get_input`](retrievers/langchain.retrievers.document_compressors.chain_extract.default_get_input.html#langchain.retrievers.document_compressors.chain_extract.default_get_input "langchain.retrievers.document_compressors.chain_extract.default_get_input")
(...) | Return the compression chain input. | | [`retrievers.document_compressors.chain_filter.default_get_input`](retrievers/langchain.retrievers.document_compressors.chain_filter.default_get_input.html#langchain.retrievers.document_compressors.chain_filter.default_get_input "langchain.retrievers.document_compressors.chain_filter.default_get_input")
(...) | Return the compression chain input. | | [`retrievers.ensemble.unique_by_key`](retrievers/langchain.retrievers.ensemble.unique_by_key.html#langchain.retrievers.ensemble.unique_by_key "langchain.retrievers.ensemble.unique_by_key")
(iterable,Β key) | Yield unique elements of an iterable based on a key function. | **Deprecated classes** | | | | --- | --- | | [`retrievers.document_compressors.cohere_rerank.CohereRerank`](retrievers/langchain.retrievers.document_compressors.cohere_rerank.CohereRerank.html#langchain.retrievers.document_compressors.cohere_rerank.CohereRerank "langchain.retrievers.document_compressors.cohere_rerank.CohereRerank") | | [runnables](runnables.html#langchain-runnables) [#](#langchain-runnables "Link to this heading") ------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`runnables.hub.HubRunnable`](runnables/langchain.runnables.hub.HubRunnable.html#langchain.runnables.hub.HubRunnable "langchain.runnables.hub.HubRunnable") | An instance of a runnable stored in the LangChain Hub. | | [`runnables.openai_functions.OpenAIFunction`](runnables/langchain.runnables.openai_functions.OpenAIFunction.html#langchain.runnables.openai_functions.OpenAIFunction "langchain.runnables.openai_functions.OpenAIFunction") | A function description for ChatOpenAI | | [`runnables.openai_functions.OpenAIFunctionsRouter`](runnables/langchain.runnables.openai_functions.OpenAIFunctionsRouter.html#langchain.runnables.openai_functions.OpenAIFunctionsRouter "langchain.runnables.openai_functions.OpenAIFunctionsRouter") | A runnable that routes to the selected function. | [smith](smith.html#langchain-smith) [#](#langchain-smith "Link to this heading") --------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`smith.evaluation.config.EvalConfig`](smith/langchain.smith.evaluation.config.EvalConfig.html#langchain.smith.evaluation.config.EvalConfig "langchain.smith.evaluation.config.EvalConfig") | Configuration for a given run evaluator. | | [`smith.evaluation.config.RunEvalConfig`](smith/langchain.smith.evaluation.config.RunEvalConfig.html#langchain.smith.evaluation.config.RunEvalConfig "langchain.smith.evaluation.config.RunEvalConfig") | Configuration for a run evaluation. | | [`smith.evaluation.config.SingleKeyEvalConfig`](smith/langchain.smith.evaluation.config.SingleKeyEvalConfig.html#langchain.smith.evaluation.config.SingleKeyEvalConfig "langchain.smith.evaluation.config.SingleKeyEvalConfig") | Configuration for a run evaluator that only requires a single key. | | [`smith.evaluation.progress.ProgressBarCallback`](smith/langchain.smith.evaluation.progress.ProgressBarCallback.html#langchain.smith.evaluation.progress.ProgressBarCallback "langchain.smith.evaluation.progress.ProgressBarCallback")
(total) | A simple progress bar for the console. | | [`smith.evaluation.runner_utils.ChatModelInput`](smith/langchain.smith.evaluation.runner_utils.ChatModelInput.html#langchain.smith.evaluation.runner_utils.ChatModelInput "langchain.smith.evaluation.runner_utils.ChatModelInput") | Input for a chat model. | | [`smith.evaluation.runner_utils.EvalError`](smith/langchain.smith.evaluation.runner_utils.EvalError.html#langchain.smith.evaluation.runner_utils.EvalError "langchain.smith.evaluation.runner_utils.EvalError")
(...) | Your architecture raised an error. | | [`smith.evaluation.runner_utils.InputFormatError`](smith/langchain.smith.evaluation.runner_utils.InputFormatError.html#langchain.smith.evaluation.runner_utils.InputFormatError "langchain.smith.evaluation.runner_utils.InputFormatError") | Raised when the input format is invalid. | | [`smith.evaluation.runner_utils.TestResult`](smith/langchain.smith.evaluation.runner_utils.TestResult.html#langchain.smith.evaluation.runner_utils.TestResult "langchain.smith.evaluation.runner_utils.TestResult") | A dictionary of the results of a single test run. | | [`smith.evaluation.string_run_evaluator.ChainStringRunMapper`](smith/langchain.smith.evaluation.string_run_evaluator.ChainStringRunMapper.html#langchain.smith.evaluation.string_run_evaluator.ChainStringRunMapper "langchain.smith.evaluation.string_run_evaluator.ChainStringRunMapper") | Extract items to evaluate from the run object from a chain. | | [`smith.evaluation.string_run_evaluator.LLMStringRunMapper`](smith/langchain.smith.evaluation.string_run_evaluator.LLMStringRunMapper.html#langchain.smith.evaluation.string_run_evaluator.LLMStringRunMapper "langchain.smith.evaluation.string_run_evaluator.LLMStringRunMapper") | Extract items to evaluate from the run object. | | [`smith.evaluation.string_run_evaluator.StringExampleMapper`](smith/langchain.smith.evaluation.string_run_evaluator.StringExampleMapper.html#langchain.smith.evaluation.string_run_evaluator.StringExampleMapper "langchain.smith.evaluation.string_run_evaluator.StringExampleMapper") | Map an example, or row in the dataset, to the inputs of an evaluation. | | [`smith.evaluation.string_run_evaluator.StringRunEvaluatorChain`](smith/langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain.html#langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain "langchain.smith.evaluation.string_run_evaluator.StringRunEvaluatorChain") | Evaluate Run and optional examples. | | [`smith.evaluation.string_run_evaluator.StringRunMapper`](smith/langchain.smith.evaluation.string_run_evaluator.StringRunMapper.html#langchain.smith.evaluation.string_run_evaluator.StringRunMapper "langchain.smith.evaluation.string_run_evaluator.StringRunMapper") | Extract items to evaluate from the run object. | | [`smith.evaluation.string_run_evaluator.ToolStringRunMapper`](smith/langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper.html#langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper "langchain.smith.evaluation.string_run_evaluator.ToolStringRunMapper") | Map an input to the tool. | **Functions** | | | | --- | --- | | [`smith.evaluation.name_generation.random_name`](smith/langchain.smith.evaluation.name_generation.random_name.html#langchain.smith.evaluation.name_generation.random_name "langchain.smith.evaluation.name_generation.random_name")
() | Generate a random name. | | [`smith.evaluation.runner_utils.arun_on_dataset`](smith/langchain.smith.evaluation.runner_utils.arun_on_dataset.html#langchain.smith.evaluation.runner_utils.arun_on_dataset "langchain.smith.evaluation.runner_utils.arun_on_dataset")
(...) | Run the Chain or language model on a dataset and store traces to the specified project name. | | [`smith.evaluation.runner_utils.run_on_dataset`](smith/langchain.smith.evaluation.runner_utils.run_on_dataset.html#langchain.smith.evaluation.runner_utils.run_on_dataset "langchain.smith.evaluation.runner_utils.run_on_dataset")
(...) | Run the Chain or language model on a dataset and store traces to the specified project name. | [storage](storage.html#langchain-storage) [#](#langchain-storage "Link to this heading") ----------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`storage.encoder_backed.EncoderBackedStore`](storage/langchain.storage.encoder_backed.EncoderBackedStore.html#langchain.storage.encoder_backed.EncoderBackedStore "langchain.storage.encoder_backed.EncoderBackedStore")
(...) | Wraps a store with key and value encoders/decoders. | | [`storage.file_system.LocalFileStore`](storage/langchain.storage.file_system.LocalFileStore.html#langchain.storage.file_system.LocalFileStore "langchain.storage.file_system.LocalFileStore")
(root\_path,Β \*) | BaseStore interface that works on the local file system. | --- # Tutorials | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/contributing/tutorials/index.mdx) More coming soon! We are working on tutorials to help you make your first contribution to the project. * [**Make your first docs PR**](/docs/contributing/tutorials/docs/) * * * #### Was this page helpful? --- # Build a Retrieval Augmented Generation (RAG) App: Part 2 | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/qa_chat_history.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/qa_chat_history.ipynb) In many Q&A applications we want to allow the user to have a back-and-forth conversation, meaning the application needs some sort of "memory" of past questions and answers, and some logic for incorporating those into its current thinking. This is a the second part of a multi-part tutorial: * [Part 1](/docs/tutorials/rag/) introduces RAG and walks through a minimal implementation. * [Part 2](/docs/tutorials/qa_chat_history/) (this guide) extends the implementation to accommodate conversation-style interactions and multi-step retrieval processes. Here we focus on **adding logic for incorporating historical messages.** This involves the management of a [chat history](/docs/concepts/chat_history/) . We will cover two approaches: 1. [Chains](/docs/tutorials/qa_chat_history/#chains) , in which we execute at most one retrieval step; 2. [Agents](/docs/tutorials/qa_chat_history/#agents) , in which we give an LLM discretion to execute multiple retrieval steps. note The methods presented here leverage [tool-calling](/docs/concepts/tool_calling/) capabilities in modern [chat models](/docs/concepts/chat_models/) . See [this page](/docs/integrations/chat/) for a table of models supporting tool calling features. For the external knowledge source, we will use the same [LLM Powered Autonomous Agents](https://lilianweng.github.io/posts/2023-06-23-agent/) blog post by Lilian Weng from the [Part 1](/docs/tutorials/rag/) of the RAG tutorial. Setup[​](#setup "Direct link to Setup") ---------------------------------------- ### Components[​](#components "Direct link to Components") We will need to select three components from LangChain's suite of integrations. Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAIllm = ChatOpenAI(model="gpt-4o-mini") Select [embeddings model](/docs/integrations/text_embedding/) : OpenAIβ–Ύ * [OpenAI](#) * [Azure](#) * [Google](#) * [AWS](#) * [HuggingFace](#) * [Ollama](#) * [Cohere](#) * [MistralAI](#) * [Nomic](#) * [NVIDIA](#) * [Voyage AI](#) * [Fake](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import OpenAIEmbeddingsembeddings = OpenAIEmbeddings(model="text-embedding-3-large") Select [vector store](/docs/integrations/vectorstores/) : In-memoryβ–Ύ * [In-memory](#) * [AstraDB](#) * [Chroma](#) * [FAISS](#) * [Milvus](#) * [MongoDB](#) * [PGVector](#) * [Pinecone](#) * [Qdrant](#) pip install -qU langchain-core from langchain_core.vectorstores import InMemoryVectorStorevector_store = InMemoryVectorStore(embeddings) ### Dependencies[​](#dependencies "Direct link to Dependencies") In addition, we'll use the following packages: %%capture --no-stderr%pip install --upgrade --quiet langgraph langchain-community beautifulsoup4 ### LangSmith[​](#langsmith "Direct link to LangSmith") Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent. The best way to do this is with [LangSmith](https://smith.langchain.com) . Note that LangSmith is not needed, but it is helpful. If you do want to use LangSmith, after you sign up at the link above, make sure to set your environment variables to start logging traces: os.environ["LANGCHAIN_TRACING_V2"] = "true"if not os.environ.get("LANGCHAIN_API_KEY"): os.environ["LANGCHAIN_API_KEY"] = getpass.getpass() Chains[​](#chains "Direct link to Chains") ------------------------------------------- Let's first revisit the vector store we built in [Part 1](/docs/tutorials/rag/) , which indexes an [LLM Powered Autonomous Agents](https://lilianweng.github.io/posts/2023-06-23-agent/) blog post by Lilian Weng. import bs4from langchain import hubfrom langchain_community.document_loaders import WebBaseLoaderfrom langchain_core.documents import Documentfrom langchain_text_splitters import RecursiveCharacterTextSplitterfrom typing_extensions import List, TypedDict# Load and chunk contents of the blogloader = WebBaseLoader( web_paths=("https://lilianweng.github.io/posts/2023-06-23-agent/",), bs_kwargs=dict( parse_only=bs4.SoupStrainer( class_=("post-content", "post-title", "post-header") ) ),)docs = loader.load()text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)all_splits = text_splitter.split_documents(docs) **API Reference:**[hub](https://python.langchain.com/api_reference/langchain/hub/langchain.hub.hub.html) | [WebBaseLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.web_base.WebBaseLoader.html) | [Document](https://python.langchain.com/api_reference/core/documents/langchain_core.documents.base.Document.html) | [RecursiveCharacterTextSplitter](https://python.langchain.com/api_reference/text_splitters/character/langchain_text_splitters.character.RecursiveCharacterTextSplitter.html) # Index chunks_ = vector_store.add_documents(documents=all_splits) In the [Part 1](/docs/tutorials/rag/) of the RAG tutorial, we represented the user input, retrieved context, and generated answer as separate keys in the state. Conversational experiences can be naturally represented using a sequence of [messages](/docs/concepts/messages/) . In addition to messages from the user and assistant, retrieved documents and other artifacts can be incorporated into a message sequence via [tool messages](/docs/concepts/messages/#toolmessage) . This motivates us to represent the state of our RAG application using a sequence of messages. Specifically, we will have 1. User input as a `HumanMessage`; 2. Vector store query as an `AIMessage` with tool calls; 3. Retrieved documents as a `ToolMessage`; 4. Final response as a `AIMessage`. This model for state is so versatile that LangGraph offers a built-in version for convenience: from langgraph.graph import MessagesState, StateGraphgraph_builder = StateGraph(MessagesState) **API Reference:**[StateGraph](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.state.StateGraph) Leveraging [tool-calling](/docs/concepts/tool_calling/) to interact with a retrieval step has another benefit, which is that the query for the retrieval is generated by our model. This is especially important in a conversational setting, where user queries may require contextualization based on the chat history. For instance, consider the following exchange: > Human: "What is Task Decomposition?" > > AI: "Task decomposition involves breaking down complex tasks into smaller and simpler steps to make them more manageable for an agent or model." > > Human: "What are common ways of doing it?" In this scenario, a model could generate a query such as `"common approaches to task decomposition"`. Tool-calling facilitates this naturally. As in the [query analysis](/docs/tutorials/rag/#query-analysis) section of the RAG tutorial, this allows a model to rewrite user queries into more effective search queries. It also provides support for direct responses that do not involve a retrieval step (e.g., in response to a generic greeting from the user). Let's turn our retrieval step into a [tool](/docs/concepts/tools/) : from langchain_core.tools import tool@tool(response_format="content_and_artifact")def retrieve(query: str): """Retrieve information related to a query.""" retrieved_docs = vector_store.similarity_search(query, k=2) serialized = "\n\n".join( (f"Source: {doc.metadata}\n" f"Content: {doc.page_content}") for doc in retrieved_docs ) return serialized, retrieved_docs **API Reference:**[tool](https://python.langchain.com/api_reference/core/tools/langchain_core.tools.convert.tool.html) See [this guide](/docs/how_to/custom_tools/) for more detail on creating tools. Our graph will consist of three nodes: 1. A node that fields the user input, either generating a query for the retriever or responding directly; 2. A node for the retriever tool that executes the retrieval step; 3. A node that generates the final response using the retrieved context. We build them below. Note that we leverage another pre-built LangGraph component, [ToolNode](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.tool_node.ToolNode) , that executes the tool and adds the result as a `ToolMessage` to the state. from langchain_core.messages import SystemMessagefrom langgraph.prebuilt import ToolNode# Step 1: Generate an AIMessage that may include a tool-call to be sent.def query_or_respond(state: MessagesState): """Generate tool call for retrieval or respond.""" llm_with_tools = llm.bind_tools([retrieve]) response = llm_with_tools.invoke(state["messages"]) # MessagesState appends messages to state instead of overwriting return {"messages": [response]}# Step 2: Execute the retrieval.tools = ToolNode([retrieve])# Step 3: Generate a response using the retrieved content.def generate(state: MessagesState): """Generate answer.""" # Get generated ToolMessages recent_tool_messages = [] for message in reversed(state["messages"]): if message.type == "tool": recent_tool_messages.append(message) else: break tool_messages = recent_tool_messages[::-1] # Format into prompt docs_content = "\n\n".join(doc.content for doc in tool_messages) system_message_content = ( "You are an assistant for question-answering tasks. " "Use the following pieces of retrieved context to answer " "the question. If you don't know the answer, say that you " "don't know. Use three sentences maximum and keep the " "answer concise." "\n\n" f"{docs_content}" ) conversation_messages = [ message for message in state["messages"] if message.type in ("human", "system") or (message.type == "ai" and not message.tool_calls) ] prompt = [SystemMessage(system_message_content)] + conversation_messages # Run response = llm.invoke(prompt) return {"messages": [response]} **API Reference:**[SystemMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.system.SystemMessage.html) | [ToolNode](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.tool_node.ToolNode) Finally, we compile our application into a single `graph` object. In this case, we are just connecting the steps into a sequence. We also allow the first `query_or_respond` step to "short-circuit" and respond directly to the user if it does not generate a tool call. This allows our application to support conversational experiences-- e.g., responding to generic greetings that may not require a retrieval step from langgraph.graph import ENDfrom langgraph.prebuilt import ToolNode, tools_conditiongraph_builder.add_node(query_or_respond)graph_builder.add_node(tools)graph_builder.add_node(generate)graph_builder.set_entry_point("query_or_respond")graph_builder.add_conditional_edges( "query_or_respond", tools_condition, {END: END, "tools": "tools"},)graph_builder.add_edge("tools", "generate")graph_builder.add_edge("generate", END)graph = graph_builder.compile() **API Reference:**[ToolNode](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.tool_node.ToolNode) | [tools\_condition](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.tool_node.tools_condition) from IPython.display import Image, displaydisplay(Image(graph.get_graph().draw_mermaid_png())) ![]() Let's test our application. Note that it responds appropriately to messages that do not require an additional retrieval step: input_message = "Hello"for step in graph.stream( {"messages": [{"role": "user", "content": input_message}]}, stream_mode="values",): step["messages"][-1].pretty_print() ================================ Human Message =================================Hello================================== Ai Message ==================================Hello! How can I assist you today?\ \ And when executing a search, we can stream the steps to observe the query generation, retrieval, and answer generation:\ \ input_message = "What is Task Decomposition?"for step in graph.stream( {"messages": [{"role": "user", "content": input_message}]}, stream_mode="values",): step["messages"][-1].pretty_print()\ \ ================================ Human Message =================================What is Task Decomposition?================================== Ai Message ==================================Tool Calls: retrieve (call_dLjB3rkMoxZZxwUGXi33UBeh) Call ID: call_dLjB3rkMoxZZxwUGXi33UBeh Args: query: Task Decomposition================================= Tool Message =================================Name: retrieveSource: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Fig. 1. Overview of a LLM-powered autonomous agent system.Component One: Planning#A complicated task usually involves many steps. An agent needs to know what they are and plan ahead.Task Decomposition#Chain of thought (CoT; Wei et al. 2022) has become a standard prompting technique for enhancing model performance on complex tasks. The model is instructed to β€œthink step by step” to utilize more test-time computation to decompose hard tasks into smaller and simpler steps. CoT transforms big tasks into multiple manageable tasks and shed lights into an interpretation of the model’s thinking process.Source: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Tree of Thoughts (Yao et al. 2023) extends CoT by exploring multiple reasoning possibilities at each step. It first decomposes the problem into multiple thought steps and generates multiple thoughts per step, creating a tree structure. The search process can be BFS (breadth-first search) or DFS (depth-first search) with each state evaluated by a classifier (via a prompt) or majority vote.Task decomposition can be done (1) by LLM with simple prompting like "Steps for XYZ.\n1.", "What are the subgoals for achieving XYZ?", (2) by using task-specific instructions; e.g. "Write a story outline." for writing a novel, or (3) with human inputs.================================== Ai Message ==================================Task Decomposition is the process of breaking down a complicated task into smaller, manageable steps. It often involves techniques like Chain of Thought (CoT), which encourages models to think step by step, enhancing performance on complex tasks. This approach allows for a clearer understanding of the task and aids in structuring the problem-solving process.\ \ Check out the LangSmith trace [here](https://smith.langchain.com/public/70110399-01d3-4b4b-9139-cbcd4edf9d6d/r)\ .\ \ ### Stateful management of chat history[​](#stateful-management-of-chat-history "Direct link to Stateful management of chat history")\ \ note\ \ This section of the tutorial previously used the [RunnableWithMessageHistory](https://python.langchain.com/api_reference/core/runnables/langchain_core.runnables.history.RunnableWithMessageHistory.html)\ abstraction. You can access that version of the documentation in the [v0.2 docs](https://python.langchain.com/v0.2/docs/tutorials/chatbot/)\ .\ \ As of the v0.3 release of LangChain, we recommend that LangChain users take advantage of [LangGraph persistence](https://langchain-ai.github.io/langgraph/concepts/persistence/)\ to incorporate `memory` into new LangChain applications.\ \ If your code is already relying on `RunnableWithMessageHistory` or `BaseChatMessageHistory`, you do **not** need to make any changes. We do not plan on deprecating this functionality in the near future as it works for simple chat applications and any code that uses `RunnableWithMessageHistory` will continue to work as expected.\ \ Please see [How to migrate to LangGraph Memory](/docs/versions/migrating_memory/)\ for more details.\ \ In production, the Q&A application will usually persist the chat history into a database, and be able to read and update it appropriately.\ \ [LangGraph](https://langchain-ai.github.io/langgraph/)\ implements a built-in [persistence layer](https://langchain-ai.github.io/langgraph/concepts/persistence/)\ , making it ideal for chat applications that support multiple conversational turns.\ \ To manage multiple conversational turns and threads, all we have to do is specify a [checkpointer](https://langchain-ai.github.io/langgraph/concepts/persistence/)\ when compiling our application. Because the nodes in our graph are appending messages to the state, we will retain a consistent chat history across invocations.\ \ LangGraph comes with a simple in-memory checkpointer, which we use below. See its [documentation](https://langchain-ai.github.io/langgraph/concepts/persistence/)\ for more detail, including how to use different persistence backends (e.g., SQLite or Postgres).\ \ For a detailed walkthrough of how to manage message history, head to the [How to add message history (memory)](/docs/how_to/message_history/)\ guide.\ \ from langgraph.checkpoint.memory import MemorySavermemory = MemorySaver()graph = graph_builder.compile(checkpointer=memory)# Specify an ID for the threadconfig = {"configurable": {"thread_id": "abc123"}}\ \ **API Reference:**[MemorySaver](https://langchain-ai.github.io/langgraph/reference/checkpoints/#langgraph.checkpoint.memory.MemorySaver)\ \ We can now invoke similar to before:\ \ input_message = "What is Task Decomposition?"for step in graph.stream( {"messages": [{"role": "user", "content": input_message}]}, stream_mode="values", config=config,): step["messages"][-1].pretty_print()\ \ ================================ Human Message =================================What is Task Decomposition?================================== Ai Message ==================================Tool Calls: retrieve (call_JZb6GLD812bW2mQsJ5EJQDnN) Call ID: call_JZb6GLD812bW2mQsJ5EJQDnN Args: query: Task Decomposition================================= Tool Message =================================Name: retrieveSource: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Fig. 1. Overview of a LLM-powered autonomous agent system.Component One: Planning#A complicated task usually involves many steps. An agent needs to know what they are and plan ahead.Task Decomposition#Chain of thought (CoT; Wei et al. 2022) has become a standard prompting technique for enhancing model performance on complex tasks. The model is instructed to β€œthink step by step” to utilize more test-time computation to decompose hard tasks into smaller and simpler steps. CoT transforms big tasks into multiple manageable tasks and shed lights into an interpretation of the model’s thinking process.Source: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Tree of Thoughts (Yao et al. 2023) extends CoT by exploring multiple reasoning possibilities at each step. It first decomposes the problem into multiple thought steps and generates multiple thoughts per step, creating a tree structure. The search process can be BFS (breadth-first search) or DFS (depth-first search) with each state evaluated by a classifier (via a prompt) or majority vote.Task decomposition can be done (1) by LLM with simple prompting like "Steps for XYZ.\n1.", "What are the subgoals for achieving XYZ?", (2) by using task-specific instructions; e.g. "Write a story outline." for writing a novel, or (3) with human inputs.================================== Ai Message ==================================Task Decomposition is a technique used to break down complicated tasks into smaller, manageable steps. It involves using methods like Chain of Thought (CoT) prompting, which encourages the model to think step by step, enhancing performance on complex tasks. This process helps to clarify the model's reasoning and makes it easier to tackle difficult problems.\ \ input_message = "Can you look up some common ways of doing it?"for step in graph.stream( {"messages": [{"role": "user", "content": input_message}]}, stream_mode="values", config=config,): step["messages"][-1].pretty_print()\ \ ================================ Human Message =================================Can you look up some common ways of doing it?================================== Ai Message ==================================Tool Calls: retrieve (call_kjRI4Y5cJOiB73yvd7dmb6ux) Call ID: call_kjRI4Y5cJOiB73yvd7dmb6ux Args: query: common methods of task decomposition================================= Tool Message =================================Name: retrieveSource: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Tree of Thoughts (Yao et al. 2023) extends CoT by exploring multiple reasoning possibilities at each step. It first decomposes the problem into multiple thought steps and generates multiple thoughts per step, creating a tree structure. The search process can be BFS (breadth-first search) or DFS (depth-first search) with each state evaluated by a classifier (via a prompt) or majority vote.Task decomposition can be done (1) by LLM with simple prompting like "Steps for XYZ.\n1.", "What are the subgoals for achieving XYZ?", (2) by using task-specific instructions; e.g. "Write a story outline." for writing a novel, or (3) with human inputs.Source: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Fig. 1. Overview of a LLM-powered autonomous agent system.Component One: Planning#A complicated task usually involves many steps. An agent needs to know what they are and plan ahead.Task Decomposition#Chain of thought (CoT; Wei et al. 2022) has become a standard prompting technique for enhancing model performance on complex tasks. The model is instructed to β€œthink step by step” to utilize more test-time computation to decompose hard tasks into smaller and simpler steps. CoT transforms big tasks into multiple manageable tasks and shed lights into an interpretation of the model’s thinking process.================================== Ai Message ==================================Common ways of performing Task Decomposition include: (1) using Large Language Models (LLMs) with simple prompts like "Steps for XYZ" or "What are the subgoals for achieving XYZ?", (2) employing task-specific instructions such as "Write a story outline" for specific tasks, and (3) incorporating human inputs to guide the decomposition process.\ \ Note that the query generated by the model in the second question incorporates the conversational context.\ \ The [LangSmith](https://smith.langchain.com/public/28e6179f-fc56-45e1-9028-447d76352c14/r)\ trace is particularly informative here, as we can see exactly what messages are visible to our chat model at each step.\ \ Agents[​](#agents "Direct link to Agents")\ \ -------------------------------------------\ \ [Agents](/docs/concepts/agents/)\ leverage the reasoning capabilities of LLMs to make decisions during execution. Using agents allows you to offload additional discretion over the retrieval process. Although their behavior is less predictable than the above "chain", they are able to execute multiple retrieval steps in service of a query, or iterate on a single search.\ \ Below we assemble a minimal RAG agent. Using LangGraph's [pre-built ReAct agent constructor](https://langchain-ai.github.io/langgraph/how-tos/#langgraph.prebuilt.chat_agent_executor.create_react_agent)\ , we can do this in one line.\ \ tip\ \ Check out LangGraph's [Agentic RAG](https://langchain-ai.github.io/langgraph/tutorials/rag/langgraph_agentic_rag/)\ tutorial for more advanced formulations.\ \ from langgraph.prebuilt import create_react_agentagent_executor = create_react_agent(llm, [retrieve], checkpointer=memory)\ \ **API Reference:**[create\_react\_agent](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent)\ \ Let's inspect the graph:\ \ display(Image(agent_executor.get_graph().draw_mermaid_png()))\ \ ![]()\ \ The key difference from our earlier implementation is that instead of a final generation step that ends the run, here the tool invocation loops back to the original LLM call. The model can then either answer the question using the retrieved context, or generate another tool call to obtain more information.\ \ Let's test this out. We construct a question that would typically require an iterative sequence of retrieval steps to answer:\ \ config = {"configurable": {"thread_id": "def234"}}input_message = ( "What is the standard method for Task Decomposition?\n\n" "Once you get the answer, look up common extensions of that method.")for event in agent_executor.stream( {"messages": [{"role": "user", "content": input_message}]}, stream_mode="values", config=config,): event["messages"][-1].pretty_print()\ \ ================================ Human Message =================================What is the standard method for Task Decomposition?Once you get the answer, look up common extensions of that method.================================== Ai Message ==================================Tool Calls: retrieve (call_Y3YaIzL71B83Cjqa8d2G0O8N) Call ID: call_Y3YaIzL71B83Cjqa8d2G0O8N Args: query: standard method for Task Decomposition================================= Tool Message =================================Name: retrieveSource: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Tree of Thoughts (Yao et al. 2023) extends CoT by exploring multiple reasoning possibilities at each step. It first decomposes the problem into multiple thought steps and generates multiple thoughts per step, creating a tree structure. The search process can be BFS (breadth-first search) or DFS (depth-first search) with each state evaluated by a classifier (via a prompt) or majority vote.Task decomposition can be done (1) by LLM with simple prompting like "Steps for XYZ.\n1.", "What are the subgoals for achieving XYZ?", (2) by using task-specific instructions; e.g. "Write a story outline." for writing a novel, or (3) with human inputs.Source: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Fig. 1. Overview of a LLM-powered autonomous agent system.Component One: Planning#A complicated task usually involves many steps. An agent needs to know what they are and plan ahead.Task Decomposition#Chain of thought (CoT; Wei et al. 2022) has become a standard prompting technique for enhancing model performance on complex tasks. The model is instructed to β€œthink step by step” to utilize more test-time computation to decompose hard tasks into smaller and simpler steps. CoT transforms big tasks into multiple manageable tasks and shed lights into an interpretation of the model’s thinking process.================================== Ai Message ==================================Tool Calls: retrieve (call_2JntP1x4XQMWwgVpYurE12ff) Call ID: call_2JntP1x4XQMWwgVpYurE12ff Args: query: common extensions of Task Decomposition methods================================= Tool Message =================================Name: retrieveSource: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Tree of Thoughts (Yao et al. 2023) extends CoT by exploring multiple reasoning possibilities at each step. It first decomposes the problem into multiple thought steps and generates multiple thoughts per step, creating a tree structure. The search process can be BFS (breadth-first search) or DFS (depth-first search) with each state evaluated by a classifier (via a prompt) or majority vote.Task decomposition can be done (1) by LLM with simple prompting like "Steps for XYZ.\n1.", "What are the subgoals for achieving XYZ?", (2) by using task-specific instructions; e.g. "Write a story outline." for writing a novel, or (3) with human inputs.Source: {'source': 'https://lilianweng.github.io/posts/2023-06-23-agent/'}Content: Fig. 1. Overview of a LLM-powered autonomous agent system.Component One: Planning#A complicated task usually involves many steps. An agent needs to know what they are and plan ahead.Task Decomposition#Chain of thought (CoT; Wei et al. 2022) has become a standard prompting technique for enhancing model performance on complex tasks. The model is instructed to β€œthink step by step” to utilize more test-time computation to decompose hard tasks into smaller and simpler steps. CoT transforms big tasks into multiple manageable tasks and shed lights into an interpretation of the model’s thinking process.================================== Ai Message ==================================The standard method for task decomposition involves using techniques such as Chain of Thought (CoT), where a model is instructed to "think step by step" to break down complex tasks into smaller, more manageable components. This approach enhances model performance by allowing for more thorough reasoning and planning. Task decomposition can be accomplished through various means, including:1. Simple prompting (e.g., asking for steps to achieve a goal).2. Task-specific instructions (e.g., asking for a story outline).3. Human inputs to guide the decomposition process.### Common Extensions of Task Decomposition Methods:1. **Tree of Thoughts**: This extension builds on CoT by not only decomposing the problem into thought steps but also generating multiple thoughts at each step, creating a tree structure. The search process can employ breadth-first search (BFS) or depth-first search (DFS), with each state evaluated by a classifier or through majority voting.These extensions aim to enhance reasoning capabilities and improve the effectiveness of task decomposition in various contexts.\ \ Note that the agent:\ \ 1. Generates a query to search for a standard method for task decomposition;\ 2. Receiving the answer, generates a second query to search for common extensions of it;\ 3. Having received all necessary context, answers the question.\ \ We can see the full sequence of steps, along with latency and other metadata, in the [LangSmith trace](https://smith.langchain.com/public/48cbd35e-9ac1-49ab-8c09-500d54c06b81/r)\ .\ \ Next steps[​](#next-steps "Direct link to Next steps")\ \ -------------------------------------------------------\ \ We've covered the steps to build a basic conversational Q&A application:\ \ * We used chains to build a predictable application that generates at most one query per user input;\ * We used agents to build an application that can iterate on a sequence of queries.\ \ To explore different types of retrievers and retrieval strategies, visit the [retrievers](/docs/how_to/#retrievers)\ section of the how-to guides.\ \ For a detailed walkthrough of LangChain's conversation memory abstractions, visit the [How to add message history (memory)](/docs/how_to/message_history/)\ guide.\ \ To learn more about agents, check out the [conceptual guide](/docs/concepts/agents/)\ and LangGraph [agent architectures](https://langchain-ai.github.io/langgraph/concepts/agentic_concepts/)\ page.\ \ * * *\ \ #### Was this page helpful?\ \ * [Setup](#setup)\ * [Components](#components)\ \ * [Dependencies](#dependencies)\ \ * [LangSmith](#langsmith)\ \ * [Chains](#chains)\ * [Stateful management of chat history](#stateful-management-of-chat-history)\ \ * [Agents](#agents)\ \ * [Next steps](#next-steps) --- # langchain-text-splitters: 0.3.4 β€” πŸ¦œπŸ”— LangChain documentation [Skip to main content](#main-content) Back to top Ctrl+K [Docs](https://python.langchain.com/) * [GitHub](https://github.com/langchain-ai/langchain "GitHub") * [X / Twitter](https://twitter.com/langchainai "X / Twitter") langchain-text-splitters: 0.3.4[#](#module-langchain_text_splitters "Link to this heading") ============================================================================================ **Text Splitters** are classes for splitting text. **Class hierarchy:** BaseDocumentTransformer \--> TextSplitter \--> TextSplitter \# Example: CharacterTextSplitter RecursiveCharacterTextSplitter \--> TextSplitter Note: **MarkdownHeaderTextSplitter** and [\*\*](#id1) HTMLHeaderTextSplitter do not derive from TextSplitter. **Main helpers:** Document, Tokenizer, Language, LineType, HeaderType [base](base.html#langchain-text-splitters-base) [#](#langchain-text-splitters-base "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`base.Language`](base/langchain_text_splitters.base.Language.html#langchain_text_splitters.base.Language "langchain_text_splitters.base.Language")
(value\[,Β names,Β module,Β ...\]) | Enum of the programming languages. | | [`base.TextSplitter`](base/langchain_text_splitters.base.TextSplitter.html#langchain_text_splitters.base.TextSplitter "langchain_text_splitters.base.TextSplitter")
(chunk\_size,Β chunk\_overlap,Β ...) | Interface for splitting text into chunks. | | [`base.TokenTextSplitter`](base/langchain_text_splitters.base.TokenTextSplitter.html#langchain_text_splitters.base.TokenTextSplitter "langchain_text_splitters.base.TokenTextSplitter")
(\[encoding\_name,Β ...\]) | Splitting text to tokens using model tokenizer. | | [`base.Tokenizer`](base/langchain_text_splitters.base.Tokenizer.html#langchain_text_splitters.base.Tokenizer "langchain_text_splitters.base.Tokenizer")
(chunk\_overlap,Β ...) | Tokenizer data class. | **Functions** | | | | --- | --- | | [`base.split_text_on_tokens`](base/langchain_text_splitters.base.split_text_on_tokens.html#langchain_text_splitters.base.split_text_on_tokens "langchain_text_splitters.base.split_text_on_tokens")
(\*,Β text,Β tokenizer) | Split incoming text and return chunks using tokenizer. | [character](character.html#langchain-text-splitters-character) [#](#langchain-text-splitters-character "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`character.CharacterTextSplitter`](character/langchain_text_splitters.character.CharacterTextSplitter.html#langchain_text_splitters.character.CharacterTextSplitter "langchain_text_splitters.character.CharacterTextSplitter")
(\[separator,Β ...\]) | Splitting text that looks at characters. | | [`character.RecursiveCharacterTextSplitter`](character/langchain_text_splitters.character.RecursiveCharacterTextSplitter.html#langchain_text_splitters.character.RecursiveCharacterTextSplitter "langchain_text_splitters.character.RecursiveCharacterTextSplitter")
(\[...\]) | Splitting text by recursively look at characters. | [html](html.html#langchain-text-splitters-html) [#](#langchain-text-splitters-html "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`html.ElementType`](html/langchain_text_splitters.html.ElementType.html#langchain_text_splitters.html.ElementType "langchain_text_splitters.html.ElementType") | Element type as typed dict. | | [`html.HTMLHeaderTextSplitter`](html/langchain_text_splitters.html.HTMLHeaderTextSplitter.html#langchain_text_splitters.html.HTMLHeaderTextSplitter "langchain_text_splitters.html.HTMLHeaderTextSplitter")
(headers\_to\_split\_on) | Splitting HTML files based on specified headers. | | [`html.HTMLSectionSplitter`](html/langchain_text_splitters.html.HTMLSectionSplitter.html#langchain_text_splitters.html.HTMLSectionSplitter "langchain_text_splitters.html.HTMLSectionSplitter")
(headers\_to\_split\_on) | Splitting HTML files based on specified tag and font sizes. | | [`html.HTMLSemanticPreservingSplitter`](html/langchain_text_splitters.html.HTMLSemanticPreservingSplitter.html#langchain_text_splitters.html.HTMLSemanticPreservingSplitter "langchain_text_splitters.html.HTMLSemanticPreservingSplitter")
(...\[,Β ...\]) | | [json](json.html#langchain-text-splitters-json) [#](#langchain-text-splitters-json "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`json.RecursiveJsonSplitter`](json/langchain_text_splitters.json.RecursiveJsonSplitter.html#langchain_text_splitters.json.RecursiveJsonSplitter "langchain_text_splitters.json.RecursiveJsonSplitter")
(\[max\_chunk\_size,Β ...\]) | Splits JSON data into smaller, structured chunks while preserving hierarchy. | [konlpy](konlpy.html#langchain-text-splitters-konlpy) [#](#langchain-text-splitters-konlpy "Link to this heading") ------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`konlpy.KonlpyTextSplitter`](konlpy/langchain_text_splitters.konlpy.KonlpyTextSplitter.html#langchain_text_splitters.konlpy.KonlpyTextSplitter "langchain_text_splitters.konlpy.KonlpyTextSplitter")
(\[separator\]) | Splitting text using Konlpy package. | [latex](latex.html#langchain-text-splitters-latex) [#](#langchain-text-splitters-latex "Link to this heading") --------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`latex.LatexTextSplitter`](latex/langchain_text_splitters.latex.LatexTextSplitter.html#langchain_text_splitters.latex.LatexTextSplitter "langchain_text_splitters.latex.LatexTextSplitter")
(\*\*kwargs) | Attempts to split the text along Latex-formatted layout elements. | [markdown](markdown.html#langchain-text-splitters-markdown) [#](#langchain-text-splitters-markdown "Link to this heading") --------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`markdown.ExperimentalMarkdownSyntaxTextSplitter`](markdown/langchain_text_splitters.markdown.ExperimentalMarkdownSyntaxTextSplitter.html#langchain_text_splitters.markdown.ExperimentalMarkdownSyntaxTextSplitter "langchain_text_splitters.markdown.ExperimentalMarkdownSyntaxTextSplitter")
(\[...\]) | An experimental text splitter for handling Markdown syntax. | | [`markdown.HeaderType`](markdown/langchain_text_splitters.markdown.HeaderType.html#langchain_text_splitters.markdown.HeaderType "langchain_text_splitters.markdown.HeaderType") | Header type as typed dict. | | [`markdown.LineType`](markdown/langchain_text_splitters.markdown.LineType.html#langchain_text_splitters.markdown.LineType "langchain_text_splitters.markdown.LineType") | Line type as typed dict. | | [`markdown.MarkdownHeaderTextSplitter`](markdown/langchain_text_splitters.markdown.MarkdownHeaderTextSplitter.html#langchain_text_splitters.markdown.MarkdownHeaderTextSplitter "langchain_text_splitters.markdown.MarkdownHeaderTextSplitter")
(...\[,Β ...\]) | Splitting markdown files based on specified headers. | | [`markdown.MarkdownTextSplitter`](markdown/langchain_text_splitters.markdown.MarkdownTextSplitter.html#langchain_text_splitters.markdown.MarkdownTextSplitter "langchain_text_splitters.markdown.MarkdownTextSplitter")
(\*\*kwargs) | Attempts to split the text along Markdown-formatted headings. | [nltk](nltk.html#langchain-text-splitters-nltk) [#](#langchain-text-splitters-nltk "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`nltk.NLTKTextSplitter`](nltk/langchain_text_splitters.nltk.NLTKTextSplitter.html#langchain_text_splitters.nltk.NLTKTextSplitter "langchain_text_splitters.nltk.NLTKTextSplitter")
(\[separator,Β language,Β ...\]) | Splitting text using NLTK package. | [python](python.html#langchain-text-splitters-python) [#](#langchain-text-splitters-python "Link to this heading") ------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`python.PythonCodeTextSplitter`](python/langchain_text_splitters.python.PythonCodeTextSplitter.html#langchain_text_splitters.python.PythonCodeTextSplitter "langchain_text_splitters.python.PythonCodeTextSplitter")
(\*\*kwargs) | Attempts to split the text along Python syntax. | [sentence\_transformers](sentence_transformers.html#langchain-text-splitters-sentence-transformers) [#](#langchain-text-splitters-sentence-transformers "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`sentence_transformers.SentenceTransformersTokenTextSplitter`](sentence_transformers/langchain_text_splitters.sentence_transformers.SentenceTransformersTokenTextSplitter.html#langchain_text_splitters.sentence_transformers.SentenceTransformersTokenTextSplitter "langchain_text_splitters.sentence_transformers.SentenceTransformersTokenTextSplitter")
(\[...\]) | Splitting text to tokens using sentence model tokenizer. | [spacy](spacy.html#langchain-text-splitters-spacy) [#](#langchain-text-splitters-spacy "Link to this heading") --------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`spacy.SpacyTextSplitter`](spacy/langchain_text_splitters.spacy.SpacyTextSplitter.html#langchain_text_splitters.spacy.SpacyTextSplitter "langchain_text_splitters.spacy.SpacyTextSplitter")
(\[separator,Β ...\]) | Splitting text using Spacy package. | --- # Make your first docs PR | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/contributing/tutorials/docs.mdx) This tutorial will guide you through making a simple documentation edit, like correcting a typo. ### **Prerequisites**[​](#prerequisites "Direct link to prerequisites") * GitHub account. * Familiarity with GitHub pull requests (basic understanding). * * * Editing a Documentation Page on GitHub[​](#editing-a-documentation-page-on-github "Direct link to Editing a Documentation Page on GitHub") ------------------------------------------------------------------------------------------------------------------------------------------- Sometimes you want to make a small change, like fixing a typo, and the easiest way to do this is to use GitHub's editor directly. ### **Steps**[​](#steps "Direct link to steps") 1. **Navigate to the documentation page in the LangChain docs:** * On the documentation page, find the green "Edit this page" link at the bottom of the page. * Click the button to be directed to the GitHub editor. * If the file you're editing is a Jupyter Notebook (.ipynb) instead of a Markdown (.md, .mdx) file, we recommend following the steps in section 3. 2. **Fork the repository:** * If you haven't already, GitHub will prompt you to fork the repository to your account. * Make sure to fork the repository into your **personal account and not an organization** ([why?](/docs/contributing/reference/faq/#how-do-i-allow-maintainers-to-edit-my-pr) ). * Click the "Fork this repository" button to create a copy of the repository under your account. * After forking, you'll automatically be redirected to the correct editor. 3. **Make your changes:** * Correct the typo directly in the GitHub editor. 4. **Commit your changes:** * Click the "Commit changes..." button at the top-right corner of the page. * Give your commit a title like "Fix typo in X section." * Optionally, write an extended commit description. * Click "Propose changes" 5. **Submit a pull request (PR):** * GitHub will redirect you to a page where you can create a pull request. * First, review your proposed changes to ensure they are correct. * Click **Create pull request**. * Give your PR a title like `docs: Fix typo in X section`. * Follow the checklist in the PR description template. Getting a Review[​](#getting-a-review "Direct link to Getting a Review") ------------------------------------------------------------------------- Once you've submitted the pull request, it will be reviewed by the maintainers. You may receive feedback or requests for changes. Keep an eye on the PR to address any comments. Docs PRs are typically reviewed within a few days, but it may take longer depending on the complexity of the change and the availability of maintainers. For more information on reviews, see the [Review Process](/docs/contributing/reference/review_process/) . * * * #### Was this page helpful? * [**Prerequisites**](#prerequisites) * [Editing a Documentation Page on GitHub](#editing-a-documentation-page-on-github) * [**Steps**](#steps) * [Getting a Review](#getting-a-review) --- # Build an Extraction Chain | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/extraction.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/extraction.ipynb) In this tutorial, we will use [tool-calling](/docs/concepts/tool_calling/) features of [chat models](/docs/concepts/chat_models/) to extract structured information from unstructured text. We will also demonstrate how to use [few-shot prompting](/docs/concepts/few_shot_prompting/) in this context to improve performance. important This tutorial requires `langchain-core>=0.3.20` and will only work with models that support **tool calling**. Setup[​](#setup "Direct link to Setup") ---------------------------------------- ### Jupyter Notebook[​](#jupyter-notebook "Direct link to Jupyter Notebook") This and other tutorials are perhaps most conveniently run in a [Jupyter notebooks](https://jupyter.org/) . Going through guides in an interactive environment is a great way to better understand them. See [here](https://jupyter.org/install) for instructions on how to install. ### Installation[​](#installation "Direct link to Installation") To install LangChain run: * Pip * Conda pip install --upgrade langchain-core conda install langchain-core -c conda-forge For more details, see our [Installation guide](/docs/how_to/installation/) . ### LangSmith[​](#langsmith "Direct link to LangSmith") Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent. The best way to do this is with [LangSmith](https://smith.langchain.com) . After you sign up at the link above, make sure to set your environment variables to start logging traces: export LANGCHAIN_TRACING_V2="true"export LANGCHAIN_API_KEY="..." Or, if in a notebook, you can set them with: import getpassimport osos.environ["LANGCHAIN_TRACING_V2"] = "true"os.environ["LANGCHAIN_API_KEY"] = getpass.getpass() The Schema[​](#the-schema "Direct link to The Schema") ------------------------------------------------------- First, we need to describe what information we want to extract from the text. We'll use Pydantic to define an example schema to extract personal information. from typing import Optionalfrom pydantic import BaseModel, Fieldclass Person(BaseModel): """Information about a person.""" # ^ Doc-string for the entity Person. # This doc-string is sent to the LLM as the description of the schema Person, # and it can help to improve extraction results. # Note that: # 1. Each field is an `optional` -- this allows the model to decline to extract it! # 2. Each field has a `description` -- this description is used by the LLM. # Having a good description can help improve extraction results. name: Optional[str] = Field(default=None, description="The name of the person") hair_color: Optional[str] = Field( default=None, description="The color of the person's hair if known" ) height_in_meters: Optional[str] = Field( default=None, description="Height measured in meters" ) There are two best practices when defining schema: 1. Document the **attributes** and the **schema** itself: This information is sent to the LLM and is used to improve the quality of information extraction. 2. Do not force the LLM to make up information! Above we used `Optional` for the attributes allowing the LLM to output `None` if it doesn't know the answer. important For best performance, document the schema well and make sure the model isn't force to return results if there's no information to be extracted in the text. The Extractor[​](#the-extractor "Direct link to The Extractor") ---------------------------------------------------------------- Let's create an information extractor using the schema we defined above. from typing import Optionalfrom langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholderfrom pydantic import BaseModel, Field# Define a custom prompt to provide instructions and any additional context.# 1) You can add examples into the prompt template to improve extraction quality# 2) Introduce additional parameters to take context into account (e.g., include metadata# about the document from which the text was extracted.)prompt_template = ChatPromptTemplate.from_messages( [ ( "system", "You are an expert extraction algorithm. " "Only extract relevant information from the text. " "If you do not know the value of an attribute asked to extract, " "return null for the attribute's value.", ), # Please see the how-to about improving performance with # reference examples. # MessagesPlaceholder('examples'), ("human", "{text}"), ]) **API Reference:**[ChatPromptTemplate](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.ChatPromptTemplate.html) | [MessagesPlaceholder](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.MessagesPlaceholder.html) We need to use a model that supports function/tool calling. Please review [the documentation](/docs/concepts/tool_calling/) for all models that can be used with this API. Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAIllm = ChatOpenAI(model="gpt-4o-mini") structured_llm = llm.with_structured_output(schema=Person) Let's test it out: text = "Alan Smith is 6 feet tall and has blond hair."prompt = prompt_template.invoke({"text": text})structured_llm.invoke(prompt) Person(name='Alan Smith', hair_color='blond', height_in_meters='1.83') important Extraction is Generative 🀯 LLMs are generative models, so they can do some pretty cool things like correctly extract the height of the person in meters even though it was provided in feet! We can see the LangSmith trace [here](https://smith.langchain.com/public/44b69a63-3b3b-47b8-8a6d-61b46533f015/r) . Note that the [chat model portion of the trace](https://smith.langchain.com/public/44b69a63-3b3b-47b8-8a6d-61b46533f015/r/dd1f6305-f1e9-4919-bd8f-339d03a12d01) reveals the exact sequence of messages sent to the model, tools invoked, and other metadata. Multiple Entities[​](#multiple-entities "Direct link to Multiple Entities") ---------------------------------------------------------------------------- In **most cases**, you should be extracting a list of entities rather than a single entity. This can be easily achieved using pydantic by nesting models inside one another. from typing import List, Optionalfrom pydantic import BaseModel, Fieldclass Person(BaseModel): """Information about a person.""" # ^ Doc-string for the entity Person. # This doc-string is sent to the LLM as the description of the schema Person, # and it can help to improve extraction results. # Note that: # 1. Each field is an `optional` -- this allows the model to decline to extract it! # 2. Each field has a `description` -- this description is used by the LLM. # Having a good description can help improve extraction results. name: Optional[str] = Field(default=None, description="The name of the person") hair_color: Optional[str] = Field( default=None, description="The color of the person's hair if known" ) height_in_meters: Optional[str] = Field( default=None, description="Height measured in meters" )class Data(BaseModel): """Extracted data about people.""" # Creates a model so that we can extract multiple entities. people: List[Person] important Extraction results might not be perfect here. Read on to see how to use **Reference Examples** to improve the quality of extraction, and check out our extraction [how-to](/docs/how_to/#extraction) guides for more detail. structured_llm = llm.with_structured_output(schema=Data)text = "My name is Jeff, my hair is black and i am 6 feet tall. Anna has the same color hair as me."prompt = prompt_template.invoke({"text": text})structured_llm.invoke(prompt) Data(people=[Person(name='Jeff', hair_color='black', height_in_meters='1.83'), Person(name='Anna', hair_color='black', height_in_meters=None)]) tip When the schema accommodates the extraction of **multiple entities**, it also allows the model to extract **no entities** if no relevant information is in the text by providing an empty list. This is usually a **good** thing! It allows specifying **required** attributes on an entity without necessarily forcing the model to detect this entity. We can see the LangSmith trace [here](https://smith.langchain.com/public/7173764d-5e76-45fe-8496-84460bd9cdef/r) . Reference examples[​](#reference-examples "Direct link to Reference examples") ------------------------------------------------------------------------------- The behavior of LLM applications can be steered using [few-shot prompting](/docs/concepts/few_shot_prompting/) . For [chat models](/docs/concepts/chat_models/) , this can take the form of a sequence of pairs of input and response messages demonstrating desired behaviors. For example, we can convey the meaning of a symbol with alternating `user` and `assistant` [messages](/docs/concepts/messages/#role) : messages = [ {"role": "user", "content": "2 🦜 2"}, {"role": "assistant", "content": "4"}, {"role": "user", "content": "2 🦜 3"}, {"role": "assistant", "content": "5"}, {"role": "user", "content": "3 🦜 4"},]response = llm.invoke(messages)print(response.content) 7 [Structured output](/docs/concepts/structured_outputs/) often uses [tool calling](/docs/concepts/tool_calling/) under-the-hood. This typically involves the generation of [AI messages](/docs/concepts/messages/#aimessage) containing tool calls, as well as [tool messages](/docs/concepts/messages/#toolmessage) containing the results of tool calls. What should a sequence of messages look like in this case? Different [chat model providers](/docs/integrations/chat/) impose different requirements for valid message sequences. Some will accept a (repeating) message sequence of the form: * User message * AI message with tool call * Tool message with result Others require a final AI message containing some sort of response. LangChain includes a utility function [tool\_example\_to\_messages](https://python.langchain.com/api_reference/core/utils/langchain_core.utils.function_calling.tool_example_to_messages.html) that will generate a valid sequence for most model providers. It simplifies the generation of structured few-shot examples by just requiring Pydantic representations of the corresponding tool calls. Let's try this out. We can convert pairs of input strings and desired Pydantic objects to a sequence of messages that can be provided to a chat model. Under the hood, LangChain will format the tool calls to each provider's required format. Note: this version of `tool_example_to_messages` requires `langchain-core>=0.3.20`. from langchain_core.utils.function_calling import tool_example_to_messagesexamples = [ ( "The ocean is vast and blue. It's more than 20,000 feet deep.", Data(people=[]), ), ( "Fiona traveled far from France to Spain.", Data(people=[Person(name="Fiona", height_in_meters=None, hair_color=None)]), ),]messages = []for txt, tool_call in examples: if tool_call.people: # This final message is optional for some providers ai_response = "Detected people." else: ai_response = "Detected no people." messages.extend(tool_example_to_messages(txt, [tool_call], ai_response=ai_response)) **API Reference:**[tool\_example\_to\_messages](https://python.langchain.com/api_reference/core/utils/langchain_core.utils.function_calling.tool_example_to_messages.html) Inspecting the result, we see these two example pairs generated eight messages: for message in messages: message.pretty_print() ================================ Human Message =================================The ocean is vast and blue. It's more than 20,000 feet deep.================================== Ai Message ==================================Tool Calls: Data (d8f2e054-7fb9-417f-b28f-0447a775b2c3) Call ID: d8f2e054-7fb9-417f-b28f-0447a775b2c3 Args: people: []================================= Tool Message =================================You have correctly called this tool.================================== Ai Message ==================================Detected no people.================================ Human Message =================================Fiona traveled far from France to Spain.================================== Ai Message ==================================Tool Calls: Data (0178939e-a4b1-4d2a-a93e-b87f665cdfd6) Call ID: 0178939e-a4b1-4d2a-a93e-b87f665cdfd6 Args: people: [{'name': 'Fiona', 'hair_color': None, 'height_in_meters': None}]================================= Tool Message =================================You have correctly called this tool.================================== Ai Message ==================================Detected people.\ \ Let's compare performance with and without these messages. For example, let's pass a message for which we intend no people to be extracted:\ \ message_no_extraction = { "role": "user", "content": "The solar system is large, but earth has only 1 moon.",}structured_llm = llm.with_structured_output(schema=Data)structured_llm.invoke([message_no_extraction])\ \ Data(people=[Person(name='Earth', hair_color='None', height_in_meters='0.00')])\ \ In this example, the model is liable to erroneously generate records of people.\ \ Because our few-shot examples contain examples of "negatives", we encourage the model to behave correctly in this case:\ \ structured_llm.invoke(messages + [message_no_extraction])\ \ Data(people=[])\ \ tip\ \ The [LangSmith](https://smith.langchain.com/public/b3433f57-7905-4430-923c-fed214525bf1/r)\ trace for the run reveals the exact sequence of messages sent to the chat model, tool calls generated, latency, token counts, and other metadata.\ \ See [this guide](/docs/how_to/extraction_examples/)\ for more detail on extraction workflows with reference examples, including how to incorporate prompt templates and customize the generation of example messages.\ \ Next steps[​](#next-steps "Direct link to Next steps")\ \ -------------------------------------------------------\ \ Now that you understand the basics of extraction with LangChain, you're ready to proceed to the rest of the how-to guides:\ \ * [Add Examples](/docs/how_to/extraction_examples/)\ : More detail on using **reference examples** to improve performance.\ * [Handle Long Text](/docs/how_to/extraction_long_text/)\ : What should you do if the text does not fit into the context window of the LLM?\ * [Use a Parsing Approach](/docs/how_to/extraction_parse/)\ : Use a prompt based approach to extract with models that do not support **tool/function calling**.\ \ * * *\ \ #### Was this page helpful?\ \ * [Setup](#setup)\ * [Jupyter Notebook](#jupyter-notebook)\ \ * [Installation](#installation)\ \ * [LangSmith](#langsmith)\ \ * [The Schema](#the-schema)\ \ * [The Extractor](#the-extractor)\ \ * [Multiple Entities](#multiple-entities)\ \ * [Reference examples](#reference-examples)\ \ * [Next steps](#next-steps) --- # AWS | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/providers/aws.mdx) The `LangChain` integrations related to [Amazon AWS](https://aws.amazon.com/) platform. First-party AWS integrations are available in the `langchain_aws` package. pip install langchain-aws And there are also some community integrations available in the `langchain_community` package with the `boto3` optional dependency. pip install langchain-community boto3 Chat models[​](#chat-models "Direct link to Chat models") ---------------------------------------------------------- ### Bedrock Chat[​](#bedrock-chat "Direct link to Bedrock Chat") > [Amazon Bedrock](https://aws.amazon.com/bedrock/) > is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like `AI21 Labs`, `Anthropic`, `Cohere`, `Meta`, `Stability AI`, and `Amazon` via a single API, along with a broad set of capabilities you need to build generative AI applications with security, privacy, and responsible AI. Using `Amazon Bedrock`, you can easily experiment with and evaluate top FMs for your use case, privately customize them with your data using techniques such as fine-tuning and `Retrieval Augmented Generation` (`RAG`), and build agents that execute tasks using your enterprise systems and data sources. Since `Amazon Bedrock` is serverless, you don't have to manage any infrastructure, and you can securely integrate and deploy generative AI capabilities into your applications using the AWS services you are already familiar with. See a [usage example](/docs/integrations/chat/bedrock/) . from langchain_aws import ChatBedrock **API Reference:**[ChatBedrock](https://python.langchain.com/api_reference/aws/chat_models/langchain_aws.chat_models.bedrock.ChatBedrock.html) ### Bedrock Converse[​](#bedrock-converse "Direct link to Bedrock Converse") AWS has recently released the Bedrock Converse API which provides a unified conversational interface for Bedrock models. This API does not yet support custom models. You can see a list of all [models that are supported here](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html) . To improve reliability the ChatBedrock integration will switch to using the Bedrock Converse API as soon as it has feature parity with the existing Bedrock API. Until then a separate [ChatBedrockConverse](https://python.langchain.com/api_reference/aws/chat_models/langchain_aws.chat_models.bedrock_converse.ChatBedrockConverse.html) integration has been released. We recommend using `ChatBedrockConverse` for users who do not need to use custom models. See the [docs](/docs/integrations/chat/bedrock/#bedrock-converse-api) and [API reference](https://python.langchain.com/api_reference/aws/chat_models/langchain_aws.chat_models.bedrock_converse.ChatBedrockConverse.html) for more detail. from langchain_aws import ChatBedrockConverse **API Reference:**[ChatBedrockConverse](https://python.langchain.com/api_reference/aws/chat_models/langchain_aws.chat_models.bedrock_converse.ChatBedrockConverse.html) LLMs[​](#llms "Direct link to LLMs") ------------------------------------- ### Bedrock[​](#bedrock "Direct link to Bedrock") See a [usage example](/docs/integrations/llms/bedrock/) . from langchain_aws import BedrockLLM **API Reference:**[BedrockLLM](https://python.langchain.com/api_reference/aws/llms/langchain_aws.llms.bedrock.BedrockLLM.html) ### Amazon API Gateway[​](#amazon-api-gateway "Direct link to Amazon API Gateway") > [Amazon API Gateway](https://aws.amazon.com/api-gateway/) > is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. APIs act as the "front door" for applications to access data, business logic, or functionality from your backend services. Using `API Gateway`, you can create RESTful APIs and WebSocket APIs that enable real-time two-way communication applications. `API Gateway` supports containerized and serverless workloads, as well as web applications. > > `API Gateway` handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, CORS support, authorization and access control, throttling, monitoring, and API version management. `API Gateway` has no minimum fees or startup costs. You pay for the API calls you receive and the amount of data transferred out and, with the `API Gateway` tiered pricing model, you can reduce your cost as your API usage scales. See a [usage example](/docs/integrations/llms/amazon_api_gateway/) . from langchain_community.llms import AmazonAPIGateway **API Reference:**[AmazonAPIGateway](https://python.langchain.com/api_reference/community/llms/langchain_community.llms.amazon_api_gateway.AmazonAPIGateway.html) ### SageMaker Endpoint[​](#sagemaker-endpoint "Direct link to SageMaker Endpoint") > [Amazon SageMaker](https://aws.amazon.com/sagemaker/) > is a system that can build, train, and deploy machine learning (ML) models with fully managed infrastructure, tools, and workflows. We use `SageMaker` to host our model and expose it as the `SageMaker Endpoint`. See a [usage example](/docs/integrations/llms/sagemaker/) . from langchain_aws import SagemakerEndpoint **API Reference:**[SagemakerEndpoint](https://python.langchain.com/api_reference/aws/llms/langchain_aws.llms.sagemaker_endpoint.SagemakerEndpoint.html) Embedding Models[​](#embedding-models "Direct link to Embedding Models") ------------------------------------------------------------------------- ### Bedrock[​](#bedrock-1 "Direct link to Bedrock") See a [usage example](/docs/integrations/text_embedding/bedrock/) . from langchain_community.embeddings import BedrockEmbeddings **API Reference:**[BedrockEmbeddings](https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.bedrock.BedrockEmbeddings.html) ### SageMaker Endpoint[​](#sagemaker-endpoint-1 "Direct link to SageMaker Endpoint") See a [usage example](/docs/integrations/text_embedding/sagemaker-endpoint/) . from langchain_community.embeddings import SagemakerEndpointEmbeddingsfrom langchain_community.llms.sagemaker_endpoint import ContentHandlerBase **API Reference:**[SagemakerEndpointEmbeddings](https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.sagemaker_endpoint.SagemakerEndpointEmbeddings.html) | [ContentHandlerBase](https://python.langchain.com/api_reference/community/llms/langchain_community.llms.sagemaker_endpoint.ContentHandlerBase.html) Document loaders[​](#document-loaders "Direct link to Document loaders") ------------------------------------------------------------------------- ### AWS S3 Directory and File[​](#aws-s3-directory-and-file "Direct link to AWS S3 Directory and File") > [Amazon Simple Storage Service (Amazon S3)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html) > is an object storage service. [AWS S3 Directory](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html) > [AWS S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html) See a [usage example for S3DirectoryLoader](/docs/integrations/document_loaders/aws_s3_directory/) . See a [usage example for S3FileLoader](/docs/integrations/document_loaders/aws_s3_file/) . from langchain_community.document_loaders import S3DirectoryLoader, S3FileLoader **API Reference:**[S3DirectoryLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.s3_directory.S3DirectoryLoader.html) | [S3FileLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.s3_file.S3FileLoader.html) ### Amazon Textract[​](#amazon-textract "Direct link to Amazon Textract") > [Amazon Textract](https://docs.aws.amazon.com/managedservices/latest/userguide/textract.html) > is a machine learning (ML) service that automatically extracts text, handwriting, and data from scanned documents. See a [usage example](/docs/integrations/document_loaders/amazon_textract/) . from langchain_community.document_loaders import AmazonTextractPDFLoader **API Reference:**[AmazonTextractPDFLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.pdf.AmazonTextractPDFLoader.html) ### Amazon Athena[​](#amazon-athena "Direct link to Amazon Athena") > [Amazon Athena](https://aws.amazon.com/athena/) > is a serverless, interactive analytics service built on open-source frameworks, supporting open-table and file formats. See a [usage example](/docs/integrations/document_loaders/athena/) . from langchain_community.document_loaders.athena import AthenaLoader **API Reference:**[AthenaLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.athena.AthenaLoader.html) ### AWS Glue[​](#aws-glue "Direct link to AWS Glue") > The [AWS Glue Data Catalog](https://docs.aws.amazon.com/en_en/glue/latest/dg/catalog-and-crawler.html) > is a centralized metadata repository that allows you to manage, access, and share metadata about your data stored in AWS. It acts as a metadata store for your data assets, enabling various AWS services and your applications to query and connect to the data they need efficiently. See a [usage example](/docs/integrations/document_loaders/glue_catalog/) . from langchain_community.document_loaders.glue_catalog import GlueCatalogLoader **API Reference:**[GlueCatalogLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.glue_catalog.GlueCatalogLoader.html) Vector stores[​](#vector-stores "Direct link to Vector stores") ---------------------------------------------------------------- ### Amazon OpenSearch Service[​](#amazon-opensearch-service "Direct link to Amazon OpenSearch Service") > [Amazon OpenSearch Service](https://aws.amazon.com/opensearch-service/) > performs interactive log analytics, real-time application monitoring, website search, and more. `OpenSearch` is an open source, distributed search and analytics suite derived from `Elasticsearch`. `Amazon OpenSearch Service` offers the latest versions of `OpenSearch`, support for many versions of `Elasticsearch`, as well as visualization capabilities powered by `OpenSearch Dashboards` and `Kibana`. We need to install several python libraries. pip install boto3 requests requests-aws4auth See a [usage example](/docs/integrations/vectorstores/opensearch/#using-aos-amazon-opensearch-service) . from langchain_community.vectorstores import OpenSearchVectorSearch **API Reference:**[OpenSearchVectorSearch](https://python.langchain.com/api_reference/community/vectorstores/langchain_community.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html) ### Amazon DocumentDB Vector Search[​](#amazon-documentdb-vector-search "Direct link to Amazon DocumentDB Vector Search") > [Amazon DocumentDB (with MongoDB Compatibility)](https://docs.aws.amazon.com/documentdb/) > makes it easy to set up, operate, and scale MongoDB-compatible databases in the cloud. With Amazon DocumentDB, you can run the same application code and use the same drivers and tools that you use with MongoDB. Vector search for Amazon DocumentDB combines the flexibility and rich querying capability of a JSON-based document database with the power of vector search. #### Installation and Setup[​](#installation-and-setup "Direct link to Installation and Setup") See [detail configuration instructions](/docs/integrations/vectorstores/documentdb/) . We need to install the `pymongo` python package. pip install pymongo #### Deploy DocumentDB on AWS[​](#deploy-documentdb-on-aws "Direct link to Deploy DocumentDB on AWS") [Amazon DocumentDB (with MongoDB Compatibility)](https://docs.aws.amazon.com/documentdb/) is a fast, reliable, and fully managed database service. Amazon DocumentDB makes it easy to set up, operate, and scale MongoDB-compatible databases in the cloud. AWS offers services for computing, databases, storage, analytics, and other functionality. For an overview of all AWS services, see [Cloud Computing with Amazon Web Services](https://aws.amazon.com/what-is-aws/) . See a [usage example](/docs/integrations/vectorstores/documentdb/) . from langchain_community.vectorstores import DocumentDBVectorSearch **API Reference:**[DocumentDBVectorSearch](https://python.langchain.com/api_reference/community/vectorstores/langchain_community.vectorstores.documentdb.DocumentDBVectorSearch.html) ### Amazon MemoryDB[​](#amazon-memorydb "Direct link to Amazon MemoryDB") [Amazon MemoryDB](https://aws.amazon.com/memorydb/) is a durable, in-memory database service that delivers ultra-fast performance. MemoryDB is compatible with Redis OSS, a popular open source data store, enabling you to quickly build applications using the same flexible and friendly Redis OSS APIs, and commands that they already use today. InMemoryVectorStore class provides a vectorstore to connect with Amazon MemoryDB. from langchain_aws.vectorstores.inmemorydb import InMemoryVectorStorevds = InMemoryVectorStore.from_documents( chunks, embeddings, redis_url="rediss://cluster_endpoint:6379/ssl=True ssl_cert_reqs=none", vector_schema=vector_schema, index_name=INDEX_NAME, ) **API Reference:**[InMemoryVectorStore](https://python.langchain.com/api_reference/aws/vectorstores/langchain_aws.vectorstores.inmemorydb.base.InMemoryVectorStore.html) See a [usage example](/docs/integrations/vectorstores/memorydb/) . Retrievers[​](#retrievers "Direct link to Retrievers") ------------------------------------------------------- ### Amazon Kendra[​](#amazon-kendra "Direct link to Amazon Kendra") > [Amazon Kendra](https://docs.aws.amazon.com/kendra/latest/dg/what-is-kendra.html) > is an intelligent search service provided by `Amazon Web Services` (`AWS`). It utilizes advanced natural language processing (NLP) and machine learning algorithms to enable powerful search capabilities across various data sources within an organization. `Kendra` is designed to help users find the information they need quickly and accurately, improving productivity and decision-making. > With `Kendra`, we can search across a wide range of content types, including documents, FAQs, knowledge bases, manuals, and websites. It supports multiple languages and can understand complex queries, synonyms, and contextual meanings to provide highly relevant search results. We need to install the `langchain-aws` library. pip install langchain-aws See a [usage example](/docs/integrations/retrievers/amazon_kendra_retriever/) . from langchain_aws import AmazonKendraRetriever **API Reference:**[AmazonKendraRetriever](https://python.langchain.com/api_reference/aws/retrievers/langchain_aws.retrievers.kendra.AmazonKendraRetriever.html) ### Amazon Bedrock (Knowledge Bases)[​](#amazon-bedrock-knowledge-bases "Direct link to Amazon Bedrock (Knowledge Bases)") > [Knowledge bases for Amazon Bedrock](https://aws.amazon.com/bedrock/knowledge-bases/) > is an `Amazon Web Services` (`AWS`) offering which lets you quickly build RAG applications by using your private data to customize foundation model response. We need to install the `langchain-aws` library. pip install langchain-aws See a [usage example](/docs/integrations/retrievers/bedrock/) . from langchain_aws import AmazonKnowledgeBasesRetriever **API Reference:**[AmazonKnowledgeBasesRetriever](https://python.langchain.com/api_reference/aws/retrievers/langchain_aws.retrievers.bedrock.AmazonKnowledgeBasesRetriever.html) Tools[​](#tools "Direct link to Tools") ---------------------------------------- ### AWS Lambda[​](#aws-lambda "Direct link to AWS Lambda") > [`Amazon AWS Lambda`](https://aws.amazon.com/pm/lambda/) > is a serverless computing service provided by `Amazon Web Services` (`AWS`). It helps developers to build and run applications and services without provisioning or managing servers. This serverless architecture enables you to focus on writing and deploying code, while AWS automatically takes care of scaling, patching, and managing the infrastructure required to run your applications. We need to install `boto3` python library. pip install boto3 See a [usage example](/docs/integrations/tools/awslambda/) . Memory[​](#memory "Direct link to Memory") ------------------------------------------- ### AWS DynamoDB[​](#aws-dynamodb "Direct link to AWS DynamoDB") > [AWS DynamoDB](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/index.html) > is a fully managed `NoSQL` database service that provides fast and predictable performance with seamless scalability. We have to configure the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) . We need to install the `boto3` library. pip install boto3 See a [usage example](/docs/integrations/memory/aws_dynamodb/) . from langchain_community.chat_message_histories import DynamoDBChatMessageHistory **API Reference:**[DynamoDBChatMessageHistory](https://python.langchain.com/api_reference/community/chat_message_histories/langchain_community.chat_message_histories.dynamodb.DynamoDBChatMessageHistory.html) Graphs[​](#graphs "Direct link to Graphs") ------------------------------------------- ### Amazon Neptune with Cypher[​](#amazon-neptune-with-cypher "Direct link to Amazon Neptune with Cypher") See a [usage example](/docs/integrations/graphs/amazon_neptune_open_cypher/) . from langchain_community.graphs import NeptuneGraphfrom langchain_community.graphs import NeptuneAnalyticsGraphfrom langchain_community.chains.graph_qa.neptune_cypher import NeptuneOpenCypherQAChain **API Reference:**[NeptuneGraph](https://python.langchain.com/api_reference/community/graphs/langchain_community.graphs.neptune_graph.NeptuneGraph.html) | [NeptuneAnalyticsGraph](https://python.langchain.com/api_reference/community/graphs/langchain_community.graphs.neptune_graph.NeptuneAnalyticsGraph.html) | [NeptuneOpenCypherQAChain](https://python.langchain.com/api_reference/community/chains/langchain_community.chains.graph_qa.neptune_cypher.NeptuneOpenCypherQAChain.html) ### Amazon Neptune with SPARQL[​](#amazon-neptune-with-sparql "Direct link to Amazon Neptune with SPARQL") See a [usage example](/docs/integrations/graphs/amazon_neptune_sparql/) . from langchain_community.graphs import NeptuneRdfGraphfrom langchain_community.chains.graph_qa.neptune_sparql import NeptuneSparqlQAChain **API Reference:**[NeptuneRdfGraph](https://python.langchain.com/api_reference/community/graphs/langchain_community.graphs.neptune_rdf_graph.NeptuneRdfGraph.html) | [NeptuneSparqlQAChain](https://python.langchain.com/api_reference/community/chains/langchain_community.chains.graph_qa.neptune_sparql.NeptuneSparqlQAChain.html) Callbacks[​](#callbacks "Direct link to Callbacks") ---------------------------------------------------- ### Bedrock token usage[​](#bedrock-token-usage "Direct link to Bedrock token usage") from langchain_community.callbacks.bedrock_anthropic_callback import BedrockAnthropicTokenUsageCallbackHandler **API Reference:**[BedrockAnthropicTokenUsageCallbackHandler](https://python.langchain.com/api_reference/community/callbacks/langchain_community.callbacks.bedrock_anthropic_callback.BedrockAnthropicTokenUsageCallbackHandler.html) ### SageMaker Tracking[​](#sagemaker-tracking "Direct link to SageMaker Tracking") > [Amazon SageMaker](https://aws.amazon.com/sagemaker/) > is a fully managed service that is used to quickly and easily build, train and deploy machine learning (ML) models. > [Amazon SageMaker Experiments](https://docs.aws.amazon.com/sagemaker/latest/dg/experiments.html) > is a capability of `Amazon SageMaker` that lets you organize, track, compare and evaluate ML experiments and model versions. We need to install several python libraries. pip install google-search-results sagemaker See a [usage example](/docs/integrations/callbacks/sagemaker_tracking/) . from langchain_community.callbacks import SageMakerCallbackHandler **API Reference:**[SageMakerCallbackHandler](https://python.langchain.com/api_reference/community/callbacks/langchain_community.callbacks.sagemaker_callback.SageMakerCallbackHandler.html) Chains[​](#chains "Direct link to Chains") ------------------------------------------- ### Amazon Comprehend Moderation Chain[​](#amazon-comprehend-moderation-chain "Direct link to Amazon Comprehend Moderation Chain") > [Amazon Comprehend](https://aws.amazon.com/comprehend/) > is a natural-language processing (NLP) service that uses machine learning to uncover valuable insights and connections in text. We need to install the `boto3` and `nltk` libraries. pip install boto3 nltk See a [usage example](https://python.langchain.com/v0.1/docs/guides/productionization/safety/amazon_comprehend_chain/) . from langchain_experimental.comprehend_moderation import AmazonComprehendModerationChain **API Reference:**[AmazonComprehendModerationChain](https://python.langchain.com/api_reference/experimental/comprehend_moderation/langchain_experimental.comprehend_moderation.amazon_comprehend_moderation.AmazonComprehendModerationChain.html) * * * #### Was this page helpful? * [Chat models](#chat-models) * [Bedrock Chat](#bedrock-chat) * [Bedrock Converse](#bedrock-converse) * [LLMs](#llms) * [Bedrock](#bedrock) * [Amazon API Gateway](#amazon-api-gateway) * [SageMaker Endpoint](#sagemaker-endpoint) * [Embedding Models](#embedding-models) * [Bedrock](#bedrock-1) * [SageMaker Endpoint](#sagemaker-endpoint-1) * [Document loaders](#document-loaders) * [AWS S3 Directory and File](#aws-s3-directory-and-file) * [Amazon Textract](#amazon-textract) * [Amazon Athena](#amazon-athena) * [AWS Glue](#aws-glue) * [Vector stores](#vector-stores) * [Amazon OpenSearch Service](#amazon-opensearch-service) * [Amazon DocumentDB Vector Search](#amazon-documentdb-vector-search) * [Amazon MemoryDB](#amazon-memorydb) * [Retrievers](#retrievers) * [Amazon Kendra](#amazon-kendra) * [Amazon Bedrock (Knowledge Bases)](#amazon-bedrock-knowledge-bases) * [Tools](#tools) * [AWS Lambda](#aws-lambda) * [Memory](#memory) * [AWS DynamoDB](#aws-dynamodb) * [Graphs](#graphs) * [Amazon Neptune with Cypher](#amazon-neptune-with-cypher) * [Amazon Neptune with SPARQL](#amazon-neptune-with-sparql) * [Callbacks](#callbacks) * [Bedrock token usage](#bedrock-token-usage) * [SageMaker Tracking](#sagemaker-tracking) * [Chains](#chains) * [Amazon Comprehend Moderation Chain](#amazon-comprehend-moderation-chain) --- # Google | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/providers/google.mdx) All functionality related to [Google Cloud Platform](https://cloud.google.com/) and other `Google` products. Integration packages for Gemini models and the VertexAI platform are maintained in the [langchain-google](https://github.com/langchain-ai/langchain-google) repository. You can find a host of LangChain integrations with other Google APIs in the [googleapis](https://github.com/googleapis?q=langchain-&type=all&language=&sort=) Github organization. Chat models[​](#chat-models "Direct link to Chat models") ---------------------------------------------------------- We recommend individual developers to start with Gemini API (`langchain-google-genai`) and move to Vertex AI (`langchain-google-vertexai`) when they need access to commercial support and higher rate limits. If you’re already Cloud-friendly or Cloud-native, then you can get started in Vertex AI straight away. Please see [here](https://ai.google.dev/gemini-api/docs/migrate-to-cloud) for more information. ### Google Generative AI[​](#google-generative-ai "Direct link to Google Generative AI") Access GoogleAI `Gemini` models such as `gemini-pro` and `gemini-pro-vision` through the `ChatGoogleGenerativeAI` class. pip install -U langchain-google-genai Configure your API key. export GOOGLE_API_KEY=your-api-key from langchain_google_genai import ChatGoogleGenerativeAIllm = ChatGoogleGenerativeAI(model="gemini-pro")llm.invoke("Sing a ballad of LangChain.") **API Reference:**[ChatGoogleGenerativeAI](https://python.langchain.com/api_reference/google_genai/chat_models/langchain_google_genai.chat_models.ChatGoogleGenerativeAI.html) Gemini vision model supports image inputs when providing a single chat message. from langchain_core.messages import HumanMessagefrom langchain_google_genai import ChatGoogleGenerativeAIllm = ChatGoogleGenerativeAI(model="gemini-pro-vision")message = HumanMessage( content=[ { "type": "text", "text": "What's in this image?", }, # You can optionally provide text parts {"type": "image_url", "image_url": "https://picsum.photos/seed/picsum/200/300"}, ])llm.invoke([message]) **API Reference:**[HumanMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.human.HumanMessage.html) | [ChatGoogleGenerativeAI](https://python.langchain.com/api_reference/google_genai/chat_models/langchain_google_genai.chat_models.ChatGoogleGenerativeAI.html) The value of image\_url can be any of the following: * A public image URL * A gcs file (e.g., "gcs://path/to/file.png") * A local file path * A base64 encoded image (e.g., data:image/png;base64,abcd124) * A PIL image ### Vertex AI[​](#vertex-ai "Direct link to Vertex AI") Access chat models like `Gemini` via Google Cloud. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai See a [usage example](/docs/integrations/chat/google_vertex_ai_palm/) . from langchain_google_vertexai import ChatVertexAI ### Anthropic on Vertex AI Model Garden[​](#anthropic-on-vertex-ai-model-garden "Direct link to Anthropic on Vertex AI Model Garden") See a [usage example](/docs/integrations/llms/google_vertex_ai_palm/) . from langchain_google_vertexai.model_garden import ChatAnthropicVertex ### Llama on Vertex AI Model Garden[​](#llama-on-vertex-ai-model-garden "Direct link to Llama on Vertex AI Model Garden") from langchain_google_vertexai.model_garden_maas.llama import VertexModelGardenLlama ### Mistral on Vertex AI Model Garden[​](#mistral-on-vertex-ai-model-garden "Direct link to Mistral on Vertex AI Model Garden") from langchain_google_vertexai.model_garden_maas.mistral import VertexModelGardenMistral ### Gemma local from Hugging Face[​](#gemma-local-from-hugging-face "Direct link to Gemma local from Hugging Face") > Local `Gemma` model loaded from `HuggingFace`. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.gemma import GemmaChatLocalHF ### Gemma local from Kaggle[​](#gemma-local-from-kaggle "Direct link to Gemma local from Kaggle") > Local `Gemma` model loaded from `Kaggle`. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.gemma import GemmaChatLocalKaggle ### Gemma on Vertex AI Model Garden[​](#gemma-on-vertex-ai-model-garden "Direct link to Gemma on Vertex AI Model Garden") We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.gemma import GemmaChatVertexAIModelGarden ### Vertex AI image captioning[​](#vertex-ai-image-captioning "Direct link to Vertex AI image captioning") > Implementation of the `Image Captioning model` as a chat. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.vision_models import VertexAIImageCaptioningChat ### Vertex AI image editor[​](#vertex-ai-image-editor "Direct link to Vertex AI image editor") > Given an image and a prompt, edit the image. Currently only supports mask-free editing. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.vision_models import VertexAIImageEditorChat ### Vertex AI image generator[​](#vertex-ai-image-generator "Direct link to Vertex AI image generator") > Generates an image from a prompt. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.vision_models import VertexAIImageGeneratorChat ### Vertex AI visual QnA[​](#vertex-ai-visual-qna "Direct link to Vertex AI visual QnA") > Chat implementation of a visual QnA model We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.vision_models import VertexAIVisualQnAChat LLMs[​](#llms "Direct link to LLMs") ------------------------------------- ### Google Generative AI[​](#google-generative-ai-1 "Direct link to Google Generative AI") Access GoogleAI `Gemini` models such as `gemini-pro` and `gemini-pro-vision` through the `GoogleGenerativeAI` class. Install python package. pip install langchain-google-genai See a [usage example](/docs/integrations/llms/google_ai/) . from langchain_google_genai import GoogleGenerativeAI **API Reference:**[GoogleGenerativeAI](https://python.langchain.com/api_reference/google_genai/llms/langchain_google_genai.llms.GoogleGenerativeAI.html) ### Vertex AI Model Garden[​](#vertex-ai-model-garden "Direct link to Vertex AI Model Garden") Access `PaLM` and hundreds of OSS models via `Vertex AI Model Garden` service. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai See a [usage example](/docs/integrations/llms/google_vertex_ai_palm/#vertex-model-garden) . from langchain_google_vertexai import VertexAIModelGarden ### Gemma local from Hugging Face[​](#gemma-local-from-hugging-face-1 "Direct link to Gemma local from Hugging Face") > Local `Gemma` model loaded from `HuggingFace`. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.gemma import GemmaLocalHF ### Gemma local from Kaggle[​](#gemma-local-from-kaggle-1 "Direct link to Gemma local from Kaggle") > Local `Gemma` model loaded from `Kaggle`. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.gemma import GemmaLocalKaggle ### Gemma on Vertex AI Model Garden[​](#gemma-on-vertex-ai-model-garden-1 "Direct link to Gemma on Vertex AI Model Garden") We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.gemma import GemmaVertexAIModelGarden ### Vertex AI image captioning[​](#vertex-ai-image-captioning-1 "Direct link to Vertex AI image captioning") > Implementation of the `Image Captioning model` as an LLM. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.vision_models import VertexAIImageCaptioning Embedding models[​](#embedding-models "Direct link to Embedding models") ------------------------------------------------------------------------- ### Google Generative AI embedding[​](#google-generative-ai-embedding "Direct link to Google Generative AI embedding") See a [usage example](/docs/integrations/text_embedding/google_generative_ai/) . pip install -U langchain-google-genai Configure your API key. export GOOGLE_API_KEY=your-api-key from langchain_google_genai import GoogleGenerativeAIEmbeddings **API Reference:**[GoogleGenerativeAIEmbeddings](https://python.langchain.com/api_reference/google_genai/embeddings/langchain_google_genai.embeddings.GoogleGenerativeAIEmbeddings.html) ### Google Generative AI server-side embedding[​](#google-generative-ai-server-side-embedding "Direct link to Google Generative AI server-side embedding") Install the python package: pip install langchain-google-genai from langchain_google_genai.google_vector_store import ServerSideEmbedding **API Reference:**[ServerSideEmbedding](https://python.langchain.com/api_reference/google_genai/google_vector_store/langchain_google_genai.google_vector_store.ServerSideEmbedding.html) ### Vertex AI[​](#vertex-ai-1 "Direct link to Vertex AI") We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai See a [usage example](/docs/integrations/text_embedding/google_vertex_ai_palm/) . from langchain_google_vertexai import VertexAIEmbeddings ### Palm embedding[​](#palm-embedding "Direct link to Palm embedding") We need to install `langchain-community` python package. pip install langchain-community from langchain_community.embeddings.google_palm import GooglePalmEmbeddings **API Reference:**[GooglePalmEmbeddings](https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.google_palm.GooglePalmEmbeddings.html) Document Loaders[​](#document-loaders "Direct link to Document Loaders") ------------------------------------------------------------------------- ### AlloyDB for PostgreSQL[​](#alloydb-for-postgresql "Direct link to AlloyDB for PostgreSQL") > [Google Cloud AlloyDB](https://cloud.google.com/alloydb) > is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. Install the python package: pip install langchain-google-alloydb-pg See [usage example](/docs/integrations/document_loaders/google_alloydb/) . from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBLoader ### BigQuery[​](#bigquery "Direct link to BigQuery") > [Google Cloud BigQuery](https://cloud.google.com/bigquery) > is a serverless and cost-effective enterprise data warehouse that works across clouds and scales with your data in Google Cloud. We need to install `langchain-google-community` with Big Query dependencies: pip install langchain-google-community[bigquery] See a [usage example](/docs/integrations/document_loaders/google_bigquery/) . from langchain_google_community import BigQueryLoader **API Reference:**[BigQueryLoader](https://python.langchain.com/api_reference/google_community/bigquery/langchain_google_community.bigquery.BigQueryLoader.html) ### Bigtable[​](#bigtable "Direct link to Bigtable") > [Google Cloud Bigtable](https://cloud.google.com/bigtable/docs) > is Google's fully managed NoSQL Big Data database service in Google Cloud. Install the python package: pip install langchain-google-bigtable See [Googel Cloud usage example](/docs/integrations/document_loaders/google_bigtable/) . from langchain_google_bigtable import BigtableLoader ### Cloud SQL for MySQL[​](#cloud-sql-for-mysql "Direct link to Cloud SQL for MySQL") > [Google Cloud SQL for MySQL](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your MySQL relational databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-mysql See [usage example](/docs/integrations/document_loaders/google_cloud_sql_mysql/) . from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLLoader ### Cloud SQL for SQL Server[​](#cloud-sql-for-sql-server "Direct link to Cloud SQL for SQL Server") > [Google Cloud SQL for SQL Server](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your SQL Server databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-mssql See [usage example](/docs/integrations/document_loaders/google_cloud_sql_mssql/) . from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLLoader ### Cloud SQL for PostgreSQL[​](#cloud-sql-for-postgresql "Direct link to Cloud SQL for PostgreSQL") > [Google Cloud SQL for PostgreSQL](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-pg See [usage example](/docs/integrations/document_loaders/google_cloud_sql_pg/) . from langchain_google_cloud_sql_pg import PostgresEngine, PostgresLoader ### Cloud Storage[​](#cloud-storage "Direct link to Cloud Storage") > [Cloud Storage](https://en.wikipedia.org/wiki/Google_Cloud_Storage) > is a managed service for storing unstructured data in Google Cloud. We need to install `langchain-google-community` with Google Cloud Storage dependencies. pip install langchain-google-community[gcs] There are two loaders for the `Google Cloud Storage`: the `Directory` and the `File` loaders. See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_directory/) . from langchain_google_community import GCSDirectoryLoader **API Reference:**[GCSDirectoryLoader](https://python.langchain.com/api_reference/google_community/gcs_directory/langchain_google_community.gcs_directory.GCSDirectoryLoader.html) See a [usage example](/docs/integrations/document_loaders/google_cloud_storage_file/) . from langchain_google_community import GCSFileLoader **API Reference:**[GCSFileLoader](https://python.langchain.com/api_reference/google_community/gcs_file/langchain_google_community.gcs_file.GCSFileLoader.html) ### Cloud Vision loader[​](#cloud-vision-loader "Direct link to Cloud Vision loader") Install the python package: pip install langchain-google-community[vision] from langchain_google_community.vision import CloudVisionLoader **API Reference:**[CloudVisionLoader](https://python.langchain.com/api_reference/google_community/vision/langchain_google_community.vision.CloudVisionLoader.html) ### El Carro for Oracle Workloads[​](#el-carro-for-oracle-workloads "Direct link to El Carro for Oracle Workloads") > Google [El Carro Oracle Operator](https://github.com/GoogleCloudPlatform/elcarro-oracle-operator) > offers a way to run Oracle databases in Kubernetes as a portable, open source, community driven, no vendor lock-in container orchestration system. pip install langchain-google-el-carro See [usage example](/docs/integrations/document_loaders/google_el_carro/) . from langchain_google_el_carro import ElCarroLoader ### Google Drive[​](#google-drive "Direct link to Google Drive") > [Google Drive](https://en.wikipedia.org/wiki/Google_Drive) > is a file storage and synchronization service developed by Google. Currently, only `Google Docs` are supported. We need to install `langchain-google-community` with Google Drive dependencies. pip install langchain-google-community[drive] See a [usage example and authorization instructions](/docs/integrations/document_loaders/google_drive/) . from langchain_google_community import GoogleDriveLoader **API Reference:**[GoogleDriveLoader](https://python.langchain.com/api_reference/google_community/drive/langchain_google_community.drive.GoogleDriveLoader.html) ### Firestore (Native Mode)[​](#firestore-native-mode "Direct link to Firestore (Native Mode)") > [Google Cloud Firestore](https://cloud.google.com/firestore/docs/) > is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Install the python package: pip install langchain-google-firestore See [usage example](/docs/integrations/document_loaders/google_firestore/) . from langchain_google_firestore import FirestoreLoader ### Firestore (Datastore Mode)[​](#firestore-datastore-mode "Direct link to Firestore (Datastore Mode)") > [Google Cloud Firestore in Datastore mode](https://cloud.google.com/datastore/docs) > is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Firestore is the newest version of Datastore and introduces several improvements over Datastore. Install the python package: pip install langchain-google-datastore See [usage example](/docs/integrations/document_loaders/google_datastore/) . from langchain_google_datastore import DatastoreLoader ### Memorystore for Redis[​](#memorystore-for-redis "Direct link to Memorystore for Redis") > [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) > is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. Install the python package: pip install langchain-google-memorystore-redis See [usage example](/docs/integrations/document_loaders/google_memorystore_redis/) . from langchain_google_memorystore_redis import MemorystoreDocumentLoader ### Spanner[​](#spanner "Direct link to Spanner") > [Google Cloud Spanner](https://cloud.google.com/spanner/docs) > is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. Install the python package: pip install langchain-google-spanner See [usage example](/docs/integrations/document_loaders/google_spanner/) . from langchain_google_spanner import SpannerLoader ### Speech-to-Text[​](#speech-to-text "Direct link to Speech-to-Text") > [Google Cloud Speech-to-Text](https://cloud.google.com/speech-to-text) > is an audio transcription API powered by Google's speech recognition models in Google Cloud. This document loader transcribes audio files and outputs the text results as Documents. First, we need to install `langchain-google-community` with speech-to-text dependencies. pip install langchain-google-community[speech] See a [usage example and authorization instructions](/docs/integrations/document_loaders/google_speech_to_text/) . from langchain_google_community import SpeechToTextLoader **API Reference:**[SpeechToTextLoader](https://python.langchain.com/api_reference/google_community/google_speech_to_text/langchain_google_community.google_speech_to_text.SpeechToTextLoader.html) Document Transformers[​](#document-transformers "Direct link to Document Transformers") ---------------------------------------------------------------------------------------- ### Document AI[​](#document-ai "Direct link to Document AI") > [Google Cloud Document AI](https://cloud.google.com/document-ai/docs/overview) > is a Google Cloud service that transforms unstructured data from documents into structured data, making it easier to understand, analyze, and consume. We need to set up a [`GCS` bucket and create your own OCR processor](https://cloud.google.com/document-ai/docs/create-processor) The `GCS_OUTPUT_PATH` should be a path to a folder on GCS (starting with `gs://`) and a processor name should look like `projects/PROJECT_NUMBER/locations/LOCATION/processors/PROCESSOR_ID`. We can get it either programmatically or copy from the `Prediction endpoint` section of the `Processor details` tab in the Google Cloud Console. pip install langchain-google-community[docai] See a [usage example](/docs/integrations/document_transformers/google_docai/) . from langchain_core.document_loaders.blob_loaders import Blobfrom langchain_google_community import DocAIParser **API Reference:**[Blob](https://python.langchain.com/api_reference/core/documents/langchain_core.documents.base.Blob.html) | [DocAIParser](https://python.langchain.com/api_reference/google_community/docai/langchain_google_community.docai.DocAIParser.html) ### Google Translate[​](#google-translate "Direct link to Google Translate") > [Google Translate](https://translate.google.com/) > is a multilingual neural machine translation service developed by Google to translate text, documents and websites from one language into another. The `GoogleTranslateTransformer` allows you to translate text and HTML with the [Google Cloud Translation API](https://cloud.google.com/translate) . First, we need to install the `langchain-google-community` with translate dependencies. pip install langchain-google-community[translate] See a [usage example and authorization instructions](/docs/integrations/document_transformers/google_translate/) . from langchain_google_community import GoogleTranslateTransformer **API Reference:**[GoogleTranslateTransformer](https://python.langchain.com/api_reference/google_community/translate/langchain_google_community.translate.GoogleTranslateTransformer.html) Vector Stores[​](#vector-stores "Direct link to Vector Stores") ---------------------------------------------------------------- ### AlloyDB for PostgreSQL[​](#alloydb-for-postgresql-1 "Direct link to AlloyDB for PostgreSQL") > [Google Cloud AlloyDB](https://cloud.google.com/alloydb) > is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. Install the python package: pip install langchain-google-alloydb-pg See [usage example](/docs/integrations/vectorstores/google_alloydb/) . from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBVectorStore ### BigQuery Vector Search[​](#bigquery-vector-search "Direct link to BigQuery Vector Search") > [Google Cloud BigQuery](https://cloud.google.com/bigquery) > , BigQuery is a serverless and cost-effective enterprise data warehouse in Google Cloud. > > [Google Cloud BigQuery Vector Search](https://cloud.google.com/bigquery/docs/vector-search-intro) > BigQuery vector search lets you use GoogleSQL to do semantic search, using vector indexes for fast but approximate results, or using brute force for exact results. > It can calculate Euclidean or Cosine distance. With LangChain, we default to use Euclidean distance. We need to install several python packages. pip install google-cloud-bigquery See a [usage example](/docs/integrations/vectorstores/google_bigquery_vector_search/) . from langchain.vectorstores import BigQueryVectorSearch ### Memorystore for Redis[​](#memorystore-for-redis-1 "Direct link to Memorystore for Redis") > [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) > is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. Install the python package: pip install langchain-google-memorystore-redis See [usage example](/docs/integrations/vectorstores/google_memorystore_redis/) . from langchain_google_memorystore_redis import RedisVectorStore ### Spanner[​](#spanner-1 "Direct link to Spanner") > [Google Cloud Spanner](https://cloud.google.com/spanner/docs) > is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. Install the python package: pip install langchain-google-spanner See [usage example](/docs/integrations/vectorstores/google_spanner/) . from langchain_google_spanner import SpannerVectorStore ### Firestore (Native Mode)[​](#firestore-native-mode-1 "Direct link to Firestore (Native Mode)") > [Google Cloud Firestore](https://cloud.google.com/firestore/docs/) > is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Install the python package: pip install langchain-google-firestore See [usage example](/docs/integrations/vectorstores/google_firestore/) . from langchain_google_firestore import FirestoreVectorStore ### Cloud SQL for MySQL[​](#cloud-sql-for-mysql-1 "Direct link to Cloud SQL for MySQL") > [Google Cloud SQL for MySQL](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your MySQL relational databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-mysql See [usage example](/docs/integrations/vectorstores/google_cloud_sql_mysql/) . from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLVectorStore ### Cloud SQL for PostgreSQL[​](#cloud-sql-for-postgresql-1 "Direct link to Cloud SQL for PostgreSQL") > [Google Cloud SQL for PostgreSQL](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-pg See [usage example](/docs/integrations/vectorstores/google_cloud_sql_pg/) . from langchain_google_cloud_sql_pg import PostgresEngine, PostgresVectorStore ### Vertex AI Vector Search[​](#vertex-ai-vector-search "Direct link to Vertex AI Vector Search") > [Google Cloud Vertex AI Vector Search](https://cloud.google.com/vertex-ai/docs/vector-search/overview) > from Google Cloud, formerly known as `Vertex AI Matching Engine`, provides the industry's leading high-scale low latency vector database. These vector databases are commonly referred to as vector similarity-matching or an approximate nearest neighbor (ANN) service. Install the python package: pip install langchain-google-vertexai See a [usage example](/docs/integrations/vectorstores/google_vertex_ai_vector_search/) . from langchain_google_vertexai import VectorSearchVectorStore ### Vertex AI Vector Search with DataStore[​](#vertex-ai-vector-search-with-datastore "Direct link to Vertex AI Vector Search with DataStore") > VectorSearch with DatasTore document storage. Install the python package: pip install langchain-google-vertexai See a [usage example](/docs/integrations/vectorstores/google_vertex_ai_vector_search/#optional--you-can-also-create-vectore-and-store-chunks-in-a-datastore) . from langchain_google_vertexai import VectorSearchVectorStoreDatastore ### VectorSearchVectorStoreGCS[​](#vectorsearchvectorstoregcs "Direct link to VectorSearchVectorStoreGCS") > Alias of `VectorSearchVectorStore` for consistency with the rest of vector stores with different document storage backends. Install the python package: pip install langchain-google-vertexai from langchain_google_vertexai import VectorSearchVectorStoreGCS ### Google Generative AI Vector Store[​](#google-generative-ai-vector-store "Direct link to Google Generative AI Vector Store") > Currently, it computes the embedding vectors on the server side. For more information visit [Guide](https://developers.generativeai.google/guide) > . Install the python package: pip install langchain-google-genai from langchain_google_genai.google_vector_store import GoogleVectorStore **API Reference:**[GoogleVectorStore](https://python.langchain.com/api_reference/google_genai/google_vector_store/langchain_google_genai.google_vector_store.GoogleVectorStore.html) ### ScaNN[​](#scann "Direct link to ScaNN") > [Google ScaNN](https://github.com/google-research/google-research/tree/master/scann) > (Scalable Nearest Neighbors) is a python package. > > `ScaNN` is a method for efficient vector similarity search at scale. > `ScaNN` includes search space pruning and quantization for Maximum Inner Product Search and also supports other distance functions such as Euclidean distance. The implementation is optimized for x86 processors with AVX2 support. See its [Google Research github](https://github.com/google-research/google-research/tree/master/scann) > for more details. We need to install `scann` python package. pip install scann See a [usage example](/docs/integrations/vectorstores/scann/) . from langchain_community.vectorstores import ScaNN **API Reference:**[ScaNN](https://python.langchain.com/api_reference/community/vectorstores/langchain_community.vectorstores.scann.ScaNN.html) Retrievers[​](#retrievers "Direct link to Retrievers") ------------------------------------------------------- ### Google Drive[​](#google-drive-1 "Direct link to Google Drive") We need to install several python packages. pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib langchain-googledrive See a [usage example and authorization instructions](/docs/integrations/retrievers/google_drive/) . from langchain_googledrive.retrievers import GoogleDriveRetriever ### Vertex AI Search[​](#vertex-ai-search "Direct link to Vertex AI Search") > [Vertex AI Search](https://cloud.google.com/generative-ai-app-builder/docs/introduction) > from Google Cloud allows developers to quickly build generative AI powered search engines for customers and employees. See a [usage example](/docs/integrations/retrievers/google_vertex_ai_search/) . Note: `GoogleVertexAISearchRetriever` is deprecated, use `VertexAIMultiTurnSearchRetriever`, `VertexAISearchSummaryTool`, and `VertexAISearchRetriever` (see below). #### GoogleVertexAISearchRetriever[​](#googlevertexaisearchretriever "Direct link to GoogleVertexAISearchRetriever") We need to install the `google-cloud-discoveryengine` python package. pip install google-cloud-discoveryengine from langchain_community.retrievers import GoogleVertexAISearchRetriever **API Reference:**[GoogleVertexAISearchRetriever](https://python.langchain.com/api_reference/community/retrievers/langchain_community.retrievers.google_vertex_ai_search.GoogleVertexAISearchRetriever.html) #### VertexAIMultiTurnSearchRetriever[​](#vertexaimultiturnsearchretriever "Direct link to VertexAIMultiTurnSearchRetriever") from langchain_google_community import VertexAIMultiTurnSearchRetriever **API Reference:**[VertexAIMultiTurnSearchRetriever](https://python.langchain.com/api_reference/google_community/vertex_ai_search/langchain_google_community.vertex_ai_search.VertexAIMultiTurnSearchRetriever.html) #### VertexAISearchRetriever[​](#vertexaisearchretriever "Direct link to VertexAISearchRetriever") from langchain_google_community import VertexAIMultiTurnSearchRetriever **API Reference:**[VertexAIMultiTurnSearchRetriever](https://python.langchain.com/api_reference/google_community/vertex_ai_search/langchain_google_community.vertex_ai_search.VertexAIMultiTurnSearchRetriever.html) #### VertexAISearchSummaryTool[​](#vertexaisearchsummarytool "Direct link to VertexAISearchSummaryTool") from langchain_google_community import VertexAISearchSummaryTool **API Reference:**[VertexAISearchSummaryTool](https://python.langchain.com/api_reference/google_community/vertex_ai_search/langchain_google_community.vertex_ai_search.VertexAISearchSummaryTool.html) ### Document AI Warehouse[​](#document-ai-warehouse "Direct link to Document AI Warehouse") > [Document AI Warehouse](https://cloud.google.com/document-ai-warehouse) > from Google Cloud allows enterprises to search, store, govern, and manage documents and their AI-extracted data and metadata in a single platform. Note: `GoogleDocumentAIWarehouseRetriever` is deprecated, use `DocumentAIWarehouseRetriever` (see below). from langchain.retrievers import GoogleDocumentAIWarehouseRetrieverdocai_wh_retriever = GoogleDocumentAIWarehouseRetriever( project_number=...)query = ...documents = docai_wh_retriever.invoke( query, user_ldap=...) **API Reference:**[GoogleDocumentAIWarehouseRetriever](https://python.langchain.com/api_reference/community/retrievers/langchain_community.retrievers.google_cloud_documentai_warehouse.GoogleDocumentAIWarehouseRetriever.html) from langchain_google_community.documentai_warehouse import DocumentAIWarehouseRetriever **API Reference:**[DocumentAIWarehouseRetriever](https://python.langchain.com/api_reference/google_community/documentai_warehouse/langchain_google_community.documentai_warehouse.DocumentAIWarehouseRetriever.html) Tools[​](#tools "Direct link to Tools") ---------------------------------------- ### Text-to-Speech[​](#text-to-speech "Direct link to Text-to-Speech") > [Google Cloud Text-to-Speech](https://cloud.google.com/text-to-speech) > is a Google Cloud service that enables developers to synthesize natural-sounding speech with 100+ voices, available in multiple languages and variants. It applies DeepMind’s groundbreaking research in WaveNet and Google’s powerful neural networks to deliver the highest fidelity possible. We need to install python packages. pip install google-cloud-text-to-speech langchain-google-community See a [usage example and authorization instructions](/docs/integrations/tools/google_cloud_texttospeech/) . from langchain_google_community import TextToSpeechTool **API Reference:**[TextToSpeechTool](https://python.langchain.com/api_reference/google_community/texttospeech/langchain_google_community.texttospeech.TextToSpeechTool.html) ### Google Drive[​](#google-drive-2 "Direct link to Google Drive") We need to install several python packages. pip install google-api-python-client google-auth-httplib2 google-auth-oauthlibpip install langchain-googledrive See a [usage example and authorization instructions](/docs/integrations/tools/google_drive/) . from langchain_googledrive.utilities.google_drive import GoogleDriveAPIWrapperfrom langchain_googledrive.tools.google_drive.tool import GoogleDriveSearchTool ### Google Finance[​](#google-finance "Direct link to Google Finance") We need to install a python package. pip install google-search-results See a [usage example and authorization instructions](/docs/integrations/tools/google_finance/) . from langchain_community.tools.google_finance import GoogleFinanceQueryRunfrom langchain_community.utilities.google_finance import GoogleFinanceAPIWrapper **API Reference:**[GoogleFinanceQueryRun](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_finance.tool.GoogleFinanceQueryRun.html) | [GoogleFinanceAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.google_finance.GoogleFinanceAPIWrapper.html) ### Google Jobs[​](#google-jobs "Direct link to Google Jobs") We need to install a python package. pip install google-search-results See a [usage example and authorization instructions](/docs/integrations/tools/google_jobs/) . from langchain_community.tools.google_jobs import GoogleJobsQueryRunfrom langchain_community.utilities.google_finance import GoogleFinanceAPIWrapper **API Reference:**[GoogleJobsQueryRun](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_jobs.tool.GoogleJobsQueryRun.html) | [GoogleFinanceAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.google_finance.GoogleFinanceAPIWrapper.html) ### Google Lens[​](#google-lens "Direct link to Google Lens") See a [usage example and authorization instructions](/docs/integrations/tools/google_lens/) . from langchain_community.tools.google_lens import GoogleLensQueryRunfrom langchain_community.utilities.google_lens import GoogleLensAPIWrapper **API Reference:**[GoogleLensQueryRun](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_lens.tool.GoogleLensQueryRun.html) | [GoogleLensAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.google_lens.GoogleLensAPIWrapper.html) ### Google Places[​](#google-places "Direct link to Google Places") We need to install a python package. pip install googlemaps See a [usage example and authorization instructions](/docs/integrations/tools/google_places/) . from langchain.tools import GooglePlacesTool **API Reference:**[GooglePlacesTool](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_places.tool.GooglePlacesTool.html) ### Google Scholar[​](#google-scholar "Direct link to Google Scholar") We need to install a python package. pip install google-search-results See a [usage example and authorization instructions](/docs/integrations/tools/google_scholar/) . from langchain_community.tools.google_scholar import GoogleScholarQueryRunfrom langchain_community.utilities.google_scholar import GoogleScholarAPIWrapper **API Reference:**[GoogleScholarQueryRun](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_scholar.tool.GoogleScholarQueryRun.html) | [GoogleScholarAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.google_scholar.GoogleScholarAPIWrapper.html) ### Google Search[​](#google-search "Direct link to Google Search") * Set up a Custom Search Engine, following [these instructions](https://stackoverflow.com/questions/37083058/programmatically-searching-google-in-python-using-custom-search) * Get an API Key and Custom Search Engine ID from the previous step, and set them as environment variables `GOOGLE_API_KEY` and `GOOGLE_CSE_ID` respectively. from langchain_google_community import GoogleSearchAPIWrapper **API Reference:**[GoogleSearchAPIWrapper](https://python.langchain.com/api_reference/google_community/search/langchain_google_community.search.GoogleSearchAPIWrapper.html) For a more detailed walkthrough of this wrapper, see [this notebook](/docs/integrations/tools/google_search/) . We can easily load this wrapper as a Tool (to use with an Agent). We can do this with: from langchain.agents import load_toolstools = load_tools(["google-search"]) **API Reference:**[load\_tools](https://python.langchain.com/api_reference/community/agent_toolkits/langchain_community.agent_toolkits.load_tools.load_tools.html) #### GoogleSearchResults[​](#googlesearchresults "Direct link to GoogleSearchResults") Tool that queries the `Google Search` API (via `GoogleSearchAPIWrapper`) and gets back JSON. from langchain_community.tools import GoogleSearchResults **API Reference:**[GoogleSearchResults](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_search.tool.GoogleSearchResults.html) #### GoogleSearchRun[​](#googlesearchrun "Direct link to GoogleSearchRun") Tool that queries the `Google Search` API (via `GoogleSearchAPIWrapper`). from langchain_community.tools import GoogleSearchRun **API Reference:**[GoogleSearchRun](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_search.tool.GoogleSearchRun.html) ### Google Trends[​](#google-trends "Direct link to Google Trends") We need to install a python package. pip install google-search-results See a [usage example and authorization instructions](/docs/integrations/tools/google_trends/) . from langchain_community.tools.google_trends import GoogleTrendsQueryRunfrom langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper **API Reference:**[GoogleTrendsQueryRun](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.google_trends.tool.GoogleTrendsQueryRun.html) | [GoogleTrendsAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.google_trends.GoogleTrendsAPIWrapper.html) Toolkits[​](#toolkits "Direct link to Toolkits") ------------------------------------------------- ### GMail[​](#gmail "Direct link to GMail") > [Google Gmail](https://en.wikipedia.org/wiki/Gmail) > is a free email service provided by Google. This toolkit works with emails through the `Gmail API`. We need to install `langchain-google-community` with required dependencies: pip install langchain-google-community[gmail] See a [usage example and authorization instructions](/docs/integrations/tools/gmail/) . from langchain_google_community import GmailToolkit **API Reference:**[GmailToolkit](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.toolkit.GmailToolkit.html) #### GMail individual tools[​](#gmail-individual-tools "Direct link to GMail individual tools") You can use individual tools from GMail Toolkit. from langchain_google_community.gmail.create_draft import GmailCreateDraftfrom langchain_google_community.gmail.get_message import GmailGetMessagefrom langchain_google_community.gmail.get_thread import GmailGetThreadfrom langchain_google_community.gmail.search import GmailSearchfrom langchain_google_community.gmail.send_message import GmailSendMessage **API Reference:**[GmailCreateDraft](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.create_draft.GmailCreateDraft.html) | [GmailGetMessage](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.get_message.GmailGetMessage.html) | [GmailGetThread](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.get_thread.GmailGetThread.html) | [GmailSearch](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.search.GmailSearch.html) | [GmailSendMessage](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.send_message.GmailSendMessage.html) Memory[​](#memory "Direct link to Memory") ------------------------------------------- ### AlloyDB for PostgreSQL[​](#alloydb-for-postgresql-2 "Direct link to AlloyDB for PostgreSQL") > [AlloyDB for PostgreSQL](https://cloud.google.com/alloydb) > is a fully managed relational database service that offers high performance, seamless integration, and impressive scalability on Google Cloud. AlloyDB is 100% compatible with PostgreSQL. Install the python package: pip install langchain-google-alloydb-pg See [usage example](/docs/integrations/memory/google_alloydb/) . from langchain_google_alloydb_pg import AlloyDBEngine, AlloyDBChatMessageHistory ### Cloud SQL for PostgreSQL[​](#cloud-sql-for-postgresql-2 "Direct link to Cloud SQL for PostgreSQL") > [Cloud SQL for PostgreSQL](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your PostgreSQL relational databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-pg See [usage example](/docs/integrations/memory/google_sql_pg/) . from langchain_google_cloud_sql_pg import PostgresEngine, PostgresChatMessageHistory ### Cloud SQL for MySQL[​](#cloud-sql-for-mysql-2 "Direct link to Cloud SQL for MySQL") > [Cloud SQL for MySQL](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your MySQL relational databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-mysql See [usage example](/docs/integrations/memory/google_sql_mysql/) . from langchain_google_cloud_sql_mysql import MySQLEngine, MySQLChatMessageHistory ### Cloud SQL for SQL Server[​](#cloud-sql-for-sql-server-1 "Direct link to Cloud SQL for SQL Server") > [Cloud SQL for SQL Server](https://cloud.google.com/sql) > is a fully-managed database service that helps you set up, maintain, manage, and administer your SQL Server databases on Google Cloud. Install the python package: pip install langchain-google-cloud-sql-mssql See [usage example](/docs/integrations/memory/google_sql_mssql/) . from langchain_google_cloud_sql_mssql import MSSQLEngine, MSSQLChatMessageHistory ### Spanner[​](#spanner-2 "Direct link to Spanner") > [Google Cloud Spanner](https://cloud.google.com/spanner/docs) > is a fully managed, mission-critical, relational database service on Google Cloud that offers transactional consistency at global scale, automatic, synchronous replication for high availability, and support for two SQL dialects: GoogleSQL (ANSI 2011 with extensions) and PostgreSQL. Install the python package: pip install langchain-google-spanner See [usage example](/docs/integrations/memory/google_spanner/) . from langchain_google_spanner import SpannerChatMessageHistory ### Memorystore for Redis[​](#memorystore-for-redis-2 "Direct link to Memorystore for Redis") > [Google Cloud Memorystore for Redis](https://cloud.google.com/memorystore/docs/redis) > is a fully managed Redis service for Google Cloud. Applications running on Google Cloud can achieve extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments. Install the python package: pip install langchain-google-memorystore-redis See [usage example](/docs/integrations/document_loaders/google_memorystore_redis/) . from langchain_google_memorystore_redis import MemorystoreChatMessageHistory ### Bigtable[​](#bigtable-1 "Direct link to Bigtable") > [Google Cloud Bigtable](https://cloud.google.com/bigtable/docs) > is Google's fully managed NoSQL Big Data database service in Google Cloud. Install the python package: pip install langchain-google-bigtable See [usage example](/docs/integrations/memory/google_bigtable/) . from langchain_google_bigtable import BigtableChatMessageHistory ### Firestore (Native Mode)[​](#firestore-native-mode-2 "Direct link to Firestore (Native Mode)") > [Google Cloud Firestore](https://cloud.google.com/firestore/docs/) > is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Install the python package: pip install langchain-google-firestore See [usage example](/docs/integrations/memory/google_firestore/) . from langchain_google_firestore import FirestoreChatMessageHistory ### Firestore (Datastore Mode)[​](#firestore-datastore-mode-1 "Direct link to Firestore (Datastore Mode)") > [Google Cloud Firestore in Datastore mode](https://cloud.google.com/datastore/docs) > is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Firestore is the newest version of Datastore and introduces several improvements over Datastore. Install the python package: pip install langchain-google-datastore See [usage example](/docs/integrations/memory/google_firestore_datastore/) . from langchain_google_datastore import DatastoreChatMessageHistory ### El Carro: The Oracle Operator for Kubernetes[​](#el-carro-the-oracle-operator-for-kubernetes "Direct link to El Carro: The Oracle Operator for Kubernetes") > Google [El Carro Oracle Operator for Kubernetes](https://github.com/GoogleCloudPlatform/elcarro-oracle-operator) > offers a way to run `Oracle` databases in `Kubernetes` as a portable, open source, community driven, no vendor lock-in container orchestration system. pip install langchain-google-el-carro See [usage example](/docs/integrations/memory/google_el_carro/) . from langchain_google_el_carro import ElCarroChatMessageHistory Callbacks[​](#callbacks "Direct link to Callbacks") ---------------------------------------------------- ### Vertex AI callback handler[​](#vertex-ai-callback-handler "Direct link to Vertex AI callback handler") > Callback Handler that tracks `VertexAI` info. We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai from langchain_google_vertexai.callbacks import VertexAICallbackHandler Chat Loaders[​](#chat-loaders "Direct link to Chat Loaders") ------------------------------------------------------------- ### GMail[​](#gmail-1 "Direct link to GMail") > [Gmail](https://en.wikipedia.org/wiki/Gmail) > is a free email service provided by Google. This loader works with emails through the `Gmail API`. We need to install `langchain-google-community` with underlying dependencies. pip install langchain-google-community[gmail] See a [usage example and authorization instructions](/docs/integrations/chat_loaders/gmail/) . from langchain_google_community import GMailLoader **API Reference:**[GMailLoader](https://python.langchain.com/api_reference/google_community/gmail/langchain_google_community.gmail.loader.GMailLoader.html) Evaluators[​](#evaluators "Direct link to Evaluators") ------------------------------------------------------- We need to install `langchain-google-vertexai` python package. pip install langchain-google-vertexai ### VertexPairWiseStringEvaluator[​](#vertexpairwisestringevaluator "Direct link to VertexPairWiseStringEvaluator") > Pair-wise evaluation of the perplexity of a predicted string. from langchain_google_vertexai.evaluators.evaluation import VertexPairWiseStringEvaluator ### VertexStringEvaluator[​](#vertexstringevaluator "Direct link to VertexStringEvaluator") > Evaluate the perplexity of a predicted string. from langchain_google_vertexai.evaluators.evaluation import VertexPairWiseStringEvaluator 3rd Party Integrations[​](#3rd-party-integrations "Direct link to 3rd Party Integrations") ------------------------------------------------------------------------------------------- ### SearchApi[​](#searchapi "Direct link to SearchApi") > [SearchApi](https://www.searchapi.io/) > provides a 3rd-party API to access Google search results, YouTube search & transcripts, and other Google-related engines. See [usage examples and authorization instructions](/docs/integrations/tools/searchapi/) . from langchain_community.utilities import SearchApiAPIWrapper **API Reference:**[SearchApiAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.searchapi.SearchApiAPIWrapper.html) ### SerpApi[​](#serpapi "Direct link to SerpApi") > [SerpApi](https://serpapi.com/) > provides a 3rd-party API to access Google search results. See a [usage example and authorization instructions](/docs/integrations/tools/serpapi/) . from langchain_community.utilities import SerpAPIWrapper **API Reference:**[SerpAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.serpapi.SerpAPIWrapper.html) ### Serper.dev[​](#serperdev "Direct link to Serper.dev") See a [usage example and authorization instructions](/docs/integrations/tools/google_serper/) . from langchain_community.utilities import GoogleSerperAPIWrapper **API Reference:**[GoogleSerperAPIWrapper](https://python.langchain.com/api_reference/community/utilities/langchain_community.utilities.google_serper.GoogleSerperAPIWrapper.html) ### YouTube[​](#youtube "Direct link to YouTube") > [YouTube Search](https://github.com/joetats/youtube_search) > package searches `YouTube` videos avoiding using their heavily rate-limited API. > > It uses the form on the YouTube homepage and scrapes the resulting page. We need to install a python package. pip install youtube_search See a [usage example](/docs/integrations/tools/youtube/) . from langchain.tools import YouTubeSearchTool **API Reference:**[YouTubeSearchTool](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.youtube.search.YouTubeSearchTool.html) ### YouTube audio[​](#youtube-audio "Direct link to YouTube audio") > [YouTube](https://www.youtube.com/) > is an online video sharing and social media platform created by `Google`. Use `YoutubeAudioLoader` to fetch / download the audio files. Then, use `OpenAIWhisperParser` to transcribe them to text. We need to install several python packages. pip install yt_dlp pydub librosa See a [usage example and authorization instructions](/docs/integrations/document_loaders/youtube_audio/) . from langchain_community.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoaderfrom langchain_community.document_loaders.parsers import OpenAIWhisperParser, OpenAIWhisperParserLocal **API Reference:**[YoutubeAudioLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.blob_loaders.youtube_audio.YoutubeAudioLoader.html) | [OpenAIWhisperParser](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.parsers.audio.OpenAIWhisperParser.html) ### YouTube transcripts[​](#youtube-transcripts "Direct link to YouTube transcripts") > [YouTube](https://www.youtube.com/) > is an online video sharing and social media platform created by `Google`. We need to install `youtube-transcript-api` python package. pip install youtube-transcript-api See a [usage example](/docs/integrations/document_loaders/youtube_transcript/) . from langchain_community.document_loaders import YoutubeLoader **API Reference:**[YoutubeLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.youtube.YoutubeLoader.html) * * * #### Was this page helpful? * [Chat models](#chat-models) * [Google Generative AI](#google-generative-ai) * [Vertex AI](#vertex-ai) * [Anthropic on Vertex AI Model Garden](#anthropic-on-vertex-ai-model-garden) * [Llama on Vertex AI Model Garden](#llama-on-vertex-ai-model-garden) * [Mistral on Vertex AI Model Garden](#mistral-on-vertex-ai-model-garden) * [Gemma local from Hugging Face](#gemma-local-from-hugging-face) * [Gemma local from Kaggle](#gemma-local-from-kaggle) * [Gemma on Vertex AI Model Garden](#gemma-on-vertex-ai-model-garden) * [Vertex AI image captioning](#vertex-ai-image-captioning) * [Vertex AI image editor](#vertex-ai-image-editor) * [Vertex AI image generator](#vertex-ai-image-generator) * [Vertex AI visual QnA](#vertex-ai-visual-qna) * [LLMs](#llms) * [Google Generative AI](#google-generative-ai-1) * [Vertex AI Model Garden](#vertex-ai-model-garden) * [Gemma local from Hugging Face](#gemma-local-from-hugging-face-1) * [Gemma local from Kaggle](#gemma-local-from-kaggle-1) * [Gemma on Vertex AI Model Garden](#gemma-on-vertex-ai-model-garden-1) * [Vertex AI image captioning](#vertex-ai-image-captioning-1) * [Embedding models](#embedding-models) * [Google Generative AI embedding](#google-generative-ai-embedding) * [Google Generative AI server-side embedding](#google-generative-ai-server-side-embedding) * [Vertex AI](#vertex-ai-1) * [Palm embedding](#palm-embedding) * [Document Loaders](#document-loaders) * [AlloyDB for PostgreSQL](#alloydb-for-postgresql) * [BigQuery](#bigquery) * [Bigtable](#bigtable) * [Cloud SQL for MySQL](#cloud-sql-for-mysql) * [Cloud SQL for SQL Server](#cloud-sql-for-sql-server) * [Cloud SQL for PostgreSQL](#cloud-sql-for-postgresql) * [Cloud Storage](#cloud-storage) * [Cloud Vision loader](#cloud-vision-loader) * [El Carro for Oracle Workloads](#el-carro-for-oracle-workloads) * [Google Drive](#google-drive) * [Firestore (Native Mode)](#firestore-native-mode) * [Firestore (Datastore Mode)](#firestore-datastore-mode) * [Memorystore for Redis](#memorystore-for-redis) * [Spanner](#spanner) * [Speech-to-Text](#speech-to-text) * [Document Transformers](#document-transformers) * [Document AI](#document-ai) * [Google Translate](#google-translate) * [Vector Stores](#vector-stores) * [AlloyDB for PostgreSQL](#alloydb-for-postgresql-1) * [BigQuery Vector Search](#bigquery-vector-search) * [Memorystore for Redis](#memorystore-for-redis-1) * [Spanner](#spanner-1) * [Firestore (Native Mode)](#firestore-native-mode-1) * [Cloud SQL for MySQL](#cloud-sql-for-mysql-1) * [Cloud SQL for PostgreSQL](#cloud-sql-for-postgresql-1) * [Vertex AI Vector Search](#vertex-ai-vector-search) * [Vertex AI Vector Search with DataStore](#vertex-ai-vector-search-with-datastore) * [VectorSearchVectorStoreGCS](#vectorsearchvectorstoregcs) * [Google Generative AI Vector Store](#google-generative-ai-vector-store) * [ScaNN](#scann) * [Retrievers](#retrievers) * [Google Drive](#google-drive-1) * [Vertex AI Search](#vertex-ai-search) * [Document AI Warehouse](#document-ai-warehouse) * [Tools](#tools) * [Text-to-Speech](#text-to-speech) * [Google Drive](#google-drive-2) * [Google Finance](#google-finance) * [Google Jobs](#google-jobs) * [Google Lens](#google-lens) * [Google Places](#google-places) * [Google Scholar](#google-scholar) * [Google Search](#google-search) * [Google Trends](#google-trends) * [Toolkits](#toolkits) * [GMail](#gmail) * [Memory](#memory) * [AlloyDB for PostgreSQL](#alloydb-for-postgresql-2) * [Cloud SQL for PostgreSQL](#cloud-sql-for-postgresql-2) * [Cloud SQL for MySQL](#cloud-sql-for-mysql-2) * [Cloud SQL for SQL Server](#cloud-sql-for-sql-server-1) * [Spanner](#spanner-2) * [Memorystore for Redis](#memorystore-for-redis-2) * [Bigtable](#bigtable-1) * [Firestore (Native Mode)](#firestore-native-mode-2) * [Firestore (Datastore Mode)](#firestore-datastore-mode-1) * [El Carro: The Oracle Operator for Kubernetes](#el-carro-the-oracle-operator-for-kubernetes) * [Callbacks](#callbacks) * [Vertex AI callback handler](#vertex-ai-callback-handler) * [Chat Loaders](#chat-loaders) * [GMail](#gmail-1) * [Evaluators](#evaluators) * [VertexPairWiseStringEvaluator](#vertexpairwisestringevaluator) * [VertexStringEvaluator](#vertexstringevaluator) * [3rd Party Integrations](#3rd-party-integrations) * [SearchApi](#searchapi) * [SerpApi](#serpapi) * [Serper.dev](#serperdev) * [YouTube](#youtube) * [YouTube audio](#youtube-audio) * [YouTube transcripts](#youtube-transcripts) --- # Build an Agent | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/agents.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/agents.ipynb) By themselves, language models can't take actions - they just output text. A big use case for LangChain is creating **agents**. [Agents](/docs/concepts/agents/) are systems that use [LLMs](/docs/concepts/chat_models/) as reasoning engines to determine which actions to take and the inputs necessary to perform the action. After executing actions, the results can be fed back into the LLM to determine whether more actions are needed, or whether it is okay to finish. This is often achieved via [tool-calling](/docs/concepts/tool_calling/) . In this tutorial we will build an agent that can interact with a search engine. You will be able to ask this agent questions, watch it call the search tool, and have conversations with it. End-to-end agent[​](#end-to-end-agent "Direct link to End-to-end agent") ------------------------------------------------------------------------- The code snippet below represents a fully functional agent that uses an LLM to decide which tools to use. It is equipped with a generic search tool. It has conversational memory - meaning that it can be used as a multi-turn chatbot. In the rest of the guide, we will walk through the individual components and what each part does - but if you want to just grab some code and get started, feel free to use this! # Import relevant functionalityfrom langchain_anthropic import ChatAnthropicfrom langchain_community.tools.tavily_search import TavilySearchResultsfrom langchain_core.messages import HumanMessagefrom langgraph.checkpoint.memory import MemorySaverfrom langgraph.prebuilt import create_react_agent# Create the agentmemory = MemorySaver()model = ChatAnthropic(model_name="claude-3-sonnet-20240229")search = TavilySearchResults(max_results=2)tools = [search]agent_executor = create_react_agent(model, tools, checkpointer=memory)# Use the agentconfig = {"configurable": {"thread_id": "abc123"}}for chunk in agent_executor.stream( {"messages": [HumanMessage(content="hi im bob! and i live in sf")]}, config): print(chunk) print("----")for chunk in agent_executor.stream( {"messages": [HumanMessage(content="whats the weather where I live?")]}, config): print(chunk) print("----") **API Reference:**[ChatAnthropic](https://python.langchain.com/api_reference/anthropic/chat_models/langchain_anthropic.chat_models.ChatAnthropic.html) | [TavilySearchResults](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.tavily_search.tool.TavilySearchResults.html) | [HumanMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.human.HumanMessage.html) | [MemorySaver](https://langchain-ai.github.io/langgraph/reference/checkpoints/#langgraph.checkpoint.memory.MemorySaver) | [create\_react\_agent](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent) {'agent': {'messages': [AIMessage(content="Hello Bob! Since you didn't ask a specific question, I don't need to use any tools to respond. It's nice to meet you. San Francisco is a wonderful city with lots to see and do. I hope you're enjoying living there. Please let me know if you have any other questions!", response_metadata={'id': 'msg_01Mmfzfs9m4XMgVzsCZYMWqH', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 271, 'output_tokens': 65}}, id='run-44c57f9c-a637-4888-b7d9-6d985031ae48-0', usage_metadata={'input_tokens': 271, 'output_tokens': 65, 'total_tokens': 336})]}}----{'agent': {'messages': [AIMessage(content=[{'text': 'To get current weather information for your location in San Francisco, let me invoke the search tool:', 'type': 'text'}, {'id': 'toolu_01BGEyQaSz3pTq8RwUUHSRoo', 'input': {'query': 'san francisco weather'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], response_metadata={'id': 'msg_013AVSVsRLKYZjduLpJBY4us', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'tool_use', 'stop_sequence': None, 'usage': {'input_tokens': 347, 'output_tokens': 80}}, id='run-de7923b6-5ee2-4ebe-bd95-5aed4933d0e3-0', tool_calls=[{'name': 'tavily_search_results_json', 'args': {'query': 'san francisco weather'}, 'id': 'toolu_01BGEyQaSz3pTq8RwUUHSRoo'}], usage_metadata={'input_tokens': 347, 'output_tokens': 80, 'total_tokens': 427})]}}----{'tools': {'messages': [ToolMessage(content='[{"url": "https://www.weatherapi.com/", "content": "{\'location\': {\'name\': \'San Francisco\', \'region\': \'California\', \'country\': \'United States of America\', \'lat\': 37.78, \'lon\': -122.42, \'tz_id\': \'America/Los_Angeles\', \'localtime_epoch\': 1717238643, \'localtime\': \'2024-06-01 3:44\'}, \'current\': {\'last_updated_epoch\': 1717237800, \'last_updated\': \'2024-06-01 03:30\', \'temp_c\': 12.0, \'temp_f\': 53.6, \'is_day\': 0, \'condition\': {\'text\': \'Mist\', \'icon\': \'//cdn.weatherapi.com/weather/64x64/night/143.png\', \'code\': 1030}, \'wind_mph\': 5.6, \'wind_kph\': 9.0, \'wind_degree\': 310, \'wind_dir\': \'NW\', \'pressure_mb\': 1013.0, \'pressure_in\': 29.92, \'precip_mm\': 0.0, \'precip_in\': 0.0, \'humidity\': 88, \'cloud\': 100, \'feelslike_c\': 10.5, \'feelslike_f\': 50.8, \'windchill_c\': 9.3, \'windchill_f\': 48.7, \'heatindex_c\': 11.1, \'heatindex_f\': 51.9, \'dewpoint_c\': 8.8, \'dewpoint_f\': 47.8, \'vis_km\': 6.4, \'vis_miles\': 3.0, \'uv\': 1.0, \'gust_mph\': 12.5, \'gust_kph\': 20.1}}"}, {"url": "https://www.timeanddate.com/weather/usa/san-francisco/historic", "content": "Past Weather in San Francisco, California, USA \\u2014 Yesterday and Last 2 Weeks. Time/General. Weather. Time Zone. DST Changes. Sun & Moon. Weather Today Weather Hourly 14 Day Forecast Yesterday/Past Weather Climate (Averages) Currently: 68 \\u00b0F. Passing clouds."}]', name='tavily_search_results_json', tool_call_id='toolu_01BGEyQaSz3pTq8RwUUHSRoo')]}}----{'agent': {'messages': [AIMessage(content='Based on the search results, the current weather in San Francisco is:\n\nTemperature: 53.6Β°F (12Β°C)\nConditions: Misty\nWind: 5.6 mph (9 kph) from the Northwest\nHumidity: 88%\nCloud Cover: 100% \n\nThe results provide detailed information like wind chill, heat index, visibility and more. It looks like a typical cool, foggy morning in San Francisco. Let me know if you need any other details about the weather where you live!', response_metadata={'id': 'msg_019WGLbaojuNdbCnqac7zaGW', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 1035, 'output_tokens': 120}}, id='run-1bb68bf3-b212-4ef4-8a31-10c830421c78-0', usage_metadata={'input_tokens': 1035, 'output_tokens': 120, 'total_tokens': 1155})]}}---- Setup[​](#setup "Direct link to Setup") ---------------------------------------- ### Jupyter Notebook[​](#jupyter-notebook "Direct link to Jupyter Notebook") This guide (and most of the other guides in the documentation) uses [Jupyter notebooks](https://jupyter.org/) and assumes the reader is as well. Jupyter notebooks are perfect interactive environments for learning how to work with LLM systems because oftentimes things can go wrong (unexpected output, API down, etc), and observing these cases is a great way to better understand building with LLMs. This and other tutorials are perhaps most conveniently run in a Jupyter notebook. See [here](https://jupyter.org/install) for instructions on how to install. ### Installation[​](#installation "Direct link to Installation") To install LangChain run: %pip install -U langchain-community langgraph langchain-anthropic tavily-python langgraph-checkpoint-sqlite For more details, see our [Installation guide](/docs/how_to/installation/) . ### LangSmith[​](#langsmith "Direct link to LangSmith") Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent. The best way to do this is with [LangSmith](https://smith.langchain.com) . After you sign up at the link above, make sure to set your environment variables to start logging traces: export LANGCHAIN_TRACING_V2="true"export LANGCHAIN_API_KEY="..." Or, if in a notebook, you can set them with: import getpassimport osos.environ["LANGCHAIN_TRACING_V2"] = "true"os.environ["LANGCHAIN_API_KEY"] = getpass.getpass() ### Tavily[​](#tavily "Direct link to Tavily") We will be using [Tavily](/docs/integrations/tools/tavily_search/) (a search engine) as a tool. In order to use it, you will need to get and set an API key: export TAVILY_API_KEY="..." Or, if in a notebook, you can set it with: import getpassimport osos.environ["TAVILY_API_KEY"] = getpass.getpass() Define tools[​](#define-tools "Direct link to Define tools") ------------------------------------------------------------- We first need to create the tools we want to use. Our main tool of choice will be [Tavily](/docs/integrations/tools/tavily_search/) - a search engine. We have a built-in tool in LangChain to easily use Tavily search engine as tool. from langchain_community.tools.tavily_search import TavilySearchResultssearch = TavilySearchResults(max_results=2)search_results = search.invoke("what is the weather in SF")print(search_results)# If we want, we can create other tools.# Once we have all the tools we want, we can put them in a list that we will reference later.tools = [search] **API Reference:**[TavilySearchResults](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.tavily_search.tool.TavilySearchResults.html) [{'url': 'https://www.weatherapi.com/', 'content': "{'location': {'name': 'San Francisco', 'region': 'California', 'country': 'United States of America', 'lat': 37.78, 'lon': -122.42, 'tz_id': 'America/Los_Angeles', 'localtime_epoch': 1717238703, 'localtime': '2024-06-01 3:45'}, 'current': {'last_updated_epoch': 1717237800, 'last_updated': '2024-06-01 03:30', 'temp_c': 12.0, 'temp_f': 53.6, 'is_day': 0, 'condition': {'text': 'Mist', 'icon': '//cdn.weatherapi.com/weather/64x64/night/143.png', 'code': 1030}, 'wind_mph': 5.6, 'wind_kph': 9.0, 'wind_degree': 310, 'wind_dir': 'NW', 'pressure_mb': 1013.0, 'pressure_in': 29.92, 'precip_mm': 0.0, 'precip_in': 0.0, 'humidity': 88, 'cloud': 100, 'feelslike_c': 10.5, 'feelslike_f': 50.8, 'windchill_c': 9.3, 'windchill_f': 48.7, 'heatindex_c': 11.1, 'heatindex_f': 51.9, 'dewpoint_c': 8.8, 'dewpoint_f': 47.8, 'vis_km': 6.4, 'vis_miles': 3.0, 'uv': 1.0, 'gust_mph': 12.5, 'gust_kph': 20.1}}"}, {'url': 'https://www.wunderground.com/hourly/us/ca/san-francisco/date/2024-01-06', 'content': 'Current Weather for Popular Cities . San Francisco, CA 58 Β° F Partly Cloudy; Manhattan, NY warning 51 Β° F Cloudy; Schiller Park, IL (60176) warning 51 Β° F Fair; Boston, MA warning 41 Β° F ...'}] Using Language Models[​](#using-language-models "Direct link to Using Language Models") ---------------------------------------------------------------------------------------- Next, let's learn how to use a language model by to call tools. LangChain supports many different language models that you can use interchangably - select the one you want to use below! Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAImodel = ChatOpenAI(model="gpt-4") You can call the language model by passing in a list of messages. By default, the response is a `content` string. from langchain_core.messages import HumanMessageresponse = model.invoke([HumanMessage(content="hi!")])response.content **API Reference:**[HumanMessage](https://python.langchain.com/api_reference/core/messages/langchain_core.messages.human.HumanMessage.html) 'Hi there!' We can now see what it is like to enable this model to do tool calling. In order to enable that we use `.bind_tools` to give the language model knowledge of these tools model_with_tools = model.bind_tools(tools) We can now call the model. Let's first call it with a normal message, and see how it responds. We can look at both the `content` field as well as the `tool_calls` field. response = model_with_tools.invoke([HumanMessage(content="Hi!")])print(f"ContentString: {response.content}")print(f"ToolCalls: {response.tool_calls}") ContentString: Hello!ToolCalls: [] Now, let's try calling it with some input that would expect a tool to be called. response = model_with_tools.invoke([HumanMessage(content="What's the weather in SF?")])print(f"ContentString: {response.content}")print(f"ToolCalls: {response.tool_calls}") ContentString: ToolCalls: [{'name': 'tavily_search_results_json', 'args': {'query': 'weather san francisco'}, 'id': 'toolu_01VTP7DUvSfgtYxsq9x4EwMp'}] We can see that there's now no text content, but there is a tool call! It wants us to call the Tavily Search tool. This isn't calling that tool yet - it's just telling us to. In order to actually call it, we'll want to create our agent. Create the agent[​](#create-the-agent "Direct link to Create the agent") ------------------------------------------------------------------------- Now that we have defined the tools and the LLM, we can create the agent. We will be using [LangGraph](/docs/concepts/architecture/#langgraph) to construct the agent. Currently, we are using a high level interface to construct the agent, but the nice thing about LangGraph is that this high-level interface is backed by a low-level, highly controllable API in case you want to modify the agent logic. Now, we can initialize the agent with the LLM and the tools. Note that we are passing in the `model`, not `model_with_tools`. That is because `create_react_agent` will call `.bind_tools` for us under the hood. from langgraph.prebuilt import create_react_agentagent_executor = create_react_agent(model, tools) **API Reference:**[create\_react\_agent](https://langchain-ai.github.io/langgraph/reference/prebuilt/#langgraph.prebuilt.chat_agent_executor.create_react_agent) Run the agent[​](#run-the-agent "Direct link to Run the agent") ---------------------------------------------------------------- We can now run the agent with a few queries! Note that for now, these are all **stateless** queries (it won't remember previous interactions). Note that the agent will return the **final** state at the end of the interaction (which includes any inputs, we will see later on how to get only the outputs). First up, let's see how it responds when there's no need to call a tool: response = agent_executor.invoke({"messages": [HumanMessage(content="hi!")]})response["messages"] [HumanMessage(content='hi!', id='a820fcc5-9b87-457a-9af0-f21768143ee3'), AIMessage(content='Hello!', response_metadata={'id': 'msg_01VbC493X1VEDyusgttiEr1z', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 264, 'output_tokens': 5}}, id='run-0e0ddae8-a85b-4bd6-947c-c36c857a4698-0', usage_metadata={'input_tokens': 264, 'output_tokens': 5, 'total_tokens': 269})] In order to see exactly what is happening under the hood (and to make sure it's not calling a tool) we can take a look at the [LangSmith trace](https://smith.langchain.com/public/28311faa-e135-4d6a-ab6b-caecf6482aaa/r) Let's now try it out on an example where it should be invoking the tool response = agent_executor.invoke( {"messages": [HumanMessage(content="whats the weather in sf?")]})response["messages"] [HumanMessage(content='whats the weather in sf?', id='1d6c96bb-4ddb-415c-a579-a07d5264de0d'), AIMessage(content=[{'id': 'toolu_01Y5EK4bw2LqsQXeaUv8iueF', 'input': {'query': 'weather in san francisco'}, 'name': 'tavily_search_results_json', 'type': 'tool_use'}], response_metadata={'id': 'msg_0132wQUcEduJ8UKVVVqwJzM4', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'tool_use', 'stop_sequence': None, 'usage': {'input_tokens': 269, 'output_tokens': 61}}, id='run-26d5e5e8-d4fd-46d2-a197-87b95b10e823-0', tool_calls=[{'name': 'tavily_search_results_json', 'args': {'query': 'weather in san francisco'}, 'id': 'toolu_01Y5EK4bw2LqsQXeaUv8iueF'}], usage_metadata={'input_tokens': 269, 'output_tokens': 61, 'total_tokens': 330}), ToolMessage(content='[{"url": "https://www.weatherapi.com/", "content": "{\'location\': {\'name\': \'San Francisco\', \'region\': \'California\', \'country\': \'United States of America\', \'lat\': 37.78, \'lon\': -122.42, \'tz_id\': \'America/Los_Angeles\', \'localtime_epoch\': 1717238703, \'localtime\': \'2024-06-01 3:45\'}, \'current\': {\'last_updated_epoch\': 1717237800, \'last_updated\': \'2024-06-01 03:30\', \'temp_c\': 12.0, \'temp_f\': 53.6, \'is_day\': 0, \'condition\': {\'text\': \'Mist\', \'icon\': \'//cdn.weatherapi.com/weather/64x64/night/143.png\', \'code\': 1030}, \'wind_mph\': 5.6, \'wind_kph\': 9.0, \'wind_degree\': 310, \'wind_dir\': \'NW\', \'pressure_mb\': 1013.0, \'pressure_in\': 29.92, \'precip_mm\': 0.0, \'precip_in\': 0.0, \'humidity\': 88, \'cloud\': 100, \'feelslike_c\': 10.5, \'feelslike_f\': 50.8, \'windchill_c\': 9.3, \'windchill_f\': 48.7, \'heatindex_c\': 11.1, \'heatindex_f\': 51.9, \'dewpoint_c\': 8.8, \'dewpoint_f\': 47.8, \'vis_km\': 6.4, \'vis_miles\': 3.0, \'uv\': 1.0, \'gust_mph\': 12.5, \'gust_kph\': 20.1}}"}, {"url": "https://www.timeanddate.com/weather/usa/san-francisco/hourly", "content": "Sun & Moon. Weather Today Weather Hourly 14 Day Forecast Yesterday/Past Weather Climate (Averages) Currently: 59 \\u00b0F. Passing clouds. (Weather station: San Francisco International Airport, USA). See more current weather."}]', name='tavily_search_results_json', id='37aa1fd9-b232-4a02-bd22-bc5b9b44a22c', tool_call_id='toolu_01Y5EK4bw2LqsQXeaUv8iueF'), AIMessage(content='Based on the search results, here is a summary of the current weather in San Francisco:\n\nThe weather in San Francisco is currently misty with a temperature of around 53Β°F (12Β°C). There is complete cloud cover and moderate winds from the northwest around 5-9 mph (9-14 km/h). Humidity is high at 88%. Visibility is around 3 miles (6.4 km). \n\nThe results provide an hourly forecast as well as current conditions from a couple different weather sources. Let me know if you need any additional details about the San Francisco weather!', response_metadata={'id': 'msg_01BRX9mrT19nBDdHYtR7wJ92', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 920, 'output_tokens': 132}}, id='run-d0325583-3ddc-4432-b2b2-d023eb97660f-0', usage_metadata={'input_tokens': 920, 'output_tokens': 132, 'total_tokens': 1052})] We can check out the [LangSmith trace](https://smith.langchain.com/public/f520839d-cd4d-4495-8764-e32b548e235d/r) to make sure it's calling the search tool effectively. Streaming Messages[​](#streaming-messages "Direct link to Streaming Messages") ------------------------------------------------------------------------------- We've seen how the agent can be called with `.invoke` to get a final response. If the agent executes multiple steps, this may take a while. To show intermediate progress, we can stream back messages as they occur. for chunk in agent_executor.stream( {"messages": [HumanMessage(content="whats the weather in sf?")]}): print(chunk) print("----") {'agent': {'messages': [AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_50Kb8zHmFqPYavQwF5TgcOH8', 'function': {'arguments': '{\n "query": "current weather in San Francisco"\n}', 'name': 'tavily_search_results_json'}, 'type': 'function'}]}, response_metadata={'token_usage': {'completion_tokens': 23, 'prompt_tokens': 134, 'total_tokens': 157}, 'model_name': 'gpt-4', 'system_fingerprint': None, 'finish_reason': 'tool_calls', 'logprobs': None}, id='run-042d5feb-c2cc-4c3f-b8fd-dbc22fd0bc07-0', tool_calls=[{'name': 'tavily_search_results_json', 'args': {'query': 'current weather in San Francisco'}, 'id': 'call_50Kb8zHmFqPYavQwF5TgcOH8'}])]}}----{'action': {'messages': [ToolMessage(content='[{"url": "https://www.weatherapi.com/", "content": "{\'location\': {\'name\': \'San Francisco\', \'region\': \'California\', \'country\': \'United States of America\', \'lat\': 37.78, \'lon\': -122.42, \'tz_id\': \'America/Los_Angeles\', \'localtime_epoch\': 1714426906, \'localtime\': \'2024-04-29 14:41\'}, \'current\': {\'last_updated_epoch\': 1714426200, \'last_updated\': \'2024-04-29 14:30\', \'temp_c\': 17.8, \'temp_f\': 64.0, \'is_day\': 1, \'condition\': {\'text\': \'Sunny\', \'icon\': \'//cdn.weatherapi.com/weather/64x64/day/113.png\', \'code\': 1000}, \'wind_mph\': 23.0, \'wind_kph\': 37.1, \'wind_degree\': 290, \'wind_dir\': \'WNW\', \'pressure_mb\': 1019.0, \'pressure_in\': 30.09, \'precip_mm\': 0.0, \'precip_in\': 0.0, \'humidity\': 50, \'cloud\': 0, \'feelslike_c\': 17.8, \'feelslike_f\': 64.0, \'vis_km\': 16.0, \'vis_miles\': 9.0, \'uv\': 5.0, \'gust_mph\': 27.5, \'gust_kph\': 44.3}}"}, {"url": "https://world-weather.info/forecast/usa/san_francisco/april-2024/", "content": "Extended weather forecast in San Francisco. Hourly Week 10 days 14 days 30 days Year. Detailed \\u26a1 San Francisco Weather Forecast for April 2024 - day/night \\ud83c\\udf21\\ufe0f temperatures, precipitations - World-Weather.info."}]', name='tavily_search_results_json', id='d88320ac-3fe1-4f73-870a-3681f15f6982', tool_call_id='call_50Kb8zHmFqPYavQwF5TgcOH8')]}}----{'agent': {'messages': [AIMessage(content='The current weather in San Francisco, California is sunny with a temperature of 17.8Β°C (64.0Β°F). The wind is coming from the WNW at 23.0 mph. The humidity is at 50%. [source](https://www.weatherapi.com/)', response_metadata={'token_usage': {'completion_tokens': 58, 'prompt_tokens': 602, 'total_tokens': 660}, 'model_name': 'gpt-4', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-0cd2a507-ded5-4601-afe3-3807400e9989-0')]}}---- Streaming tokens[​](#streaming-tokens "Direct link to Streaming tokens") ------------------------------------------------------------------------- In addition to streaming back messages, it is also useful to stream back tokens. We can do this with the `.astream_events` method. important This `.astream_events` method only works with Python 3.11 or higher. async for event in agent_executor.astream_events( {"messages": [HumanMessage(content="whats the weather in sf?")]}, version="v1"): kind = event["event"] if kind == "on_chain_start": if ( event["name"] == "Agent" ): # Was assigned when creating the agent with `.with_config({"run_name": "Agent"})` print( f"Starting agent: {event['name']} with input: {event['data'].get('input')}" ) elif kind == "on_chain_end": if ( event["name"] == "Agent" ): # Was assigned when creating the agent with `.with_config({"run_name": "Agent"})` print() print("--") print( f"Done agent: {event['name']} with output: {event['data'].get('output')['output']}" ) if kind == "on_chat_model_stream": content = event["data"]["chunk"].content if content: # Empty content in the context of OpenAI means # that the model is asking for a tool to be invoked. # So we only print non-empty content print(content, end="|") elif kind == "on_tool_start": print("--") print( f"Starting tool: {event['name']} with inputs: {event['data'].get('input')}" ) elif kind == "on_tool_end": print(f"Done tool: {event['name']}") print(f"Tool output was: {event['data'].get('output')}") print("--") --Starting tool: tavily_search_results_json with inputs: {'query': 'current weather in San Francisco'}Done tool: tavily_search_results_jsonTool output was: [{'url': 'https://www.weatherapi.com/', 'content': "{'location': {'name': 'San Francisco', 'region': 'California', 'country': 'United States of America', 'lat': 37.78, 'lon': -122.42, 'tz_id': 'America/Los_Angeles', 'localtime_epoch': 1714427052, 'localtime': '2024-04-29 14:44'}, 'current': {'last_updated_epoch': 1714426200, 'last_updated': '2024-04-29 14:30', 'temp_c': 17.8, 'temp_f': 64.0, 'is_day': 1, 'condition': {'text': 'Sunny', 'icon': '//cdn.weatherapi.com/weather/64x64/day/113.png', 'code': 1000}, 'wind_mph': 23.0, 'wind_kph': 37.1, 'wind_degree': 290, 'wind_dir': 'WNW', 'pressure_mb': 1019.0, 'pressure_in': 30.09, 'precip_mm': 0.0, 'precip_in': 0.0, 'humidity': 50, 'cloud': 0, 'feelslike_c': 17.8, 'feelslike_f': 64.0, 'vis_km': 16.0, 'vis_miles': 9.0, 'uv': 5.0, 'gust_mph': 27.5, 'gust_kph': 44.3}}"}, {'url': 'https://www.weathertab.com/en/c/e/04/united-states/california/san-francisco/', 'content': 'San Francisco Weather Forecast for Apr 2024 - Risk of Rain Graph. Rain Risk Graph: Monthly Overview. Bar heights indicate rain risk percentages. Yellow bars mark low-risk days, while black and grey bars signal higher risks. Grey-yellow bars act as buffers, advising to keep at least one day clear from the riskier grey and black days, guiding ...'}]--The| current| weather| in| San| Francisco|,| California|,| USA| is| sunny| with| a| temperature| of| |17|.|8|Β°C| (|64|.|0|Β°F|).| The| wind| is| blowing| from| the| W|NW| at| a| speed| of| |37|.|1| k|ph| (|23|.|0| mph|).| The| humidity| level| is| at| |50|%.| [|Source|](|https|://|www|.weather|api|.com|/)| Adding in memory[​](#adding-in-memory "Direct link to Adding in memory") ------------------------------------------------------------------------- As mentioned earlier, this agent is stateless. This means it does not remember previous interactions. To give it memory we need to pass in a checkpointer. When passing in a checkpointer, we also have to pass in a `thread_id` when invoking the agent (so it knows which thread/conversation to resume from). from langgraph.checkpoint.memory import MemorySavermemory = MemorySaver() **API Reference:**[MemorySaver](https://langchain-ai.github.io/langgraph/reference/checkpoints/#langgraph.checkpoint.memory.MemorySaver) agent_executor = create_react_agent(model, tools, checkpointer=memory)config = {"configurable": {"thread_id": "abc123"}} for chunk in agent_executor.stream( {"messages": [HumanMessage(content="hi im bob!")]}, config): print(chunk) print("----") {'agent': {'messages': [AIMessage(content="Hello Bob! It's nice to meet you again.", response_metadata={'id': 'msg_013C1z2ZySagEFwmU1EsysR2', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 1162, 'output_tokens': 14}}, id='run-f878acfd-d195-44e8-9166-e2796317e3f8-0', usage_metadata={'input_tokens': 1162, 'output_tokens': 14, 'total_tokens': 1176})]}}---- for chunk in agent_executor.stream( {"messages": [HumanMessage(content="whats my name?")]}, config): print(chunk) print("----") {'agent': {'messages': [AIMessage(content='You mentioned your name is Bob when you introduced yourself earlier. So your name is Bob.', response_metadata={'id': 'msg_01WNwnRNGwGDRw6vRdivt6i1', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 1184, 'output_tokens': 21}}, id='run-f5c0b957-8878-405a-9d4b-a7cd38efe81f-0', usage_metadata={'input_tokens': 1184, 'output_tokens': 21, 'total_tokens': 1205})]}}---- Example [LangSmith trace](https://smith.langchain.com/public/fa73960b-0f7d-4910-b73d-757a12f33b2b/r) If you want to start a new conversation, all you have to do is change the `thread_id` used config = {"configurable": {"thread_id": "xyz123"}}for chunk in agent_executor.stream( {"messages": [HumanMessage(content="whats my name?")]}, config): print(chunk) print("----") {'agent': {'messages': [AIMessage(content="I'm afraid I don't actually know your name. As an AI assistant without personal information about you, I don't have a specific name associated with our conversation.", response_metadata={'id': 'msg_01NoaXNNYZKSoBncPcLkdcbo', 'model': 'claude-3-sonnet-20240229', 'stop_reason': 'end_turn', 'stop_sequence': None, 'usage': {'input_tokens': 267, 'output_tokens': 36}}, id='run-c9f7df3d-525a-4d8f-bbcf-a5b4a5d2e4b0-0', usage_metadata={'input_tokens': 267, 'output_tokens': 36, 'total_tokens': 303})]}}---- Conclusion[​](#conclusion "Direct link to Conclusion") ------------------------------------------------------- That's a wrap! In this quick start we covered how to create a simple agent. We've then shown how to stream back a response - not only with the intermediate steps, but also tokens! We've also added in memory so you can have a conversation with them. Agents are a complex topic with lots to learn! For more information on Agents, please check out the [LangGraph](/docs/concepts/architecture/#langgraph) documentation. This has it's own set of concepts, tutorials, and how-to guides. * * * #### Was this page helpful? * [End-to-end agent](#end-to-end-agent) * [Setup](#setup) * [Jupyter Notebook](#jupyter-notebook) * [Installation](#installation) * [LangSmith](#langsmith) * [Tavily](#tavily) * [Define tools](#define-tools) * [Using Language Models](#using-language-models) * [Create the agent](#create-the-agent) * [Run the agent](#run-the-agent) * [Streaming Messages](#streaming-messages) * [Streaming tokens](#streaming-tokens) * [Adding in memory](#adding-in-memory) * [Conclusion](#conclusion) --- # Hugging Face | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/integrations/providers/huggingface.mdx) All functionality related to the [Hugging Face Platform](https://huggingface.co/) . Installation[​](#installation "Direct link to Installation") ------------------------------------------------------------- Most of the Hugging Face integrations are available in the `langchain-huggingface` package. pip install langchain-huggingface Chat models[​](#chat-models "Direct link to Chat models") ---------------------------------------------------------- ### ChatHuggingFace[​](#chathuggingface "Direct link to ChatHuggingFace") We can use the `Hugging Face` LLM classes or directly use the `ChatHuggingFace` class. See a [usage example](/docs/integrations/chat/huggingface/) . from langchain_huggingface import ChatHuggingFace **API Reference:**[ChatHuggingFace](https://python.langchain.com/api_reference/huggingface/chat_models/langchain_huggingface.chat_models.huggingface.ChatHuggingFace.html) LLMs[​](#llms "Direct link to LLMs") ------------------------------------- ### HuggingFaceEndpoint[​](#huggingfaceendpoint "Direct link to HuggingFaceEndpoint") See a [usage example](/docs/integrations/llms/huggingface_endpoint/) . from langchain_huggingface import HuggingFaceEndpoint **API Reference:**[HuggingFaceEndpoint](https://python.langchain.com/api_reference/huggingface/llms/langchain_huggingface.llms.huggingface_endpoint.HuggingFaceEndpoint.html) ### HuggingFacePipeline[​](#huggingfacepipeline "Direct link to HuggingFacePipeline") Hugging Face models can be run locally through the `HuggingFacePipeline` class. See a [usage example](/docs/integrations/llms/huggingface_pipelines/) . from langchain_huggingface import HuggingFacePipeline **API Reference:**[HuggingFacePipeline](https://python.langchain.com/api_reference/huggingface/llms/langchain_huggingface.llms.huggingface_pipeline.HuggingFacePipeline.html) Embedding Models[​](#embedding-models "Direct link to Embedding Models") ------------------------------------------------------------------------- ### HuggingFaceEmbeddings[​](#huggingfaceembeddings "Direct link to HuggingFaceEmbeddings") See a [usage example](/docs/integrations/text_embedding/huggingfacehub/) . from langchain_huggingface import HuggingFaceEmbeddings **API Reference:**[HuggingFaceEmbeddings](https://python.langchain.com/api_reference/huggingface/embeddings/langchain_huggingface.embeddings.huggingface.HuggingFaceEmbeddings.html) ### HuggingFaceEndpointEmbeddings[​](#huggingfaceendpointembeddings "Direct link to HuggingFaceEndpointEmbeddings") See a [usage example](/docs/integrations/text_embedding/huggingfacehub/) . from langchain_huggingface import HuggingFaceEndpointEmbeddings **API Reference:**[HuggingFaceEndpointEmbeddings](https://python.langchain.com/api_reference/huggingface/embeddings/langchain_huggingface.embeddings.huggingface_endpoint.HuggingFaceEndpointEmbeddings.html) ### HuggingFaceInferenceAPIEmbeddings[​](#huggingfaceinferenceapiembeddings "Direct link to HuggingFaceInferenceAPIEmbeddings") See a [usage example](/docs/integrations/text_embedding/huggingfacehub/) . from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings **API Reference:**[HuggingFaceInferenceAPIEmbeddings](https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings.html) ### HuggingFaceInstructEmbeddings[​](#huggingfaceinstructembeddings "Direct link to HuggingFaceInstructEmbeddings") See a [usage example](/docs/integrations/text_embedding/instruct_embeddings/) . from langchain_community.embeddings import HuggingFaceInstructEmbeddings **API Reference:**[HuggingFaceInstructEmbeddings](https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.huggingface.HuggingFaceInstructEmbeddings.html) ### HuggingFaceBgeEmbeddings[​](#huggingfacebgeembeddings "Direct link to HuggingFaceBgeEmbeddings") > [BGE models on the HuggingFace](https://huggingface.co/BAAI/bge-large-en-v1.5) > are one of [the best open-source embedding models](https://huggingface.co/spaces/mteb/leaderboard) > . BGE model is created by the [Beijing Academy of Artificial Intelligence (BAAI)](https://en.wikipedia.org/wiki/Beijing_Academy_of_Artificial_Intelligence) > . `BAAI` is a private non-profit organization engaged in AI research and development. See a [usage example](/docs/integrations/text_embedding/bge_huggingface/) . from langchain_community.embeddings import HuggingFaceBgeEmbeddings **API Reference:**[HuggingFaceBgeEmbeddings](https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.huggingface.HuggingFaceBgeEmbeddings.html) Document Loaders[​](#document-loaders "Direct link to Document Loaders") ------------------------------------------------------------------------- ### Hugging Face dataset[​](#hugging-face-dataset "Direct link to Hugging Face dataset") > [Hugging Face Hub](https://huggingface.co/docs/hub/index) > is home to over 75,000 [datasets](https://huggingface.co/docs/hub/index#datasets) > in more than 100 languages that can be used for a broad range of tasks across NLP, Computer Vision, and Audio. They used for a diverse range of tasks such as translation, automatic speech recognition, and image classification. We need to install `datasets` python package. pip install datasets See a [usage example](/docs/integrations/document_loaders/hugging_face_dataset/) . from langchain_community.document_loaders.hugging_face_dataset import HuggingFaceDatasetLoader **API Reference:**[HuggingFaceDatasetLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.hugging_face_dataset.HuggingFaceDatasetLoader.html) ### Hugging Face model loader[​](#hugging-face-model-loader "Direct link to Hugging Face model loader") > Load model information from `Hugging Face Hub`, including README content. > > This loader interfaces with the `Hugging Face Models API` to fetch and load model metadata and README files. The API allows you to search and filter models based on specific criteria such as model tags, authors, and more. from langchain_community.document_loaders import HuggingFaceModelLoader **API Reference:**[HuggingFaceModelLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.hugging_face_model.HuggingFaceModelLoader.html) ### Image captions[​](#image-captions "Direct link to Image captions") It uses the Hugging Face models to generate image captions. We need to install several python packages. pip install transformers pillow See a [usage example](/docs/integrations/document_loaders/image_captions/) . from langchain_community.document_loaders import ImageCaptionLoader **API Reference:**[ImageCaptionLoader](https://python.langchain.com/api_reference/community/document_loaders/langchain_community.document_loaders.image_captions.ImageCaptionLoader.html) Tools[​](#tools "Direct link to Tools") ---------------------------------------- ### Hugging Face Hub Tools[​](#hugging-face-hub-tools "Direct link to Hugging Face Hub Tools") > [Hugging Face Tools](https://huggingface.co/docs/transformers/v4.29.0/en/custom_tools) > support text I/O and are loaded using the `load_huggingface_tool` function. We need to install several python packages. pip install transformers huggingface_hub See a [usage example](/docs/integrations/tools/huggingface_tools/) . from langchain_community.agent_toolkits.load_tools import load_huggingface_tool **API Reference:**[load\_huggingface\_tool](https://python.langchain.com/api_reference/community/agent_toolkits/langchain_community.agent_toolkits.load_tools.load_huggingface_tool.html) ### Hugging Face Text-to-Speech Model Inference.[​](#hugging-face-text-to-speech-model-inference "Direct link to Hugging Face Text-to-Speech Model Inference.") > It is a wrapper around `OpenAI Text-to-Speech API`. from langchain_community.tools.audio import HuggingFaceTextToSpeechModelInference **API Reference:**[HuggingFaceTextToSpeechModelInference](https://python.langchain.com/api_reference/community/tools/langchain_community.tools.audio.huggingface_text_to_speech_inference.HuggingFaceTextToSpeechModelInference.html) * * * #### Was this page helpful? * [Installation](#installation) * [Chat models](#chat-models) * [ChatHuggingFace](#chathuggingface) * [LLMs](#llms) * [HuggingFaceEndpoint](#huggingfaceendpoint) * [HuggingFacePipeline](#huggingfacepipeline) * [Embedding Models](#embedding-models) * [HuggingFaceEmbeddings](#huggingfaceembeddings) * [HuggingFaceEndpointEmbeddings](#huggingfaceendpointembeddings) * [HuggingFaceInferenceAPIEmbeddings](#huggingfaceinferenceapiembeddings) * [HuggingFaceInstructEmbeddings](#huggingfaceinstructembeddings) * [HuggingFaceBgeEmbeddings](#huggingfacebgeembeddings) * [Document Loaders](#document-loaders) * [Hugging Face dataset](#hugging-face-dataset) * [Hugging Face model loader](#hugging-face-model-loader) * [Image captions](#image-captions) * [Tools](#tools) * [Hugging Face Hub Tools](#hugging-face-hub-tools) * [Hugging Face Text-to-Speech Model Inference.](#hugging-face-text-to-speech-model-inference) --- # langchain-experimental: 0.3.4 β€” πŸ¦œπŸ”— LangChain documentation [Skip to main content](#main-content) Back to top Ctrl+K [Docs](https://python.langchain.com/) * [GitHub](https://github.com/langchain-ai/langchain "GitHub") * [X / Twitter](https://twitter.com/langchainai "X / Twitter") langchain-experimental: 0.3.4[#](#module-langchain_experimental "Link to this heading") ======================================================================================== [agents](agents.html#langchain-experimental-agents) [#](#langchain-experimental-agents "Link to this heading") --------------------------------------------------------------------------------------------------------------- **Functions** | | | | --- | --- | | [`agents.agent_toolkits.csv.base.create_csv_agent`](agents/langchain_experimental.agents.agent_toolkits.csv.base.create_csv_agent.html#langchain_experimental.agents.agent_toolkits.csv.base.create_csv_agent "langchain_experimental.agents.agent_toolkits.csv.base.create_csv_agent")
(...) | Create pandas dataframe agent by loading csv to a dataframe. | | [`agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent`](agents/langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent.html#langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent "langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent")
(llm,Β df) | Construct a Pandas agent from an LLM and dataframe(s). | | [`agents.agent_toolkits.python.base.create_python_agent`](agents/langchain_experimental.agents.agent_toolkits.python.base.create_python_agent.html#langchain_experimental.agents.agent_toolkits.python.base.create_python_agent "langchain_experimental.agents.agent_toolkits.python.base.create_python_agent")
(...) | Construct a python agent from an LLM and tool. | | [`agents.agent_toolkits.spark.base.create_spark_dataframe_agent`](agents/langchain_experimental.agents.agent_toolkits.spark.base.create_spark_dataframe_agent.html#langchain_experimental.agents.agent_toolkits.spark.base.create_spark_dataframe_agent "langchain_experimental.agents.agent_toolkits.spark.base.create_spark_dataframe_agent")
(llm,Β df) | Construct a Spark agent from an LLM and dataframe. | | [`agents.agent_toolkits.xorbits.base.create_xorbits_agent`](agents/langchain_experimental.agents.agent_toolkits.xorbits.base.create_xorbits_agent.html#langchain_experimental.agents.agent_toolkits.xorbits.base.create_xorbits_agent "langchain_experimental.agents.agent_toolkits.xorbits.base.create_xorbits_agent")
(...) | Construct a xorbits agent from an LLM and dataframe. | [autonomous\_agents](autonomous_agents.html#langchain-experimental-autonomous-agents) [#](#langchain-experimental-autonomous-agents "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`autonomous_agents.autogpt.agent.AutoGPT`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.agent.AutoGPT.html#langchain_experimental.autonomous_agents.autogpt.agent.AutoGPT "langchain_experimental.autonomous_agents.autogpt.agent.AutoGPT")
(...) | Agent for interacting with AutoGPT. | | [`autonomous_agents.autogpt.memory.AutoGPTMemory`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory.html#langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory "langchain_experimental.autonomous_agents.autogpt.memory.AutoGPTMemory") | Memory for AutoGPT. | | [`autonomous_agents.autogpt.output_parser.AutoGPTAction`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTAction.html#langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTAction "langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTAction")
(...) | Action returned by AutoGPTOutputParser. | | [`autonomous_agents.autogpt.output_parser.AutoGPTOutputParser`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser.html#langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser "langchain_experimental.autonomous_agents.autogpt.output_parser.AutoGPTOutputParser") | Output parser for AutoGPT. | | [`autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser.html#langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser "langchain_experimental.autonomous_agents.autogpt.output_parser.BaseAutoGPTOutputParser") | Base Output parser for AutoGPT. | | [`autonomous_agents.autogpt.prompt.AutoGPTPrompt`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt.html#langchain_experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt "langchain_experimental.autonomous_agents.autogpt.prompt.AutoGPTPrompt") | Prompt for AutoGPT. | | [`autonomous_agents.autogpt.prompt_generator.PromptGenerator`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator.html#langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator "langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator")
() | Generator of custom prompt strings. | | [`autonomous_agents.baby_agi.baby_agi.BabyAGI`](autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI.html#langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI "langchain_experimental.autonomous_agents.baby_agi.baby_agi.BabyAGI") | Controller model for the BabyAGI agent. | | [`autonomous_agents.baby_agi.task_creation.TaskCreationChain`](autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain.html#langchain_experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain "langchain_experimental.autonomous_agents.baby_agi.task_creation.TaskCreationChain") | Chain generating tasks. | | [`autonomous_agents.baby_agi.task_execution.TaskExecutionChain`](autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.task_execution.TaskExecutionChain.html#langchain_experimental.autonomous_agents.baby_agi.task_execution.TaskExecutionChain "langchain_experimental.autonomous_agents.baby_agi.task_execution.TaskExecutionChain") | Chain to execute tasks. | | [`autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain`](autonomous_agents/langchain_experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain.html#langchain_experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain "langchain_experimental.autonomous_agents.baby_agi.task_prioritization.TaskPrioritizationChain") | Chain to prioritize tasks. | | [`autonomous_agents.hugginggpt.hugginggpt.HuggingGPT`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.hugginggpt.HuggingGPT.html#langchain_experimental.autonomous_agents.hugginggpt.hugginggpt.HuggingGPT "langchain_experimental.autonomous_agents.hugginggpt.hugginggpt.HuggingGPT")
(...) | Agent for interacting with HuggingGPT. | | [`autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain.html#langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain "langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerationChain") | Chain to execute tasks. | | [`autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerator`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerator.html#langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerator "langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.ResponseGenerator")
(...) | Generates a response based on the input. | | [`autonomous_agents.hugginggpt.task_executor.Task`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_executor.Task.html#langchain_experimental.autonomous_agents.hugginggpt.task_executor.Task "langchain_experimental.autonomous_agents.hugginggpt.task_executor.Task")
(...) | Task to be executed. | | [`autonomous_agents.hugginggpt.task_executor.TaskExecutor`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_executor.TaskExecutor.html#langchain_experimental.autonomous_agents.hugginggpt.task_executor.TaskExecutor "langchain_experimental.autonomous_agents.hugginggpt.task_executor.TaskExecutor")
(plan) | Load tools and execute tasks. | | [`autonomous_agents.hugginggpt.task_planner.BasePlanner`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.BasePlanner.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.BasePlanner "langchain_experimental.autonomous_agents.hugginggpt.task_planner.BasePlanner") | Base class for a planner. | | [`autonomous_agents.hugginggpt.task_planner.Plan`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.Plan.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.Plan "langchain_experimental.autonomous_agents.hugginggpt.task_planner.Plan")
(steps) | A plan to execute. | | [`autonomous_agents.hugginggpt.task_planner.PlanningOutputParser`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser "langchain_experimental.autonomous_agents.hugginggpt.task_planner.PlanningOutputParser") | Parses the output of the planning stage. | | [`autonomous_agents.hugginggpt.task_planner.Step`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.Step.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.Step "langchain_experimental.autonomous_agents.hugginggpt.task_planner.Step")
(...) | A step in the plan. | | [`autonomous_agents.hugginggpt.task_planner.TaskPlaningChain`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlaningChain.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlaningChain "langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlaningChain") | Chain to execute tasks. | | [`autonomous_agents.hugginggpt.task_planner.TaskPlanner`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner "langchain_experimental.autonomous_agents.hugginggpt.task_planner.TaskPlanner") | Planner for tasks. | **Functions** | | | | --- | --- | | [`autonomous_agents.autogpt.output_parser.preprocess_json_input`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.output_parser.preprocess_json_input.html#langchain_experimental.autonomous_agents.autogpt.output_parser.preprocess_json_input "langchain_experimental.autonomous_agents.autogpt.output_parser.preprocess_json_input")
(...) | Preprocesses a string to be parsed as json. | | [`autonomous_agents.autogpt.prompt_generator.get_prompt`](autonomous_agents/langchain_experimental.autonomous_agents.autogpt.prompt_generator.get_prompt.html#langchain_experimental.autonomous_agents.autogpt.prompt_generator.get_prompt "langchain_experimental.autonomous_agents.autogpt.prompt_generator.get_prompt")
(tools) | Generates a prompt string. | | [`autonomous_agents.hugginggpt.repsonse_generator.load_response_generator`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.load_response_generator.html#langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.load_response_generator "langchain_experimental.autonomous_agents.hugginggpt.repsonse_generator.load_response_generator")
(llm) | Load the ResponseGenerator. | | [`autonomous_agents.hugginggpt.task_planner.load_chat_planner`](autonomous_agents/langchain_experimental.autonomous_agents.hugginggpt.task_planner.load_chat_planner.html#langchain_experimental.autonomous_agents.hugginggpt.task_planner.load_chat_planner "langchain_experimental.autonomous_agents.hugginggpt.task_planner.load_chat_planner")
(llm) | Load the chat planner. | [chat\_models](chat_models.html#langchain-experimental-chat-models) [#](#langchain-experimental-chat-models "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`chat_models.llm_wrapper.ChatWrapper`](chat_models/langchain_experimental.chat_models.llm_wrapper.ChatWrapper.html#langchain_experimental.chat_models.llm_wrapper.ChatWrapper "langchain_experimental.chat_models.llm_wrapper.ChatWrapper") | Wrapper for chat LLMs. | | [`chat_models.llm_wrapper.Llama2Chat`](chat_models/langchain_experimental.chat_models.llm_wrapper.Llama2Chat.html#langchain_experimental.chat_models.llm_wrapper.Llama2Chat "langchain_experimental.chat_models.llm_wrapper.Llama2Chat") | Wrapper for Llama-2-chat model. | | [`chat_models.llm_wrapper.Mixtral`](chat_models/langchain_experimental.chat_models.llm_wrapper.Mixtral.html#langchain_experimental.chat_models.llm_wrapper.Mixtral "langchain_experimental.chat_models.llm_wrapper.Mixtral") | See [https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#instruction-format](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1#instruction-format) | | [`chat_models.llm_wrapper.Orca`](chat_models/langchain_experimental.chat_models.llm_wrapper.Orca.html#langchain_experimental.chat_models.llm_wrapper.Orca "langchain_experimental.chat_models.llm_wrapper.Orca") | Wrapper for Orca-style models. | | [`chat_models.llm_wrapper.Vicuna`](chat_models/langchain_experimental.chat_models.llm_wrapper.Vicuna.html#langchain_experimental.chat_models.llm_wrapper.Vicuna "langchain_experimental.chat_models.llm_wrapper.Vicuna") | Wrapper for Vicuna-style models. | [comprehend\_moderation](comprehend_moderation.html#langchain-experimental-comprehend-moderation) [#](#langchain-experimental-comprehend-moderation "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`comprehend_moderation.amazon_comprehend_moderation.AmazonComprehendModerationChain`](comprehend_moderation/langchain_experimental.comprehend_moderation.amazon_comprehend_moderation.AmazonComprehendModerationChain.html#langchain_experimental.comprehend_moderation.amazon_comprehend_moderation.AmazonComprehendModerationChain "langchain_experimental.comprehend_moderation.amazon_comprehend_moderation.AmazonComprehendModerationChain") | Moderation Chain, based on Amazon Comprehend service. | | [`comprehend_moderation.base_moderation.BaseModeration`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation.BaseModeration.html#langchain_experimental.comprehend_moderation.base_moderation.BaseModeration "langchain_experimental.comprehend_moderation.base_moderation.BaseModeration")
(client) | Base class for moderation. | | [`comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler.html#langchain_experimental.comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler "langchain_experimental.comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler")
() | Base class for moderation callback handlers. | | [`comprehend_moderation.base_moderation_config.BaseModerationConfig`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_config.BaseModerationConfig.html#langchain_experimental.comprehend_moderation.base_moderation_config.BaseModerationConfig "langchain_experimental.comprehend_moderation.base_moderation_config.BaseModerationConfig") | Base configuration settings for moderation. | | [`comprehend_moderation.base_moderation_config.ModerationPiiConfig`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_config.ModerationPiiConfig.html#langchain_experimental.comprehend_moderation.base_moderation_config.ModerationPiiConfig "langchain_experimental.comprehend_moderation.base_moderation_config.ModerationPiiConfig") | Configuration for PII moderation filter. | | [`comprehend_moderation.base_moderation_config.ModerationPromptSafetyConfig`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_config.ModerationPromptSafetyConfig.html#langchain_experimental.comprehend_moderation.base_moderation_config.ModerationPromptSafetyConfig "langchain_experimental.comprehend_moderation.base_moderation_config.ModerationPromptSafetyConfig") | Configuration for Prompt Safety moderation filter. | | [`comprehend_moderation.base_moderation_config.ModerationToxicityConfig`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_config.ModerationToxicityConfig.html#langchain_experimental.comprehend_moderation.base_moderation_config.ModerationToxicityConfig "langchain_experimental.comprehend_moderation.base_moderation_config.ModerationToxicityConfig") | Configuration for Toxicity moderation filter. | | [`comprehend_moderation.base_moderation_exceptions.ModerationPiiError`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationPiiError.html#langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationPiiError "langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationPiiError")
(\[...\]) | Exception raised if PII entities are detected. | | [`comprehend_moderation.base_moderation_exceptions.ModerationPromptSafetyError`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationPromptSafetyError.html#langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationPromptSafetyError "langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationPromptSafetyError")
(\[...\]) | Exception raised if Unsafe prompts are detected. | | [`comprehend_moderation.base_moderation_exceptions.ModerationToxicityError`](comprehend_moderation/langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationToxicityError.html#langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationToxicityError "langchain_experimental.comprehend_moderation.base_moderation_exceptions.ModerationToxicityError")
(\[...\]) | Exception raised if Toxic entities are detected. | | [`comprehend_moderation.pii.ComprehendPII`](comprehend_moderation/langchain_experimental.comprehend_moderation.pii.ComprehendPII.html#langchain_experimental.comprehend_moderation.pii.ComprehendPII "langchain_experimental.comprehend_moderation.pii.ComprehendPII")
(client) | Class to handle Personally Identifiable Information (PII) moderation. | | [`comprehend_moderation.prompt_safety.ComprehendPromptSafety`](comprehend_moderation/langchain_experimental.comprehend_moderation.prompt_safety.ComprehendPromptSafety.html#langchain_experimental.comprehend_moderation.prompt_safety.ComprehendPromptSafety "langchain_experimental.comprehend_moderation.prompt_safety.ComprehendPromptSafety")
(client) | Class to handle prompt safety moderation. | | [`comprehend_moderation.toxicity.ComprehendToxicity`](comprehend_moderation/langchain_experimental.comprehend_moderation.toxicity.ComprehendToxicity.html#langchain_experimental.comprehend_moderation.toxicity.ComprehendToxicity "langchain_experimental.comprehend_moderation.toxicity.ComprehendToxicity")
(client) | Class to handle toxicity moderation. | [cpal](cpal.html#langchain-experimental-cpal) [#](#langchain-experimental-cpal "Link to this heading") ------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`cpal.base.CPALChain`](cpal/langchain_experimental.cpal.base.CPALChain.html#langchain_experimental.cpal.base.CPALChain "langchain_experimental.cpal.base.CPALChain") | Causal program-aided language (CPAL) chain implementation. | | [`cpal.base.CausalChain`](cpal/langchain_experimental.cpal.base.CausalChain.html#langchain_experimental.cpal.base.CausalChain "langchain_experimental.cpal.base.CausalChain") | Translate the causal narrative into a stack of operations. | | [`cpal.base.InterventionChain`](cpal/langchain_experimental.cpal.base.InterventionChain.html#langchain_experimental.cpal.base.InterventionChain "langchain_experimental.cpal.base.InterventionChain") | Set the hypothetical conditions for the causal model. | | [`cpal.base.NarrativeChain`](cpal/langchain_experimental.cpal.base.NarrativeChain.html#langchain_experimental.cpal.base.NarrativeChain "langchain_experimental.cpal.base.NarrativeChain") | Decompose the narrative into its story elements. | | [`cpal.base.QueryChain`](cpal/langchain_experimental.cpal.base.QueryChain.html#langchain_experimental.cpal.base.QueryChain "langchain_experimental.cpal.base.QueryChain") | Query the outcome table using SQL. | | [`cpal.constants.Constant`](cpal/langchain_experimental.cpal.constants.Constant.html#langchain_experimental.cpal.constants.Constant "langchain_experimental.cpal.constants.Constant")
(value\[,Β names,Β ...\]) | Enum for constants used in the CPAL. | | [`cpal.models.CausalModel`](cpal/langchain_experimental.cpal.models.CausalModel.html#langchain_experimental.cpal.models.CausalModel "langchain_experimental.cpal.models.CausalModel") | Casual data. | | [`cpal.models.EntityModel`](cpal/langchain_experimental.cpal.models.EntityModel.html#langchain_experimental.cpal.models.EntityModel "langchain_experimental.cpal.models.EntityModel") | Entity in the story. | | [`cpal.models.EntitySettingModel`](cpal/langchain_experimental.cpal.models.EntitySettingModel.html#langchain_experimental.cpal.models.EntitySettingModel "langchain_experimental.cpal.models.EntitySettingModel") | Entity initial conditions. | | [`cpal.models.InterventionModel`](cpal/langchain_experimental.cpal.models.InterventionModel.html#langchain_experimental.cpal.models.InterventionModel "langchain_experimental.cpal.models.InterventionModel") | Intervention data of the story aka initial conditions. | | [`cpal.models.NarrativeModel`](cpal/langchain_experimental.cpal.models.NarrativeModel.html#langchain_experimental.cpal.models.NarrativeModel "langchain_experimental.cpal.models.NarrativeModel") | Narrative input as three story elements. | | [`cpal.models.QueryModel`](cpal/langchain_experimental.cpal.models.QueryModel.html#langchain_experimental.cpal.models.QueryModel "langchain_experimental.cpal.models.QueryModel") | Query data of the story. | | [`cpal.models.ResultModel`](cpal/langchain_experimental.cpal.models.ResultModel.html#langchain_experimental.cpal.models.ResultModel "langchain_experimental.cpal.models.ResultModel") | Result of the story query. | | [`cpal.models.StoryModel`](cpal/langchain_experimental.cpal.models.StoryModel.html#langchain_experimental.cpal.models.StoryModel "langchain_experimental.cpal.models.StoryModel") | Story data. | | [`cpal.models.SystemSettingModel`](cpal/langchain_experimental.cpal.models.SystemSettingModel.html#langchain_experimental.cpal.models.SystemSettingModel "langchain_experimental.cpal.models.SystemSettingModel") | System initial conditions. | [data\_anonymizer](data_anonymizer.html#langchain-experimental-data-anonymizer) [#](#langchain-experimental-data-anonymizer "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`data_anonymizer.base.AnonymizerBase`](data_anonymizer/langchain_experimental.data_anonymizer.base.AnonymizerBase.html#langchain_experimental.data_anonymizer.base.AnonymizerBase "langchain_experimental.data_anonymizer.base.AnonymizerBase")
() | Base abstract class for anonymizers. | | [`data_anonymizer.base.ReversibleAnonymizerBase`](data_anonymizer/langchain_experimental.data_anonymizer.base.ReversibleAnonymizerBase.html#langchain_experimental.data_anonymizer.base.ReversibleAnonymizerBase "langchain_experimental.data_anonymizer.base.ReversibleAnonymizerBase")
() | Base abstract class for reversible anonymizers. | | [`data_anonymizer.deanonymizer_mapping.DeanonymizerMapping`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_mapping.DeanonymizerMapping.html#langchain_experimental.data_anonymizer.deanonymizer_mapping.DeanonymizerMapping "langchain_experimental.data_anonymizer.deanonymizer_mapping.DeanonymizerMapping")
(...) | Deanonymizer mapping. | | [`data_anonymizer.presidio.PresidioAnonymizer`](data_anonymizer/langchain_experimental.data_anonymizer.presidio.PresidioAnonymizer.html#langchain_experimental.data_anonymizer.presidio.PresidioAnonymizer "langchain_experimental.data_anonymizer.presidio.PresidioAnonymizer")
(\[...\]) | Anonymizer using Microsoft Presidio. | | [`data_anonymizer.presidio.PresidioAnonymizerBase`](data_anonymizer/langchain_experimental.data_anonymizer.presidio.PresidioAnonymizerBase.html#langchain_experimental.data_anonymizer.presidio.PresidioAnonymizerBase "langchain_experimental.data_anonymizer.presidio.PresidioAnonymizerBase")
(\[...\]) | Base Anonymizer using Microsoft Presidio. | | [`data_anonymizer.presidio.PresidioReversibleAnonymizer`](data_anonymizer/langchain_experimental.data_anonymizer.presidio.PresidioReversibleAnonymizer.html#langchain_experimental.data_anonymizer.presidio.PresidioReversibleAnonymizer "langchain_experimental.data_anonymizer.presidio.PresidioReversibleAnonymizer")
(\[...\]) | Reversible Anonymizer using Microsoft Presidio. | **Functions** | | | | --- | --- | | [`data_anonymizer.deanonymizer_mapping.create_anonymizer_mapping`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_mapping.create_anonymizer_mapping.html#langchain_experimental.data_anonymizer.deanonymizer_mapping.create_anonymizer_mapping "langchain_experimental.data_anonymizer.deanonymizer_mapping.create_anonymizer_mapping")
(...) | Create or update the mapping used to anonymize and/or | | [`data_anonymizer.deanonymizer_mapping.format_duplicated_operator`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_mapping.format_duplicated_operator.html#langchain_experimental.data_anonymizer.deanonymizer_mapping.format_duplicated_operator "langchain_experimental.data_anonymizer.deanonymizer_mapping.format_duplicated_operator")
(...) | Format the operator name with the count. | | [`data_anonymizer.deanonymizer_matching_strategies.case_insensitive_matching_strategy`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.case_insensitive_matching_strategy.html#langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.case_insensitive_matching_strategy "langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.case_insensitive_matching_strategy")
(...) | Case insensitive matching strategy for deanonymization. | | [`data_anonymizer.deanonymizer_matching_strategies.combined_exact_fuzzy_matching_strategy`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.combined_exact_fuzzy_matching_strategy.html#langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.combined_exact_fuzzy_matching_strategy "langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.combined_exact_fuzzy_matching_strategy")
(...) | Combined exact and fuzzy matching strategy for deanonymization. | | [`data_anonymizer.deanonymizer_matching_strategies.exact_matching_strategy`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.exact_matching_strategy.html#langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.exact_matching_strategy "langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.exact_matching_strategy")
(...) | Exact matching strategy for deanonymization. | | [`data_anonymizer.deanonymizer_matching_strategies.fuzzy_matching_strategy`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.fuzzy_matching_strategy.html#langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.fuzzy_matching_strategy "langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.fuzzy_matching_strategy")
(...) | Fuzzy matching strategy for deanonymization. | | [`data_anonymizer.deanonymizer_matching_strategies.ngram_fuzzy_matching_strategy`](data_anonymizer/langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.ngram_fuzzy_matching_strategy.html#langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.ngram_fuzzy_matching_strategy "langchain_experimental.data_anonymizer.deanonymizer_matching_strategies.ngram_fuzzy_matching_strategy")
(...) | N-gram fuzzy matching strategy for deanonymization. | | [`data_anonymizer.faker_presidio_mapping.get_pseudoanonymizer_mapping`](data_anonymizer/langchain_experimental.data_anonymizer.faker_presidio_mapping.get_pseudoanonymizer_mapping.html#langchain_experimental.data_anonymizer.faker_presidio_mapping.get_pseudoanonymizer_mapping "langchain_experimental.data_anonymizer.faker_presidio_mapping.get_pseudoanonymizer_mapping")
(\[seed\]) | Get a mapping of entities to pseudo anonymize them. | [fallacy\_removal](fallacy_removal.html#langchain-experimental-fallacy-removal) [#](#langchain-experimental-fallacy-removal "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`fallacy_removal.base.FallacyChain`](fallacy_removal/langchain_experimental.fallacy_removal.base.FallacyChain.html#langchain_experimental.fallacy_removal.base.FallacyChain "langchain_experimental.fallacy_removal.base.FallacyChain") | Chain for applying logical fallacy evaluations. | | [`fallacy_removal.models.LogicalFallacy`](fallacy_removal/langchain_experimental.fallacy_removal.models.LogicalFallacy.html#langchain_experimental.fallacy_removal.models.LogicalFallacy "langchain_experimental.fallacy_removal.models.LogicalFallacy") | Logical fallacy. | [generative\_agents](generative_agents.html#langchain-experimental-generative-agents) [#](#langchain-experimental-generative-agents "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`generative_agents.generative_agent.GenerativeAgent`](generative_agents/langchain_experimental.generative_agents.generative_agent.GenerativeAgent.html#langchain_experimental.generative_agents.generative_agent.GenerativeAgent "langchain_experimental.generative_agents.generative_agent.GenerativeAgent") | Agent as a character with memory and innate characteristics. | | [`generative_agents.memory.GenerativeAgentMemory`](generative_agents/langchain_experimental.generative_agents.memory.GenerativeAgentMemory.html#langchain_experimental.generative_agents.memory.GenerativeAgentMemory "langchain_experimental.generative_agents.memory.GenerativeAgentMemory") | Memory for the generative agent. | [graph\_transformers](graph_transformers.html#langchain-experimental-graph-transformers) [#](#langchain-experimental-graph-transformers "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`graph_transformers.diffbot.DiffbotGraphTransformer`](graph_transformers/langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer.html#langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer "langchain_experimental.graph_transformers.diffbot.DiffbotGraphTransformer")
(\[...\]) | Transform documents into graph documents using Diffbot NLP API. | | [`graph_transformers.diffbot.NodesList`](graph_transformers/langchain_experimental.graph_transformers.diffbot.NodesList.html#langchain_experimental.graph_transformers.diffbot.NodesList "langchain_experimental.graph_transformers.diffbot.NodesList")
() | List of nodes with associated properties. | | [`graph_transformers.diffbot.SimplifiedSchema`](graph_transformers/langchain_experimental.graph_transformers.diffbot.SimplifiedSchema.html#langchain_experimental.graph_transformers.diffbot.SimplifiedSchema "langchain_experimental.graph_transformers.diffbot.SimplifiedSchema")
() | Simplified schema mapping. | | [`graph_transformers.diffbot.TypeOption`](graph_transformers/langchain_experimental.graph_transformers.diffbot.TypeOption.html#langchain_experimental.graph_transformers.diffbot.TypeOption "langchain_experimental.graph_transformers.diffbot.TypeOption")
(value) | | | [`graph_transformers.gliner.GlinerGraphTransformer`](graph_transformers/langchain_experimental.graph_transformers.gliner.GlinerGraphTransformer.html#langchain_experimental.graph_transformers.gliner.GlinerGraphTransformer "langchain_experimental.graph_transformers.gliner.GlinerGraphTransformer")
(...) | A transformer class for converting documents into graph structures using the GLiNER and GLiREL models. | | [`graph_transformers.llm.LLMGraphTransformer`](graph_transformers/langchain_experimental.graph_transformers.llm.LLMGraphTransformer.html#langchain_experimental.graph_transformers.llm.LLMGraphTransformer "langchain_experimental.graph_transformers.llm.LLMGraphTransformer")
(llm) | Transform documents into graph-based documents using a LLM. | | [`graph_transformers.llm.UnstructuredRelation`](graph_transformers/langchain_experimental.graph_transformers.llm.UnstructuredRelation.html#langchain_experimental.graph_transformers.llm.UnstructuredRelation "langchain_experimental.graph_transformers.llm.UnstructuredRelation") | Create a new model by parsing and validating input data from keyword arguments. | | [`graph_transformers.relik.RelikGraphTransformer`](graph_transformers/langchain_experimental.graph_transformers.relik.RelikGraphTransformer.html#langchain_experimental.graph_transformers.relik.RelikGraphTransformer "langchain_experimental.graph_transformers.relik.RelikGraphTransformer")
(\[...\]) | A transformer class for converting documents into graph structures using the Relik library and models. | **Functions** | | | | --- | --- | | [`graph_transformers.diffbot.format_property_key`](graph_transformers/langchain_experimental.graph_transformers.diffbot.format_property_key.html#langchain_experimental.graph_transformers.diffbot.format_property_key "langchain_experimental.graph_transformers.diffbot.format_property_key")
(s) | Formats a string to be used as a property key. | | [`graph_transformers.llm.create_simple_model`](graph_transformers/langchain_experimental.graph_transformers.llm.create_simple_model.html#langchain_experimental.graph_transformers.llm.create_simple_model "langchain_experimental.graph_transformers.llm.create_simple_model")
(\[...\]) | Create a simple graph model with optional constraints on node and relationship types. | | [`graph_transformers.llm.create_unstructured_prompt`](graph_transformers/langchain_experimental.graph_transformers.llm.create_unstructured_prompt.html#langchain_experimental.graph_transformers.llm.create_unstructured_prompt "langchain_experimental.graph_transformers.llm.create_unstructured_prompt")
(\[...\]) | | | [`graph_transformers.llm.format_property_key`](graph_transformers/langchain_experimental.graph_transformers.llm.format_property_key.html#langchain_experimental.graph_transformers.llm.format_property_key "langchain_experimental.graph_transformers.llm.format_property_key")
(s) | | | [`graph_transformers.llm.get_default_prompt`](graph_transformers/langchain_experimental.graph_transformers.llm.get_default_prompt.html#langchain_experimental.graph_transformers.llm.get_default_prompt "langchain_experimental.graph_transformers.llm.get_default_prompt")
(\[...\]) | | | [`graph_transformers.llm.map_to_base_node`](graph_transformers/langchain_experimental.graph_transformers.llm.map_to_base_node.html#langchain_experimental.graph_transformers.llm.map_to_base_node "langchain_experimental.graph_transformers.llm.map_to_base_node")
(node) | Map the SimpleNode to the base Node. | | [`graph_transformers.llm.map_to_base_relationship`](graph_transformers/langchain_experimental.graph_transformers.llm.map_to_base_relationship.html#langchain_experimental.graph_transformers.llm.map_to_base_relationship "langchain_experimental.graph_transformers.llm.map_to_base_relationship")
(rel) | Map the SimpleRelationship to the base Relationship. | | [`graph_transformers.llm.optional_enum_field`](graph_transformers/langchain_experimental.graph_transformers.llm.optional_enum_field.html#langchain_experimental.graph_transformers.llm.optional_enum_field "langchain_experimental.graph_transformers.llm.optional_enum_field")
(\[...\]) | Utility function to conditionally create a field with an enum constraint. | | [`graph_transformers.llm.validate_and_get_relationship_type`](graph_transformers/langchain_experimental.graph_transformers.llm.validate_and_get_relationship_type.html#langchain_experimental.graph_transformers.llm.validate_and_get_relationship_type "langchain_experimental.graph_transformers.llm.validate_and_get_relationship_type")
(...) | | [llm\_bash](llm_bash.html#langchain-experimental-llm-bash) [#](#langchain-experimental-llm-bash "Link to this heading") ------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`llm_bash.base.LLMBashChain`](llm_bash/langchain_experimental.llm_bash.base.LLMBashChain.html#langchain_experimental.llm_bash.base.LLMBashChain "langchain_experimental.llm_bash.base.LLMBashChain") | Chain that interprets a prompt and executes bash operations. | | [`llm_bash.bash.BashProcess`](llm_bash/langchain_experimental.llm_bash.bash.BashProcess.html#langchain_experimental.llm_bash.bash.BashProcess "langchain_experimental.llm_bash.bash.BashProcess")
(\[strip\_newlines,Β ...\]) | Wrapper for starting subprocesses. | | [`llm_bash.prompt.BashOutputParser`](llm_bash/langchain_experimental.llm_bash.prompt.BashOutputParser.html#langchain_experimental.llm_bash.prompt.BashOutputParser "langchain_experimental.llm_bash.prompt.BashOutputParser") | Parser for bash output. | [llm\_symbolic\_math](llm_symbolic_math.html#langchain-experimental-llm-symbolic-math) [#](#langchain-experimental-llm-symbolic-math "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`llm_symbolic_math.base.LLMSymbolicMathChain`](llm_symbolic_math/langchain_experimental.llm_symbolic_math.base.LLMSymbolicMathChain.html#langchain_experimental.llm_symbolic_math.base.LLMSymbolicMathChain "langchain_experimental.llm_symbolic_math.base.LLMSymbolicMathChain") | Chain that interprets a prompt and executes python code to do symbolic math. | [llms](llms.html#langchain-experimental-llms) [#](#langchain-experimental-llms "Link to this heading") ------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`llms.anthropic_functions.TagParser`](llms/langchain_experimental.llms.anthropic_functions.TagParser.html#langchain_experimental.llms.anthropic_functions.TagParser "langchain_experimental.llms.anthropic_functions.TagParser")
() | Parser for the tool tags. | | [`llms.jsonformer_decoder.JsonFormer`](llms/langchain_experimental.llms.jsonformer_decoder.JsonFormer.html#langchain_experimental.llms.jsonformer_decoder.JsonFormer "langchain_experimental.llms.jsonformer_decoder.JsonFormer") | Jsonformer wrapped LLM using HuggingFace Pipeline API. | | [`llms.llamaapi.ChatLlamaAPI`](llms/langchain_experimental.llms.llamaapi.ChatLlamaAPI.html#langchain_experimental.llms.llamaapi.ChatLlamaAPI "langchain_experimental.llms.llamaapi.ChatLlamaAPI") | Chat model using the Llama API. | | [`llms.lmformatenforcer_decoder.LMFormatEnforcer`](llms/langchain_experimental.llms.lmformatenforcer_decoder.LMFormatEnforcer.html#langchain_experimental.llms.lmformatenforcer_decoder.LMFormatEnforcer "langchain_experimental.llms.lmformatenforcer_decoder.LMFormatEnforcer") | LMFormatEnforcer wrapped LLM using HuggingFace Pipeline API. | | [`llms.rellm_decoder.RELLM`](llms/langchain_experimental.llms.rellm_decoder.RELLM.html#langchain_experimental.llms.rellm_decoder.RELLM "langchain_experimental.llms.rellm_decoder.RELLM") | RELLM wrapped LLM using HuggingFace Pipeline API. | **Functions** | | | | --- | --- | | [`llms.jsonformer_decoder.import_jsonformer`](llms/langchain_experimental.llms.jsonformer_decoder.import_jsonformer.html#langchain_experimental.llms.jsonformer_decoder.import_jsonformer "langchain_experimental.llms.jsonformer_decoder.import_jsonformer")
() | Lazily import of the jsonformer package. | | [`llms.lmformatenforcer_decoder.import_lmformatenforcer`](llms/langchain_experimental.llms.lmformatenforcer_decoder.import_lmformatenforcer.html#langchain_experimental.llms.lmformatenforcer_decoder.import_lmformatenforcer "langchain_experimental.llms.lmformatenforcer_decoder.import_lmformatenforcer")
() | Lazily import of the lmformatenforcer package. | | [`llms.ollama_functions.convert_to_ollama_tool`](llms/langchain_experimental.llms.ollama_functions.convert_to_ollama_tool.html#langchain_experimental.llms.ollama_functions.convert_to_ollama_tool "langchain_experimental.llms.ollama_functions.convert_to_ollama_tool")
(tool) | Convert a tool to an Ollama tool. | | [`llms.ollama_functions.parse_response`](llms/langchain_experimental.llms.ollama_functions.parse_response.html#langchain_experimental.llms.ollama_functions.parse_response "langchain_experimental.llms.ollama_functions.parse_response")
(message) | Extract function\_call from AIMessage. | | [`llms.rellm_decoder.import_rellm`](llms/langchain_experimental.llms.rellm_decoder.import_rellm.html#langchain_experimental.llms.rellm_decoder.import_rellm "langchain_experimental.llms.rellm_decoder.import_rellm")
() | Lazily import of the rellm package. | **Deprecated classes** | | | | --- | --- | | [`llms.anthropic_functions.AnthropicFunctions`](llms/langchain_experimental.llms.anthropic_functions.AnthropicFunctions.html#langchain_experimental.llms.anthropic_functions.AnthropicFunctions "langchain_experimental.llms.anthropic_functions.AnthropicFunctions") | | | [`llms.ollama_functions.OllamaFunctions`](llms/langchain_experimental.llms.ollama_functions.OllamaFunctions.html#langchain_experimental.llms.ollama_functions.OllamaFunctions "langchain_experimental.llms.ollama_functions.OllamaFunctions") | | [open\_clip](open_clip.html#langchain-experimental-open-clip) [#](#langchain-experimental-open-clip "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`open_clip.open_clip.OpenCLIPEmbeddings`](open_clip/langchain_experimental.open_clip.open_clip.OpenCLIPEmbeddings.html#langchain_experimental.open_clip.open_clip.OpenCLIPEmbeddings "langchain_experimental.open_clip.open_clip.OpenCLIPEmbeddings") | OpenCLIP Embeddings model. | [pal\_chain](pal_chain.html#langchain-experimental-pal-chain) [#](#langchain-experimental-pal-chain "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`pal_chain.base.PALChain`](pal_chain/langchain_experimental.pal_chain.base.PALChain.html#langchain_experimental.pal_chain.base.PALChain "langchain_experimental.pal_chain.base.PALChain") | Chain that implements Program-Aided Language Models (PAL). | | [`pal_chain.base.PALValidation`](pal_chain/langchain_experimental.pal_chain.base.PALValidation.html#langchain_experimental.pal_chain.base.PALValidation "langchain_experimental.pal_chain.base.PALValidation")
(\[...\]) | Validation for PAL generated code. | [plan\_and\_execute](plan_and_execute.html#langchain-experimental-plan-and-execute) [#](#langchain-experimental-plan-and-execute "Link to this heading") --------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`plan_and_execute.agent_executor.PlanAndExecute`](plan_and_execute/langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute.html#langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute "langchain_experimental.plan_and_execute.agent_executor.PlanAndExecute") | Plan and execute a chain of steps. | | [`plan_and_execute.executors.base.BaseExecutor`](plan_and_execute/langchain_experimental.plan_and_execute.executors.base.BaseExecutor.html#langchain_experimental.plan_and_execute.executors.base.BaseExecutor "langchain_experimental.plan_and_execute.executors.base.BaseExecutor") | Base executor. | | [`plan_and_execute.executors.base.ChainExecutor`](plan_and_execute/langchain_experimental.plan_and_execute.executors.base.ChainExecutor.html#langchain_experimental.plan_and_execute.executors.base.ChainExecutor "langchain_experimental.plan_and_execute.executors.base.ChainExecutor") | Chain executor. | | [`plan_and_execute.planners.base.BasePlanner`](plan_and_execute/langchain_experimental.plan_and_execute.planners.base.BasePlanner.html#langchain_experimental.plan_and_execute.planners.base.BasePlanner "langchain_experimental.plan_and_execute.planners.base.BasePlanner") | Base planner. | | [`plan_and_execute.planners.base.LLMPlanner`](plan_and_execute/langchain_experimental.plan_and_execute.planners.base.LLMPlanner.html#langchain_experimental.plan_and_execute.planners.base.LLMPlanner "langchain_experimental.plan_and_execute.planners.base.LLMPlanner") | LLM planner. | | [`plan_and_execute.planners.chat_planner.PlanningOutputParser`](plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser.html#langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser "langchain_experimental.plan_and_execute.planners.chat_planner.PlanningOutputParser") | Planning output parser. | | [`plan_and_execute.schema.BaseStepContainer`](plan_and_execute/langchain_experimental.plan_and_execute.schema.BaseStepContainer.html#langchain_experimental.plan_and_execute.schema.BaseStepContainer "langchain_experimental.plan_and_execute.schema.BaseStepContainer") | Base step container. | | [`plan_and_execute.schema.ListStepContainer`](plan_and_execute/langchain_experimental.plan_and_execute.schema.ListStepContainer.html#langchain_experimental.plan_and_execute.schema.ListStepContainer "langchain_experimental.plan_and_execute.schema.ListStepContainer") | Container for List of steps. | | [`plan_and_execute.schema.Plan`](plan_and_execute/langchain_experimental.plan_and_execute.schema.Plan.html#langchain_experimental.plan_and_execute.schema.Plan "langchain_experimental.plan_and_execute.schema.Plan") | Plan. | | [`plan_and_execute.schema.PlanOutputParser`](plan_and_execute/langchain_experimental.plan_and_execute.schema.PlanOutputParser.html#langchain_experimental.plan_and_execute.schema.PlanOutputParser "langchain_experimental.plan_and_execute.schema.PlanOutputParser") | Plan output parser. | | [`plan_and_execute.schema.Step`](plan_and_execute/langchain_experimental.plan_and_execute.schema.Step.html#langchain_experimental.plan_and_execute.schema.Step "langchain_experimental.plan_and_execute.schema.Step") | Step. | | [`plan_and_execute.schema.StepResponse`](plan_and_execute/langchain_experimental.plan_and_execute.schema.StepResponse.html#langchain_experimental.plan_and_execute.schema.StepResponse "langchain_experimental.plan_and_execute.schema.StepResponse") | Step response. | **Functions** | | | | --- | --- | | [`plan_and_execute.executors.agent_executor.load_agent_executor`](plan_and_execute/langchain_experimental.plan_and_execute.executors.agent_executor.load_agent_executor.html#langchain_experimental.plan_and_execute.executors.agent_executor.load_agent_executor "langchain_experimental.plan_and_execute.executors.agent_executor.load_agent_executor")
(...) | Load an agent executor. | | [`plan_and_execute.planners.chat_planner.load_chat_planner`](plan_and_execute/langchain_experimental.plan_and_execute.planners.chat_planner.load_chat_planner.html#langchain_experimental.plan_and_execute.planners.chat_planner.load_chat_planner "langchain_experimental.plan_and_execute.planners.chat_planner.load_chat_planner")
(llm) | Load a chat planner. | [prompt\_injection\_identifier](prompt_injection_identifier.html#langchain-experimental-prompt-injection-identifier) [#](#langchain-experimental-prompt-injection-identifier "Link to this heading") ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier`](prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier.html#langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier "langchain_experimental.prompt_injection_identifier.hugging_face_identifier.HuggingFaceInjectionIdentifier") | Tool that uses HuggingFace Prompt Injection model to detect prompt injection attacks. | | [`prompt_injection_identifier.hugging_face_identifier.PromptInjectionException`](prompt_injection_identifier/langchain_experimental.prompt_injection_identifier.hugging_face_identifier.PromptInjectionException.html#langchain_experimental.prompt_injection_identifier.hugging_face_identifier.PromptInjectionException "langchain_experimental.prompt_injection_identifier.hugging_face_identifier.PromptInjectionException")
(\[...\]) | Exception raised when prompt injection attack is detected. | [recommenders](recommenders.html#langchain-experimental-recommenders) [#](#langchain-experimental-recommenders "Link to this heading") --------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`recommenders.amazon_personalize.AmazonPersonalize`](recommenders/langchain_experimental.recommenders.amazon_personalize.AmazonPersonalize.html#langchain_experimental.recommenders.amazon_personalize.AmazonPersonalize "langchain_experimental.recommenders.amazon_personalize.AmazonPersonalize")
(\[...\]) | Amazon Personalize Runtime wrapper for executing real-time operations. | | [`recommenders.amazon_personalize_chain.AmazonPersonalizeChain`](recommenders/langchain_experimental.recommenders.amazon_personalize_chain.AmazonPersonalizeChain.html#langchain_experimental.recommenders.amazon_personalize_chain.AmazonPersonalizeChain "langchain_experimental.recommenders.amazon_personalize_chain.AmazonPersonalizeChain") | Chain for retrieving recommendations from Amazon Personalize, | [retrievers](retrievers.html#langchain-experimental-retrievers) [#](#langchain-experimental-retrievers "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever`](retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html#langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever "langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever") | Retriever that uses Vector SQL Database. | [rl\_chain](rl_chain.html#langchain-experimental-rl-chain) [#](#langchain-experimental-rl-chain "Link to this heading") ------------------------------------------------------------------------------------------------------------------------ **Classes** | | | | --- | --- | | [`rl_chain.base.AutoSelectionScorer`](rl_chain/langchain_experimental.rl_chain.base.AutoSelectionScorer.html#langchain_experimental.rl_chain.base.AutoSelectionScorer "langchain_experimental.rl_chain.base.AutoSelectionScorer") | Auto selection scorer. | | [`rl_chain.base.Embedder`](rl_chain/langchain_experimental.rl_chain.base.Embedder.html#langchain_experimental.rl_chain.base.Embedder "langchain_experimental.rl_chain.base.Embedder")
(\*args,Β \*\*kwargs) | Abstract class to represent an embedder. | | [`rl_chain.base.Event`](rl_chain/langchain_experimental.rl_chain.base.Event.html#langchain_experimental.rl_chain.base.Event "langchain_experimental.rl_chain.base.Event")
(inputs\[,Β selected\]) | Abstract class to represent an event. | | [`rl_chain.base.Policy`](rl_chain/langchain_experimental.rl_chain.base.Policy.html#langchain_experimental.rl_chain.base.Policy "langchain_experimental.rl_chain.base.Policy")
(\*\*kwargs) | Abstract class to represent a policy. | | [`rl_chain.base.RLChain`](rl_chain/langchain_experimental.rl_chain.base.RLChain.html#langchain_experimental.rl_chain.base.RLChain "langchain_experimental.rl_chain.base.RLChain") | Chain that leverages the Vowpal Wabbit (VW) model as a learned policy for reinforcement learning. | | `rl_chain.base.RLChain[PickBestEvent]` | Chain that leverages the Vowpal Wabbit (VW) model as a learned policy for reinforcement learning. | | [`rl_chain.base.Selected`](rl_chain/langchain_experimental.rl_chain.base.Selected.html#langchain_experimental.rl_chain.base.Selected "langchain_experimental.rl_chain.base.Selected")
() | Abstract class to represent the selected item. | | [`rl_chain.base.SelectionScorer`](rl_chain/langchain_experimental.rl_chain.base.SelectionScorer.html#langchain_experimental.rl_chain.base.SelectionScorer "langchain_experimental.rl_chain.base.SelectionScorer") | Abstract class to grade the chosen selection or the response of the llm. | | [`rl_chain.base.VwPolicy`](rl_chain/langchain_experimental.rl_chain.base.VwPolicy.html#langchain_experimental.rl_chain.base.VwPolicy "langchain_experimental.rl_chain.base.VwPolicy")
(model\_repo,Β vw\_cmd,Β ...) | Vowpal Wabbit policy. | | [`rl_chain.metrics.MetricsTrackerAverage`](rl_chain/langchain_experimental.rl_chain.metrics.MetricsTrackerAverage.html#langchain_experimental.rl_chain.metrics.MetricsTrackerAverage "langchain_experimental.rl_chain.metrics.MetricsTrackerAverage")
(step) | Metrics Tracker Average. | | [`rl_chain.metrics.MetricsTrackerRollingWindow`](rl_chain/langchain_experimental.rl_chain.metrics.MetricsTrackerRollingWindow.html#langchain_experimental.rl_chain.metrics.MetricsTrackerRollingWindow "langchain_experimental.rl_chain.metrics.MetricsTrackerRollingWindow")
(...) | Metrics Tracker Rolling Window. | | [`rl_chain.model_repository.ModelRepository`](rl_chain/langchain_experimental.rl_chain.model_repository.ModelRepository.html#langchain_experimental.rl_chain.model_repository.ModelRepository "langchain_experimental.rl_chain.model_repository.ModelRepository")
(folder) | Model Repository. | | [`rl_chain.pick_best_chain.PickBest`](rl_chain/langchain_experimental.rl_chain.pick_best_chain.PickBest.html#langchain_experimental.rl_chain.pick_best_chain.PickBest "langchain_experimental.rl_chain.pick_best_chain.PickBest") | Chain that leverages the Vowpal Wabbit (VW) model for reinforcement learning with a context, with the goal of modifying the prompt before the LLM call. | | [`rl_chain.pick_best_chain.PickBestEvent`](rl_chain/langchain_experimental.rl_chain.pick_best_chain.PickBestEvent.html#langchain_experimental.rl_chain.pick_best_chain.PickBestEvent "langchain_experimental.rl_chain.pick_best_chain.PickBestEvent")
(...) | Event class for PickBest chain. | | [`rl_chain.pick_best_chain.PickBestFeatureEmbedder`](rl_chain/langchain_experimental.rl_chain.pick_best_chain.PickBestFeatureEmbedder.html#langchain_experimental.rl_chain.pick_best_chain.PickBestFeatureEmbedder "langchain_experimental.rl_chain.pick_best_chain.PickBestFeatureEmbedder")
(...) | Embed the BasedOn and ToSelectFrom inputs into a format that can be used by the learning policy. | | [`rl_chain.pick_best_chain.PickBestRandomPolicy`](rl_chain/langchain_experimental.rl_chain.pick_best_chain.PickBestRandomPolicy.html#langchain_experimental.rl_chain.pick_best_chain.PickBestRandomPolicy "langchain_experimental.rl_chain.pick_best_chain.PickBestRandomPolicy")
(...) | Random policy for PickBest chain. | | [`rl_chain.pick_best_chain.PickBestSelected`](rl_chain/langchain_experimental.rl_chain.pick_best_chain.PickBestSelected.html#langchain_experimental.rl_chain.pick_best_chain.PickBestSelected "langchain_experimental.rl_chain.pick_best_chain.PickBestSelected")
(\[...\]) | Selected class for PickBest chain. | | [`rl_chain.vw_logger.VwLogger`](rl_chain/langchain_experimental.rl_chain.vw_logger.VwLogger.html#langchain_experimental.rl_chain.vw_logger.VwLogger "langchain_experimental.rl_chain.vw_logger.VwLogger")
(path) | Vowpal Wabbit custom logger. | **Functions** | | | | --- | --- | | [`rl_chain.base.BasedOn`](rl_chain/langchain_experimental.rl_chain.base.BasedOn.html#langchain_experimental.rl_chain.base.BasedOn "langchain_experimental.rl_chain.base.BasedOn")
(anything) | Wrap a value to indicate that it should be based on. | | [`rl_chain.base.Embed`](rl_chain/langchain_experimental.rl_chain.base.Embed.html#langchain_experimental.rl_chain.base.Embed "langchain_experimental.rl_chain.base.Embed")
(anything\[,Β keep\]) | Wrap a value to indicate that it should be embedded. | | [`rl_chain.base.EmbedAndKeep`](rl_chain/langchain_experimental.rl_chain.base.EmbedAndKeep.html#langchain_experimental.rl_chain.base.EmbedAndKeep "langchain_experimental.rl_chain.base.EmbedAndKeep")
(anything) | Wrap a value to indicate that it should be embedded and kept. | | [`rl_chain.base.ToSelectFrom`](rl_chain/langchain_experimental.rl_chain.base.ToSelectFrom.html#langchain_experimental.rl_chain.base.ToSelectFrom "langchain_experimental.rl_chain.base.ToSelectFrom")
(anything) | Wrap a value to indicate that it should be selected from. | | [`rl_chain.base.get_based_on_and_to_select_from`](rl_chain/langchain_experimental.rl_chain.base.get_based_on_and_to_select_from.html#langchain_experimental.rl_chain.base.get_based_on_and_to_select_from "langchain_experimental.rl_chain.base.get_based_on_and_to_select_from")
(inputs) | Get the BasedOn and ToSelectFrom from the inputs. | | [`rl_chain.base.parse_lines`](rl_chain/langchain_experimental.rl_chain.base.parse_lines.html#langchain_experimental.rl_chain.base.parse_lines "langchain_experimental.rl_chain.base.parse_lines")
(parser,Β input\_str) | Parse the input string into a list of examples. | | [`rl_chain.base.prepare_inputs_for_autoembed`](rl_chain/langchain_experimental.rl_chain.base.prepare_inputs_for_autoembed.html#langchain_experimental.rl_chain.base.prepare_inputs_for_autoembed "langchain_experimental.rl_chain.base.prepare_inputs_for_autoembed")
(inputs) | Prepare the inputs for auto embedding. | | [`rl_chain.helpers.embed`](rl_chain/langchain_experimental.rl_chain.helpers.embed.html#langchain_experimental.rl_chain.helpers.embed "langchain_experimental.rl_chain.helpers.embed")
(to\_embed,Β model\[,Β ...\]) | Embed the actions or context using the SentenceTransformer model (or a model that has an encode function). | | [`rl_chain.helpers.embed_dict_type`](rl_chain/langchain_experimental.rl_chain.helpers.embed_dict_type.html#langchain_experimental.rl_chain.helpers.embed_dict_type "langchain_experimental.rl_chain.helpers.embed_dict_type")
(item,Β model) | Embed a dictionary item. | | [`rl_chain.helpers.embed_list_type`](rl_chain/langchain_experimental.rl_chain.helpers.embed_list_type.html#langchain_experimental.rl_chain.helpers.embed_list_type "langchain_experimental.rl_chain.helpers.embed_list_type")
(item,Β model) | Embed a list item. | | [`rl_chain.helpers.embed_string_type`](rl_chain/langchain_experimental.rl_chain.helpers.embed_string_type.html#langchain_experimental.rl_chain.helpers.embed_string_type "langchain_experimental.rl_chain.helpers.embed_string_type")
(item,Β model) | Embed a string or an \_Embed object. | | [`rl_chain.helpers.is_stringtype_instance`](rl_chain/langchain_experimental.rl_chain.helpers.is_stringtype_instance.html#langchain_experimental.rl_chain.helpers.is_stringtype_instance "langchain_experimental.rl_chain.helpers.is_stringtype_instance")
(item) | Check if an item is a string. | | [`rl_chain.helpers.stringify_embedding`](rl_chain/langchain_experimental.rl_chain.helpers.stringify_embedding.html#langchain_experimental.rl_chain.helpers.stringify_embedding "langchain_experimental.rl_chain.helpers.stringify_embedding")
(embedding) | Convert an embedding to a string. | [smart\_llm](smart_llm.html#langchain-experimental-smart-llm) [#](#langchain-experimental-smart-llm "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`smart_llm.base.SmartLLMChain`](smart_llm/langchain_experimental.smart_llm.base.SmartLLMChain.html#langchain_experimental.smart_llm.base.SmartLLMChain "langchain_experimental.smart_llm.base.SmartLLMChain") | Chain for applying self-critique using the SmartGPT workflow. | [sql](sql.html#langchain-experimental-sql) [#](#langchain-experimental-sql "Link to this heading") --------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`sql.base.SQLDatabaseChain`](sql/langchain_experimental.sql.base.SQLDatabaseChain.html#langchain_experimental.sql.base.SQLDatabaseChain "langchain_experimental.sql.base.SQLDatabaseChain") | Chain for interacting with SQL Database. | | [`sql.base.SQLDatabaseSequentialChain`](sql/langchain_experimental.sql.base.SQLDatabaseSequentialChain.html#langchain_experimental.sql.base.SQLDatabaseSequentialChain "langchain_experimental.sql.base.SQLDatabaseSequentialChain") | Chain for querying SQL database that is a sequential chain. | | [`sql.vector_sql.VectorSQLDatabaseChain`](sql/langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain.html#langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain "langchain_experimental.sql.vector_sql.VectorSQLDatabaseChain") | Chain for interacting with Vector SQL Database. | | [`sql.vector_sql.VectorSQLOutputParser`](sql/langchain_experimental.sql.vector_sql.VectorSQLOutputParser.html#langchain_experimental.sql.vector_sql.VectorSQLOutputParser "langchain_experimental.sql.vector_sql.VectorSQLOutputParser") | Output Parser for Vector SQL. | | [`sql.vector_sql.VectorSQLRetrieveAllOutputParser`](sql/langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser.html#langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser "langchain_experimental.sql.vector_sql.VectorSQLRetrieveAllOutputParser") | Parser based on VectorSQLOutputParser. | **Functions** | | | | --- | --- | | [`sql.vector_sql.get_result_from_sqldb`](sql/langchain_experimental.sql.vector_sql.get_result_from_sqldb.html#langchain_experimental.sql.vector_sql.get_result_from_sqldb "langchain_experimental.sql.vector_sql.get_result_from_sqldb")
(db,Β cmd) | Get result from SQL Database. | [tabular\_synthetic\_data](tabular_synthetic_data.html#langchain-experimental-tabular-synthetic-data) [#](#langchain-experimental-tabular-synthetic-data "Link to this heading") --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`tabular_synthetic_data.base.SyntheticDataGenerator`](tabular_synthetic_data/langchain_experimental.tabular_synthetic_data.base.SyntheticDataGenerator.html#langchain_experimental.tabular_synthetic_data.base.SyntheticDataGenerator "langchain_experimental.tabular_synthetic_data.base.SyntheticDataGenerator") | Generate synthetic data using the given LLM and few-shot template. | **Functions** | | | | --- | --- | | [`tabular_synthetic_data.openai.create_openai_data_generator`](tabular_synthetic_data/langchain_experimental.tabular_synthetic_data.openai.create_openai_data_generator.html#langchain_experimental.tabular_synthetic_data.openai.create_openai_data_generator "langchain_experimental.tabular_synthetic_data.openai.create_openai_data_generator")
(...) | Create an instance of SyntheticDataGenerator tailored for OpenAI models. | [text\_splitter](text_splitter.html#langchain-experimental-text-splitter) [#](#langchain-experimental-text-splitter "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`text_splitter.SemanticChunker`](text_splitter/langchain_experimental.text_splitter.SemanticChunker.html#langchain_experimental.text_splitter.SemanticChunker "langchain_experimental.text_splitter.SemanticChunker")
(embeddings\[,Β ...\]) | Split the text based on semantic similarity. | **Functions** | | | | --- | --- | | [`text_splitter.calculate_cosine_distances`](text_splitter/langchain_experimental.text_splitter.calculate_cosine_distances.html#langchain_experimental.text_splitter.calculate_cosine_distances "langchain_experimental.text_splitter.calculate_cosine_distances")
(...) | Calculate cosine distances between sentences. | | [`text_splitter.combine_sentences`](text_splitter/langchain_experimental.text_splitter.combine_sentences.html#langchain_experimental.text_splitter.combine_sentences "langchain_experimental.text_splitter.combine_sentences")
(sentences\[,Β ...\]) | Combine sentences based on buffer size. | [tools](tools.html#langchain-experimental-tools) [#](#langchain-experimental-tools "Link to this heading") ----------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`tools.python.tool.PythonAstREPLTool`](tools/langchain_experimental.tools.python.tool.PythonAstREPLTool.html#langchain_experimental.tools.python.tool.PythonAstREPLTool "langchain_experimental.tools.python.tool.PythonAstREPLTool") | Tool for running python code in a REPL. | | [`tools.python.tool.PythonInputs`](tools/langchain_experimental.tools.python.tool.PythonInputs.html#langchain_experimental.tools.python.tool.PythonInputs "langchain_experimental.tools.python.tool.PythonInputs") | Python inputs. | | [`tools.python.tool.PythonREPLTool`](tools/langchain_experimental.tools.python.tool.PythonREPLTool.html#langchain_experimental.tools.python.tool.PythonREPLTool "langchain_experimental.tools.python.tool.PythonREPLTool") | Tool for running python code in a REPL. | **Functions** | | | | --- | --- | | [`tools.python.tool.sanitize_input`](tools/langchain_experimental.tools.python.tool.sanitize_input.html#langchain_experimental.tools.python.tool.sanitize_input "langchain_experimental.tools.python.tool.sanitize_input")
(query) | Sanitize input to the python REPL. | [tot](tot.html#langchain-experimental-tot) [#](#langchain-experimental-tot "Link to this heading") --------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`tot.base.ToTChain`](tot/langchain_experimental.tot.base.ToTChain.html#langchain_experimental.tot.base.ToTChain "langchain_experimental.tot.base.ToTChain") | Chain implementing the Tree of Thought (ToT). | | [`tot.checker.ToTChecker`](tot/langchain_experimental.tot.checker.ToTChecker.html#langchain_experimental.tot.checker.ToTChecker "langchain_experimental.tot.checker.ToTChecker") | Tree of Thought (ToT) checker. | | [`tot.controller.ToTController`](tot/langchain_experimental.tot.controller.ToTController.html#langchain_experimental.tot.controller.ToTController "langchain_experimental.tot.controller.ToTController")
(\[c\]) | Tree of Thought (ToT) controller. | | [`tot.memory.ToTDFSMemory`](tot/langchain_experimental.tot.memory.ToTDFSMemory.html#langchain_experimental.tot.memory.ToTDFSMemory "langchain_experimental.tot.memory.ToTDFSMemory")
(\[stack\]) | Memory for the Tree of Thought (ToT) chain. | | [`tot.prompts.CheckerOutputParser`](tot/langchain_experimental.tot.prompts.CheckerOutputParser.html#langchain_experimental.tot.prompts.CheckerOutputParser "langchain_experimental.tot.prompts.CheckerOutputParser") | Parse and check the output of the language model. | | [`tot.prompts.JSONListOutputParser`](tot/langchain_experimental.tot.prompts.JSONListOutputParser.html#langchain_experimental.tot.prompts.JSONListOutputParser "langchain_experimental.tot.prompts.JSONListOutputParser") | Parse the output of a PROPOSE\_PROMPT response. | | [`tot.thought.Thought`](tot/langchain_experimental.tot.thought.Thought.html#langchain_experimental.tot.thought.Thought "langchain_experimental.tot.thought.Thought") | A thought in the ToT. | | [`tot.thought.ThoughtValidity`](tot/langchain_experimental.tot.thought.ThoughtValidity.html#langchain_experimental.tot.thought.ThoughtValidity "langchain_experimental.tot.thought.ThoughtValidity")
(value\[,Β names,Β ...\]) | Enum for the validity of a thought. | | [`tot.thought_generation.BaseThoughtGenerationStrategy`](tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html#langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy "langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy") | Base class for a thought generation strategy. | | [`tot.thought_generation.ProposePromptStrategy`](tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html#langchain_experimental.tot.thought_generation.ProposePromptStrategy "langchain_experimental.tot.thought_generation.ProposePromptStrategy") | Strategy that is sequentially using a "propose prompt". | | [`tot.thought_generation.SampleCoTStrategy`](tot/langchain_experimental.tot.thought_generation.SampleCoTStrategy.html#langchain_experimental.tot.thought_generation.SampleCoTStrategy "langchain_experimental.tot.thought_generation.SampleCoTStrategy") | Sample strategy from a Chain-of-Thought (CoT) prompt. | **Functions** | | | | --- | --- | | [`tot.prompts.get_cot_prompt`](tot/langchain_experimental.tot.prompts.get_cot_prompt.html#langchain_experimental.tot.prompts.get_cot_prompt "langchain_experimental.tot.prompts.get_cot_prompt")
() | Get the prompt for the Chain of Thought (CoT) chain. | | [`tot.prompts.get_propose_prompt`](tot/langchain_experimental.tot.prompts.get_propose_prompt.html#langchain_experimental.tot.prompts.get_propose_prompt "langchain_experimental.tot.prompts.get_propose_prompt")
() | Get the prompt for the PROPOSE\_PROMPT chain. | [utilities](utilities.html#langchain-experimental-utilities) [#](#langchain-experimental-utilities "Link to this heading") --------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`utilities.python.PythonREPL`](utilities/langchain_experimental.utilities.python.PythonREPL.html#langchain_experimental.utilities.python.PythonREPL "langchain_experimental.utilities.python.PythonREPL") | Simulates a standalone Python REPL. | [video\_captioning](video_captioning.html#langchain-experimental-video-captioning) [#](#langchain-experimental-video-captioning "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------------------- **Classes** | | | | --- | --- | | [`video_captioning.base.VideoCaptioningChain`](video_captioning/langchain_experimental.video_captioning.base.VideoCaptioningChain.html#langchain_experimental.video_captioning.base.VideoCaptioningChain "langchain_experimental.video_captioning.base.VideoCaptioningChain") | Video Captioning Chain. | | [`video_captioning.models.AudioModel`](video_captioning/langchain_experimental.video_captioning.models.AudioModel.html#langchain_experimental.video_captioning.models.AudioModel "langchain_experimental.video_captioning.models.AudioModel")
(...) | | | [`video_captioning.models.BaseModel`](video_captioning/langchain_experimental.video_captioning.models.BaseModel.html#langchain_experimental.video_captioning.models.BaseModel "langchain_experimental.video_captioning.models.BaseModel")
(...) | | | [`video_captioning.models.CaptionModel`](video_captioning/langchain_experimental.video_captioning.models.CaptionModel.html#langchain_experimental.video_captioning.models.CaptionModel "langchain_experimental.video_captioning.models.CaptionModel")
(...) | | | [`video_captioning.models.VideoModel`](video_captioning/langchain_experimental.video_captioning.models.VideoModel.html#langchain_experimental.video_captioning.models.VideoModel "langchain_experimental.video_captioning.models.VideoModel")
(...) | | | [`video_captioning.services.audio_service.AudioProcessor`](video_captioning/langchain_experimental.video_captioning.services.audio_service.AudioProcessor.html#langchain_experimental.video_captioning.services.audio_service.AudioProcessor "langchain_experimental.video_captioning.services.audio_service.AudioProcessor")
(api\_key) | | | [`video_captioning.services.caption_service.CaptionProcessor`](video_captioning/langchain_experimental.video_captioning.services.caption_service.CaptionProcessor.html#langchain_experimental.video_captioning.services.caption_service.CaptionProcessor "langchain_experimental.video_captioning.services.caption_service.CaptionProcessor")
(llm) | | | [`video_captioning.services.combine_service.CombineProcessor`](video_captioning/langchain_experimental.video_captioning.services.combine_service.CombineProcessor.html#langchain_experimental.video_captioning.services.combine_service.CombineProcessor "langchain_experimental.video_captioning.services.combine_service.CombineProcessor")
(llm) | | | [`video_captioning.services.image_service.ImageProcessor`](video_captioning/langchain_experimental.video_captioning.services.image_service.ImageProcessor.html#langchain_experimental.video_captioning.services.image_service.ImageProcessor "langchain_experimental.video_captioning.services.image_service.ImageProcessor")
(\[...\]) | | | [`video_captioning.services.srt_service.SRTProcessor`](video_captioning/langchain_experimental.video_captioning.services.srt_service.SRTProcessor.html#langchain_experimental.video_captioning.services.srt_service.SRTProcessor "langchain_experimental.video_captioning.services.srt_service.SRTProcessor")
() | | --- # How-to Guides | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/contributing/how_to/index.mdx) * [**Documentation**](/docs/contributing/how_to/documentation/) : Help improve our docs, including this one! * [**Code**](/docs/contributing/how_to/code/) : Help us write code, fix bugs, or improve our infrastructure. Integrations[​](#integrations "Direct link to Integrations") ------------------------------------------------------------- * [**Start Here**](/docs/contributing/how_to/integrations/) : Help us integrate with your favorite vendors and tools. * [**Package**](/docs/contributing/how_to/integrations/package/) : Publish an integration package to PyPi * [**Standard Tests**](/docs/contributing/how_to/integrations/standard_tests/) : Ensure your integration passes an expected set of tests. * * * #### Was this page helpful? * [Integrations](#integrations) --- # Tagging | πŸ¦œοΈπŸ”— LangChain [Skip to main content](#__docusaurus_skipToContent_fallback) On this page [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/tutorials/classification.ipynb) [![Open on GitHub](https://img.shields.io/badge/Open%20on%20GitHub-grey?logo=github&logoColor=white)](https://github.com/langchain-ai/langchain/blob/master/docs/docs/tutorials/classification.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/langchain-ai/langchain/blob/master/docs/docs/use_cases/tagging.ipynb) Tagging means labeling a document with classes such as: * Sentiment * Language * Style (formal, informal etc.) * Covered topics * Political tendency ![Image description](/assets/images/tagging-93990e95451d92b715c2b47066384224.png) Overview[​](#overview "Direct link to Overview") ------------------------------------------------- Tagging has a few components: * `function`: Like [extraction](/docs/tutorials/extraction/) , tagging uses [functions](https://openai.com/blog/function-calling-and-other-api-updates) to specify how the model should tag a document * `schema`: defines how we want to tag the document Quickstart[​](#quickstart "Direct link to Quickstart") ------------------------------------------------------- Let's see a very straightforward example of how we can use OpenAI tool calling for tagging in LangChain. We'll use the [`with_structured_output`](/docs/how_to/structured_output/) method supported by OpenAI models. %pip install --upgrade --quiet langchain-core We'll need to load a [chat model](/docs/integrations/chat/) : Select [chat model](/docs/integrations/chat/) : OpenAIβ–Ύ * [OpenAI](#) * [Anthropic](#) * [Azure](#) * [Google](#) * [AWS](#) * [Cohere](#) * [NVIDIA](#) * [Fireworks AI](#) * [Groq](#) * [Mistral AI](#) * [Together AI](#) * [Databricks](#) pip install -qU langchain-openai import getpassimport osif not os.environ.get("OPENAI_API_KEY"): os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")from langchain_openai import ChatOpenAIllm = ChatOpenAI(model="gpt-4o-mini") Let's specify a Pydantic model with a few properties and their expected type in our schema. from langchain_core.prompts import ChatPromptTemplatefrom langchain_openai import ChatOpenAIfrom pydantic import BaseModel, Fieldtagging_prompt = ChatPromptTemplate.from_template( """Extract the desired information from the following passage.Only extract the properties mentioned in the 'Classification' function.Passage:{input}""")class Classification(BaseModel): sentiment: str = Field(description="The sentiment of the text") aggressiveness: int = Field( description="How aggressive the text is on a scale from 1 to 10" ) language: str = Field(description="The language the text is written in")# LLMllm = ChatOpenAI(temperature=0, model="gpt-4o-mini").with_structured_output( Classification) **API Reference:**[ChatPromptTemplate](https://python.langchain.com/api_reference/core/prompts/langchain_core.prompts.chat.ChatPromptTemplate.html) | [ChatOpenAI](https://python.langchain.com/api_reference/openai/chat_models/langchain_openai.chat_models.base.ChatOpenAI.html) inp = "Estoy increiblemente contento de haberte conocido! Creo que seremos muy buenos amigos!"prompt = tagging_prompt.invoke({"input": inp})response = llm.invoke(prompt)response Classification(sentiment='positive', aggressiveness=1, language='Spanish') If we want dictionary output, we can just call `.dict()` inp = "Estoy muy enojado con vos! Te voy a dar tu merecido!"prompt = tagging_prompt.invoke({"input": inp})response = llm.invoke(prompt)response.dict() {'sentiment': 'enojado', 'aggressiveness': 8, 'language': 'es'} As we can see in the examples, it correctly interprets what we want. The results vary so that we may get, for example, sentiments in different languages ('positive', 'enojado' etc.). We will see how to control these results in the next section. Finer control[​](#finer-control "Direct link to Finer control") ---------------------------------------------------------------- Careful schema definition gives us more control over the model's output. Specifically, we can define: * Possible values for each property * Description to make sure that the model understands the property * Required properties to be returned Let's redeclare our Pydantic model to control for each of the previously mentioned aspects using enums: class Classification(BaseModel): sentiment: str = Field(..., enum=["happy", "neutral", "sad"]) aggressiveness: int = Field( ..., description="describes how aggressive the statement is, the higher the number the more aggressive", enum=[1, 2, 3, 4, 5], ) language: str = Field( ..., enum=["spanish", "english", "french", "german", "italian"] ) tagging_prompt = ChatPromptTemplate.from_template( """Extract the desired information from the following passage.Only extract the properties mentioned in the 'Classification' function.Passage:{input}""")llm = ChatOpenAI(temperature=0, model="gpt-4o-mini").with_structured_output( Classification) Now the answers will be restricted in a way we expect! inp = "Estoy increiblemente contento de haberte conocido! Creo que seremos muy buenos amigos!"prompt = tagging_prompt.invoke({"input": inp})llm.invoke(prompt) Classification(sentiment='positive', aggressiveness=1, language='Spanish') inp = "Estoy muy enojado con vos! Te voy a dar tu merecido!"prompt = tagging_prompt.invoke({"input": inp})llm.invoke(prompt) Classification(sentiment='enojado', aggressiveness=8, language='es') inp = "Weather is ok here, I can go outside without much more than a coat"prompt = tagging_prompt.invoke({"input": inp})llm.invoke(prompt) Classification(sentiment='neutral', aggressiveness=1, language='English') The [LangSmith trace](https://smith.langchain.com/public/38294e04-33d8-4c5a-ae92-c2fe68be8332/r) lets us peek under the hood: ![Image description](/assets/images/tagging_trace-de68242b410388c0c3a3b7ca5a95b5ec.png) ### Going deeper[​](#going-deeper "Direct link to Going deeper") * You can use the [metadata tagger](/docs/integrations/document_transformers/openai_metadata_tagger/) document transformer to extract metadata from a LangChain `Document`. * This covers the same basic functionality as the tagging chain, only applied to a LangChain `Document`. * * * #### Was this page helpful? * [Overview](#overview) * [Quickstart](#quickstart) * [Finer control](#finer-control) * [Going deeper](#going-deeper) ---