From 64c47224a0d91b06e0ed04a635c03db4c6760b71 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Fri, 10 May 2024 06:49:59 -0700 Subject: [PATCH] docs: baseUrl for ganalytics, throw on broken links (#21455) --- docs/docs/how_to/agent_executor.ipynb | 7 ++++--- docs/docs/how_to/function_calling.ipynb | 2 -- docs/docs/how_to/tools.ipynb | 8 ++++---- docs/docs/introduction.mdx | 4 ++-- docs/docs/langsmith/index.ipynb | 2 +- docs/docs/tutorials/chatbot.ipynb | 4 ++-- docs/docs/tutorials/extraction.ipynb | 2 +- docs/docs/tutorials/rag.ipynb | 2 +- docs/docusaurus.config.js | 10 ++++++---- docs/scripts/model_feat_table.py | 4 ++-- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/docs/how_to/agent_executor.ipynb b/docs/docs/how_to/agent_executor.ipynb index 8cce9e77259..8608e649476 100644 --- a/docs/docs/how_to/agent_executor.ipynb +++ b/docs/docs/how_to/agent_executor.ipynb @@ -811,9 +811,10 @@ "\n", "If you want to continue using LangChain agents, some good advanced guides are:\n", "\n", - "- [How to create a custom agent](/docs/how_to/custom_agent)\n", - "- [How to stream responses from an agent](/docs/how_to/agents_streaming)\n", - "- [How to return structured output from an agent](/docs/how_to/agent_structured)" + "- [How to use LangGraph's built-in versions of `AgentExecutor`](/docs/how_to/migrate_agent)\n", + "- [How to create a custom agent](https://python.langchain.com/v0.1/docs/modules/agents/how_to/custom_agent/)\n", + "- [How to stream responses from an agent](https://python.langchain.com/v0.1/docs/modules/agents/how_to/streaming/)\n", + "- [How to return structured output from an agent](https://python.langchain.com/v0.1/docs/modules/agents/how_to/agent_structured/)" ] }, { diff --git a/docs/docs/how_to/function_calling.ipynb b/docs/docs/how_to/function_calling.ipynb index 11d09f37f57..27982d0b2cc 100644 --- a/docs/docs/how_to/function_calling.ipynb +++ b/docs/docs/how_to/function_calling.ipynb @@ -670,8 +670,6 @@ "\n", "- **Output parsing**: See [OpenAI Tools output\n", " parsers](/docs/how_to/output_parser_structured)\n", - " and [OpenAI Functions output\n", - " parsers](/docs/modules/model_io/output_parsers/types/openai_functions/)\n", " to learn about extracting the function calling API responses into\n", " various formats.\n", "- **Structured output chains**: [Some models have constructors](/docs/how_to/structured_output) that\n", diff --git a/docs/docs/how_to/tools.ipynb b/docs/docs/how_to/tools.ipynb index 8aa06a940ca..9775c1f437a 100644 --- a/docs/docs/how_to/tools.ipynb +++ b/docs/docs/how_to/tools.ipynb @@ -31,7 +31,7 @@ "\n", "The simpler the input to a tool is, the easier it is for an LLM to be able to use it.\n", "Many agents will only work with tools that have a single string input.\n", - "For a list of agent types and which ones work with more complicated inputs, please see [this documentation](../agents/agent_types)\n", + "For a list of agent types and which ones work with more complicated inputs, please see [this documentation](https://python.langchain.com/v0.1/docs/modules/agents/agent_types/)\n", "\n", "Importantly, the name, description, and JSON schema (if used) are all used in the prompt. Therefore, it is really important that they are clear and describe exactly how the tool should be used. You may need to change the default name, description, or JSON schema if the LLM is not understanding how to use the tool.\n", "\n", @@ -409,11 +409,11 @@ "\n", "**[Built-In Tools](/docs/integrations/tools/)**: For a list of all built-in tools, see [this page](/docs/integrations/tools/)\n", " \n", - "**[Custom Tools](./custom_tools)**: Although built-in tools are useful, it's highly likely that you'll have to define your own tools. See [this guide](./custom_tools) for instructions on how to do so.\n", + "**[Custom Tools](/docs/how_to/custom_tools)**: Although built-in tools are useful, it's highly likely that you'll have to define your own tools. See [this guide](/docs/how_to/custom_tools) for instructions on how to do so.\n", " \n", - "**[Toolkits](./toolkits)**: Toolkits are collections of tools that work well together. For a more in depth description as well as a list of all built-in toolkits, see [this page](./toolkits)\n", + "**[Toolkits](/docs/how_to/toolkits)**: Toolkits are collections of tools that work well together. For a more in depth description as well as a list of all built-in toolkits, see [this page](/docs/how_to/toolkits)\n", "\n", - "**[Tools as OpenAI Functions](./tools_as_openai_functions)**: Tools are very similar to OpenAI Functions, and can easily be converted to that format. See [this notebook](./tools_as_openai_functions) for instructions on how to do that.\n", + "**[Tools as OpenAI Functions](/docs/how_to/tools_as_openai_functions/)**: Tools are very similar to OpenAI Functions, and can easily be converted to that format. See [this notebook](/docs/how_to/tools_as_openai_functions) for instructions on how to do that.\n", "\n" ] }, diff --git a/docs/docs/introduction.mdx b/docs/docs/introduction.mdx index f6b29acca8d..9210610a41b 100644 --- a/docs/docs/introduction.mdx +++ b/docs/docs/introduction.mdx @@ -54,9 +54,9 @@ These are the best ones to get started with: Explore the full list of tutorials [here](/docs/tutorials). -## [How-To Guides](/docs/how_to_guides) +## [How-To Guides](/docs/how_to) -[Here](/docs/how_to_guides) you’ll find short answers to “How do I….?” types of questions. +[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://api.python.langchain.com/en/latest/). However, these guides will help you quickly accomplish common tasks. diff --git a/docs/docs/langsmith/index.ipynb b/docs/docs/langsmith/index.ipynb index 08991159557..ce7a7040df4 100644 --- a/docs/docs/langsmith/index.ipynb +++ b/docs/docs/langsmith/index.ipynb @@ -12,7 +12,7 @@ "[LangSmith](https://smith.langchain.com) helps you trace and evaluate your language model applications and intelligent agents to help you\n", "move from prototype to production.\n", "\n", - "Check out the [interactive walkthrough](/docs/langsmith/walkthrough) to get started.\n", + "Check out the interactive walkthrough on this page to get started.\n", "\n", "For more information, please refer to the [LangSmith documentation](https://docs.smith.langchain.com/).\n", "\n", diff --git a/docs/docs/tutorials/chatbot.ipynb b/docs/docs/tutorials/chatbot.ipynb index 6e9e2bea0a1..cecf81c32a1 100644 --- a/docs/docs/tutorials/chatbot.ipynb +++ b/docs/docs/tutorials/chatbot.ipynb @@ -29,7 +29,7 @@ "Note that this chatbot that we build will only use the language model to have a conversation.\n", "There are several other related concepts that you may be looking for:\n", "\n", - "- [Conversational RAG](TODO): Enable a chatbot experience over an external source of data\n", + "- [Conversational RAG](/docs/tutorials/qa_chat_history): Enable a chatbot experience over an external source of data\n", "- [Agents](/docs/tutorials/agents): Build a chatbot that can take actions\n", "\n", "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.\n", @@ -966,7 +966,7 @@ "\n", "Now that you understand the basics of how to create a chatbot in LangChain, some more advanced tutorials you may be interested in are:\n", "\n", - "- [Conversational RAG](TODO): Enable a chatbot experience over an external source of data\n", + "- [Conversational RAG](/docs/tutorials/qa_chat_history): Enable a chatbot experience over an external source of data\n", "- [Agents](/docs/tutorials/agents): Build a chatbot that can take actions\n", "\n", "If you want to dive deeper on specifics, some things worth checking out are:\n", diff --git a/docs/docs/tutorials/extraction.ipynb b/docs/docs/tutorials/extraction.ipynb index 40b37a45444..2f4696bda07 100644 --- a/docs/docs/tutorials/extraction.ipynb +++ b/docs/docs/tutorials/extraction.ipynb @@ -194,7 +194,7 @@ "source": [ "We need to use a model that supports function/tool calling.\n", "\n", - "Please review [the documentation](/docs/concepts/function-tool-calling) for list of some models that can be used with this API." + "Please review [the documentation](/docs/concepts#function-tool-calling) for list of some models that can be used with this API." ] }, { diff --git a/docs/docs/tutorials/rag.ipynb b/docs/docs/tutorials/rag.ipynb index e84076ebcae..a70f3fefc82 100644 --- a/docs/docs/tutorials/rag.ipynb +++ b/docs/docs/tutorials/rag.ipynb @@ -424,7 +424,7 @@ "`TextSplitter`: Object that splits a list of `Document`s into smaller\n", "chunks. Subclass of `DocumentTransformer`s.\n", "\n", - "- Explore [context-aware splitters](category/text-splitters/), which keep the location (“context”) of each\n", + "- Explore [context-aware splitters](/docs/how_to#text-splitters), which keep the location (“context”) of each\n", " split in the original `Document`\n", "- [Code (py or js)](/docs/integrations/document_loaders/source_code)\n", "- [Scientific papers](/docs/integrations/document_loaders/grobid)\n", diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 3d7b8ae0c35..ad81b4914fd 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -9,6 +9,8 @@ require("dotenv").config(); const baseLightCodeBlockTheme = require("prism-react-renderer/themes/vsLight"); const baseDarkCodeBlockTheme = require("prism-react-renderer/themes/vsDark"); +const baseUrl = "/v0.2/"; + /** @type {import('@docusaurus/types').Config} */ const config = { title: "🦜️🔗 LangChain", @@ -18,10 +20,10 @@ const config = { url: "https://python.langchain.com", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: "/v0.2/", + baseUrl: baseUrl, trailingSlash: true, - onBrokenLinks: "warn", - onBrokenMarkdownLinks: "warn", + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "throw", themes: ["@docusaurus/theme-mermaid"], markdown: { @@ -315,7 +317,7 @@ const config = { }), scripts: [ - "/js/google_analytics.js", + baseUrl + "js/google_analytics.js", { src: "https://www.googletagmanager.com/gtag/js?id=G-9B66JQQH2F", async: true, diff --git a/docs/scripts/model_feat_table.py b/docs/scripts/model_feat_table.py index cb8649ca095..f8d11a535ac 100644 --- a/docs/scripts/model_feat_table.py +++ b/docs/scripts/model_feat_table.py @@ -193,8 +193,8 @@ def get_chat_model_table() -> str: "Async invoke", "Stream", "Async stream", - "[Tool calling](/docs/modules/model_io/chat/function_calling/)", - "[Structured output](/docs/modules/model_io/chat/structured_output/)", + "[Tool calling](/docs/how_to/tool_calling/)", + "[Structured output](/docs/how_to/structured_output/)", "Python Package", ] rows = [title, [":-"] + [":-:"] * (len(title) - 1)]