From 35e60728b7d83ef0d1deff1d4b78d8a38cbdbbf8 Mon Sep 17 00:00:00 2001 From: Bob Lin Date: Thu, 25 Jan 2024 11:20:05 -0600 Subject: [PATCH] docs: Fix broken urls (#16559) --- .../document_loaders/tomarkdown.ipynb | 158 ++++++++---------- .../llms/promptlayer_openai.ipynb | 4 +- .../providers/vectara/vectara_chat.ipynb | 4 +- .../callbacks/filecallbackhandler.ipynb | 4 +- 4 files changed, 72 insertions(+), 98 deletions(-) diff --git a/docs/docs/integrations/document_loaders/tomarkdown.ipynb b/docs/docs/integrations/document_loaders/tomarkdown.ipynb index 28189b50817..b0a827b059b 100644 --- a/docs/docs/integrations/document_loaders/tomarkdown.ipynb +++ b/docs/docs/integrations/document_loaders/tomarkdown.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "497736aa", "metadata": {}, "outputs": [], @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "009e0036", "metadata": {}, "outputs": [], @@ -34,19 +34,19 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 8, "id": "910fb6ee", "metadata": {}, "outputs": [], "source": [ - "loader = ToMarkdownLoader.from_api_key(\n", - " url=\"https://python.langchain.com/en/latest/\", api_key=api_key\n", + "loader = ToMarkdownLoader(\n", + " url=\"https://python.langchain.com/docs/get_started/introduction\", api_key=api_key\n", ")" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 9, "id": "ac8db139", "metadata": {}, "outputs": [], @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 10, "id": "706304e9", "metadata": {}, "outputs": [ @@ -64,130 +64,106 @@ "name": "stdout", "output_type": "stream", "text": [ - "## Contents\n", + "**LangChain** is a framework for developing applications powered by language models. It enables applications that:\n", "\n", - "- [Getting Started](#getting-started)\n", - "- [Modules](#modules)\n", - "- [Use Cases](#use-cases)\n", - "- [Reference Docs](#reference-docs)\n", - "- [LangChain Ecosystem](#langchain-ecosystem)\n", - "- [Additional Resources](#additional-resources)\n", + "- **Are context-aware**: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.)\n", + "- **Reason**: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)\n", "\n", - "## Welcome to LangChain [\\#](\\#welcome-to-langchain \"Permalink to this headline\")\n", + "This framework consists of several parts.\n", "\n", - "**LangChain** is a framework for developing applications powered by language models. We believe that the most powerful and differentiated applications will not only call out to a language model, but will also be:\n", + "- **LangChain Libraries**: The Python and JavaScript libraries. Contains interfaces and integrations for a myriad of components, a basic run time for combining these components into chains and agents, and off-the-shelf implementations of chains and agents.\n", + "- **[LangChain Templates](https://python.langchain.com/docs/templates)**: A collection of easily deployable reference architectures for a wide variety of tasks.\n", + "- **[LangServe](https://python.langchain.com/docs/langserve)**: A library for deploying LangChain chains as a REST API.\n", + "- **[LangSmith](https://python.langchain.com/docs/langsmith)**: A developer platform that lets you debug, test, evaluate, and monitor chains built on any LLM framework and seamlessly integrates with LangChain.\n", "\n", - "1. _Data-aware_: connect a language model to other sources of data\n", + "![Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.](https://python.langchain.com/assets/images/langchain_stack-f21828069f74484521f38199910007c1.svg)\n", "\n", - "2. _Agentic_: allow a language model to interact with its environment\n", + "Together, these products simplify the entire application lifecycle:\n", "\n", + "- **Develop**: Write your applications in LangChain/LangChain.js. Hit the ground running using Templates for reference.\n", + "- **Productionize**: Use LangSmith to inspect, test and monitor your chains, so that you can constantly improve and deploy with confidence.\n", + "- **Deploy**: Turn any chain into an API with LangServe.\n", "\n", - "The LangChain framework is designed around these principles.\n", + "## LangChain Libraries [​](\\#langchain-libraries \"Direct link to LangChain Libraries\")\n", "\n", - "This is the Python specific portion of the documentation. For a purely conceptual guide to LangChain, see [here](https://docs.langchain.com/docs/). For the JavaScript documentation, see [here](https://js.langchain.com/docs/).\n", + "The main value props of the LangChain packages are:\n", "\n", - "## Getting Started [\\#](\\#getting-started \"Permalink to this headline\")\n", + "1. **Components**: composable tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not\n", + "2. **Off-the-shelf chains**: built-in assemblages of components for accomplishing higher-level tasks\n", "\n", - "How to get started using LangChain to create an Language Model application.\n", + "Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.\n", "\n", - "- [Quickstart Guide](https://python.langchain.com/en/latest/getting_started/getting_started.html)\n", + "The LangChain libraries themselves are made up of several different packages.\n", "\n", + "- **`langchain-core`**: Base abstractions and LangChain Expression Language.\n", + "- **`langchain-community`**: Third party integrations.\n", + "- **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.\n", "\n", - "Concepts and terminology.\n", + "## Get started [​](\\#get-started \"Direct link to Get started\")\n", "\n", - "- [Concepts and terminology](https://python.langchain.com/en/latest/getting_started/concepts.html)\n", + "[Here’s](https://python.langchain.com/docs/get_started/installation) how to install LangChain, set up your environment, and start building.\n", "\n", + "We recommend following our [Quickstart](https://python.langchain.com/docs/get_started/quickstart) guide to familiarize yourself with the framework by building your first LangChain application.\n", "\n", - "Tutorials created by community experts and presented on YouTube.\n", + "Read up on our [Security](https://python.langchain.com/docs/security) best practices to make sure you're developing safely with LangChain.\n", "\n", - "- [Tutorials](https://python.langchain.com/en/latest/getting_started/tutorials.html)\n", + "note\n", "\n", + "These docs focus on the Python LangChain library. [Head here](https://js.langchain.com) for docs on the JavaScript LangChain library.\n", "\n", - "## Modules [\\#](\\#modules \"Permalink to this headline\")\n", + "## LangChain Expression Language (LCEL) [​](\\#langchain-expression-language-lcel \"Direct link to LangChain Expression Language (LCEL)\")\n", "\n", - "These modules are the core abstractions which we view as the building blocks of any LLM-powered application.\n", + "LCEL 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.\n", "\n", - "For each module LangChain provides standard, extendable interfaces. LanghChain also provides external integrations and even end-to-end implementations for off-the-shelf use.\n", + "- **[Overview](https://python.langchain.com/docs/expression_language/)**: LCEL and its benefits\n", + "- **[Interface](https://python.langchain.com/docs/expression_language/interface)**: The standard interface for LCEL objects\n", + "- **[How-to](https://python.langchain.com/docs/expression_language/how_to)**: Key features of LCEL\n", + "- **[Cookbook](https://python.langchain.com/docs/expression_language/cookbook)**: Example code for accomplishing common tasks\n", "\n", - "The docs for each module contain quickstart examples, how-to guides, reference docs, and conceptual guides.\n", + "## Modules [​](\\#modules \"Direct link to Modules\")\n", "\n", - "The modules are (from least to most complex):\n", + "LangChain provides standard, extendable interfaces and integrations for the following modules:\n", "\n", - "- [Models](https://python.langchain.com/docs/modules/model_io/models/): Supported model types and integrations.\n", + "#### [Model I/O](https://python.langchain.com/docs/modules/model_io/) [​](\\#model-io \"Direct link to model-io\")\n", "\n", - "- [Prompts](https://python.langchain.com/en/latest/modules/prompts.html): Prompt management, optimization, and serialization.\n", + "Interface with language models\n", "\n", - "- [Memory](https://python.langchain.com/en/latest/modules/memory.html): Memory refers to state that is persisted between calls of a chain/agent.\n", + "#### [Retrieval](https://python.langchain.com/docs/modules/data_connection/) [​](\\#retrieval \"Direct link to retrieval\")\n", "\n", - "- [Indexes](https://python.langchain.com/en/latest/modules/data_connection.html): Language models become much more powerful when combined with application-specific data - this module contains interfaces and integrations for loading, querying and updating external data.\n", + "Interface with application-specific data\n", "\n", - "- [Chains](https://python.langchain.com/en/latest/modules/chains.html): Chains are structured sequences of calls (to an LLM or to a different utility).\n", + "#### [Agents](https://python.langchain.com/docs/modules/agents/) [​](\\#agents \"Direct link to agents\")\n", "\n", - "- [Agents](https://python.langchain.com/en/latest/modules/agents.html): An agent is a Chain in which an LLM, given a high-level directive and a set of tools, repeatedly decides an action, executes the action and observes the outcome until the high-level directive is complete.\n", + "Let models choose which tools to use given high-level directives\n", "\n", - "- [Callbacks](https://python.langchain.com/en/latest/modules/callbacks/getting_started.html): Callbacks let you log and stream the intermediate steps of any chain, making it easy to observe, debug, and evaluate the internals of an application.\n", + "## Examples, ecosystem, and resources [​](\\#examples-ecosystem-and-resources \"Direct link to Examples, ecosystem, and resources\")\n", "\n", + "### [Use cases](https://python.langchain.com/docs/use_cases/question_answering/) [​](\\#use-cases \"Direct link to use-cases\")\n", "\n", - "## Use Cases [\\#](\\#use-cases \"Permalink to this headline\")\n", + "Walkthroughs and techniques for common end-to-end use cases, like:\n", "\n", - "Best practices and built-in implementations for common LangChain use cases:\n", + "- [Document question answering](https://python.langchain.com/docs/use_cases/question_answering/)\n", + "- [Chatbots](https://python.langchain.com/docs/use_cases/chatbots/)\n", + "- [Analyzing structured data](https://python.langchain.com/docs/use_cases/sql/)\n", + "- and much more...\n", "\n", - "- [Autonomous Agents](https://python.langchain.com/en/latest/use_cases/autonomous_agents.html): Autonomous agents are long-running agents that take many steps in an attempt to accomplish an objective. Examples include AutoGPT and BabyAGI.\n", + "### [Integrations](https://python.langchain.com/docs/integrations/providers/) [​](\\#integrations \"Direct link to integrations\")\n", "\n", - "- [Agent Simulations](https://python.langchain.com/en/latest/use_cases/agent_simulations.html): Putting agents in a sandbox and observing how they interact with each other and react to events can be an effective way to evaluate their long-range reasoning and planning abilities.\n", + "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](https://python.langchain.com/docs/integrations/providers/).\n", "\n", - "- [Personal Assistants](https://python.langchain.com/en/latest/use_cases/personal_assistants.html): One of the primary LangChain use cases. Personal assistants need to take actions, remember interactions, and have knowledge about your data.\n", + "### [Guides](https://python.langchain.com/docs/guides/debugging) [​](\\#guides \"Direct link to guides\")\n", "\n", - "- [Question Answering](https://python.langchain.com/en/latest/use_cases/question_answering.html): Another common LangChain use case. Answering questions over specific documents, only utilizing the information in those documents to construct an answer.\n", + "Best practices for developing with LangChain.\n", "\n", - "- [Chatbots](https://python.langchain.com/en/latest/use_cases/chatbots.html): Language models love to chat, making this a very natural use of them.\n", + "### [API reference](https://api.python.langchain.com) [​](\\#api-reference \"Direct link to api-reference\")\n", "\n", - "- [Querying Tabular Data](https://python.langchain.com/en/latest/use_cases/tabular.html): Recommended reading if you want to use language models to query structured data (CSVs, SQL, dataframes, etc).\n", + "Head to the reference section for full documentation of all classes and methods in the LangChain and LangChain Experimental Python packages.\n", "\n", - "- [Code Understanding](https://python.langchain.com/en/latest/use_cases/code.html): Recommended reading if you want to use language models to analyze code.\n", + "### [Developer's guide](https://python.langchain.com/docs/contributing) [​](\\#developers-guide \"Direct link to developers-guide\")\n", "\n", - "- [Interacting with APIs](https://python.langchain.com/en/latest/use_cases/apis.html): Enabling language models to interact with APIs is extremely powerful. It gives them access to up-to-date information and allows them to take actions.\n", + "Check out the developer's guide for guidelines on contributing and help getting your dev environment set up.\n", "\n", - "- [Extraction](https://python.langchain.com/en/latest/use_cases/extraction.html): Extract structured information from text.\n", - "\n", - "- [Summarization](https://python.langchain.com/en/latest/use_cases/summarization.html): Compressing longer documents. A type of Data-Augmented Generation.\n", - "\n", - "- [Evaluation](https://python.langchain.com/en/latest/use_cases/evaluation.html): Generative models are hard to evaluate with traditional metrics. One promising approach is to use language models themselves to do the evaluation.\n", - "\n", - "\n", - "## Reference Docs [\\#](\\#reference-docs \"Permalink to this headline\")\n", - "\n", - "Full documentation on all methods, classes, installation methods, and integration setups for LangChain.\n", - "\n", - "- [Reference Documentation](https://python.langchain.com/en/latest/reference.html)\n", - "\n", - "\n", - "## LangChain Ecosystem [\\#](\\#langchain-ecosystem \"Permalink to this headline\")\n", - "\n", - "Guides for how other companies/products can be used with LangChain.\n", - "\n", - "- [LangChain Ecosystem](https://python.langchain.com/en/latest/ecosystem.html)\n", - "\n", - "\n", - "## Additional Resources [\\#](\\#additional-resources \"Permalink to this headline\")\n", - "\n", - "Additional resources we think may be useful as you develop your application!\n", - "\n", - "- [LangChainHub](https://github.com/hwchase17/langchain-hub): The LangChainHub is a place to share and explore other prompts, chains, and agents.\n", - "\n", - "- [Gallery](https://python.langchain.com/en/latest/additional_resources/gallery.html): A collection of our favorite projects that use LangChain. Useful for finding inspiration or seeing how things were done in other applications.\n", - "\n", - "- [Deployments](https://python.langchain.com/en/latest/additional_resources/deployments.html): A collection of instructions, code snippets, and template repositories for deploying LangChain apps.\n", - "\n", - "- [Tracing](https://python.langchain.com/en/latest/additional_resources/tracing.html): A guide on using tracing in LangChain to visualize the execution of chains and agents.\n", - "\n", - "- [Model Laboratory](https://python.langchain.com/en/latest/additional_resources/model_laboratory.html): Experimenting with different prompts, models, and chains is a big part of developing the best possible application. The ModelLaboratory makes it easy to do so.\n", - "\n", - "- [Discord](https://discord.gg/6adMQxSpJS): Join us on our Discord to discuss all things LangChain!\n", - "\n", - "- [YouTube](https://python.langchain.com/en/latest/additional_resources/youtube.html): A collection of the LangChain tutorials and videos.\n", - "\n", - "- [Production Support](https://forms.gle/57d8AmXBYp8PP8tZA): As you move your LangChains into production, we’d love to offer more comprehensive support. Please fill out this form and we’ll set up a dedicated support Slack channel.\n" + "Head to the [Community navigator](https://python.langchain.com/docs/community) to find places to ask questions, share feedback, meet other developers, and dream about the future of LLM’s.\n" ] } ], @@ -198,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5dde17e7", + "id": "7c89b313-adb6-4aa2-9cd8-952a5724a2ce", "metadata": {}, "outputs": [], "source": [] @@ -220,7 +196,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/docs/docs/integrations/llms/promptlayer_openai.ipynb b/docs/docs/integrations/llms/promptlayer_openai.ipynb index b4d9e4b5a24..cec2676afef 100644 --- a/docs/docs/integrations/llms/promptlayer_openai.ipynb +++ b/docs/docs/integrations/llms/promptlayer_openai.ipynb @@ -14,7 +14,7 @@ "\n", "This example showcases how to connect to [PromptLayer](https://www.promptlayer.com) to start recording your OpenAI requests.\n", "\n", - "Another example is [here](https://python.langchain.com/en/latest/ecosystem/promptlayer.html)." + "Another example is [here](https://python.langchain.com/docs/integrations/providers/promptlayer)." ] }, { @@ -225,7 +225,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.6" }, "vscode": { "interpreter": { diff --git a/docs/docs/integrations/providers/vectara/vectara_chat.ipynb b/docs/docs/integrations/providers/vectara/vectara_chat.ipynb index 208b417d14c..8a995ee1eae 100644 --- a/docs/docs/integrations/providers/vectara/vectara_chat.ipynb +++ b/docs/docs/integrations/providers/vectara/vectara_chat.ipynb @@ -5,9 +5,7 @@ "id": "134a0785", "metadata": {}, "source": [ - "# Chat Over Documents with Vectara\n", - "\n", - "This notebook is based on the [chat_vector_db](https://github.com/hwchase17/langchain/blob/master/docs/modules/chains/index_examples/chat_vector_db.html) notebook, but using Vectara as the vector database." + "# Chat Over Documents with Vectara" ] }, { diff --git a/docs/docs/modules/callbacks/filecallbackhandler.ipynb b/docs/docs/modules/callbacks/filecallbackhandler.ipynb index d2c692a7758..5b52f75db72 100644 --- a/docs/docs/modules/callbacks/filecallbackhandler.ipynb +++ b/docs/docs/modules/callbacks/filecallbackhandler.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "source": [ "# Logging to file\n", - "This example shows how to print logs to file. It shows how to use the `FileCallbackHandler`, which does the same thing as [`StdOutCallbackHandler`](https://python.langchain.com/en/latest/modules/callbacks/getting_started.html#using-an-existing-handler), but instead writes the output to file. It also uses the `loguru` library to log other outputs that are not captured by the handler." + "This example shows how to print logs to file. It shows how to use the `FileCallbackHandler`, which does the same thing as [`StdOutCallbackHandler`](https://python.langchain.com/docs/modules/callbacks/#get-started), but instead writes the output to file. It also uses the `loguru` library to log other outputs that are not captured by the handler." ] }, { @@ -166,7 +166,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.16" + "version": "3.11.6" } }, "nbformat": 4,