Update all URLs to langchain docunotebooks (#1745)

This commit is contained in:
Eugene Yurtsev
2024-09-17 15:01:22 -04:00
committed by GitHub
parent 36c757e758
commit b11552a10a
22 changed files with 44 additions and 44 deletions
@@ -88,7 +88,7 @@
"source": [
"## Docs\n",
"\n",
"Load [LangChain Expression Language](https://python.langchain.com/v0.2/docs/concepts/#langchain-expression-language-lcel) (LCEL) docs as an example."
"Load [LangChain Expression Language](https://python.langchain.com/docs/concepts/#langchain-expression-language-lcel) (LCEL) docs as an example."
]
},
{
@@ -102,7 +102,7 @@
"from langchain_community.document_loaders.recursive_url_loader import RecursiveUrlLoader\n",
"\n",
"# LCEL docs\n",
"url = \"https://python.langchain.com/v0.2/docs/concepts/#langchain-expression-language-lcel\"\n",
"url = \"https://python.langchain.com/docs/concepts/#langchain-expression-language-lcel\"\n",
"loader = RecursiveUrlLoader(\n",
" url=url, max_depth=20, extractor=lambda x: Soup(x, \"html.parser\").text\n",
")\n",
@@ -238,7 +238,7 @@
"\n",
"Define the (`fetch_user_flight_information`) tool to let the agent see the current user's flight information. Then define tools to search for flights and manage the passenger's bookings stored in the SQL database.\n",
"\n",
"We the can [access the RunnableConfig](https://python.langchain.com/v0.2/docs/how_to/tool_configure/#inferring-by-parameter-type) for a given run to check the `passenger_id` of the user accessing this application. The LLM never has to provide these explicitly, they are provided for a given invocation of the graph so that each user cannot access other passengers' booking information.\n",
"We the can [access the RunnableConfig](https://python.langchain.com/docs/how_to/tool_configure/#inferring-by-parameter-type) for a given run to check the `passenger_id` of the user accessing this application. The LLM never has to provide these explicitly, they are provided for a given invocation of the graph so that each user cannot access other passengers' booking information.\n",
"\n",
"<div class=\"admonition warning\">\n",
" <p class=\"admonition-title\">Compatibility</p>\n",
+1 -1
View File
@@ -435,7 +435,7 @@
"from langchain_core.prompts import ChatPromptTemplate\n",
"\n",
"# Or you can use ChatGroq, ChatOpenAI, ChatGoogleGemini, ChatCohere, etc.\n",
"# See https://python.langchain.com/v0.2/docs/integrations/chat/ for more info on tool calling\n",
"# See https://python.langchain.com/docs/integrations/chat/ for more info on tool calling\n",
"llm = ChatAnthropic(model=\"claude-3-haiku-20240307\")\n",
"bound_llm = bind_validator_with_retries(llm, tools=tools)\n",
"prompt = ChatPromptTemplate.from_messages(\n",
+1 -1
View File
@@ -404,7 +404,7 @@
"\n",
"Before we start, make sure you have the necessary packages installed and API keys set up:\n",
"\n",
"First, install the requirements to use the [Tavily Search Engine](https://python.langchain.com/v0.2/docs/integrations/tools/tavily_search/), and set your [TAVILY_API_KEY](https://tavily.com/)."
"First, install the requirements to use the [Tavily Search Engine](https://python.langchain.com/docs/integrations/tools/tavily_search/), and set your [TAVILY_API_KEY](https://tavily.com/)."
]
},
{
@@ -454,7 +454,7 @@
"\n",
"We'll first define the tools for the agent to use in our demo. We'll give it the class search engine + calculator combo.\n",
"\n",
"If you don't want to sign up for tavily, you can replace it with the free [DuckDuckGo](https://python.langchain.com/v0.2/docs/integrations/tools/ddg/)."
"If you don't want to sign up for tavily, you can replace it with the free [DuckDuckGo](https://python.langchain.com/docs/integrations/tools/ddg/)."
]
},
{
@@ -102,7 +102,7 @@
"source": [
"## Define Tools\n",
"\n",
"We will first define the tools we want to use. For this simple example, we will use a built-in search tool via Tavily. However, it is really easy to create your own tools - see documentation [here](https://python.langchain.com/v0.2/docs/how_to/custom_tools) on how to do that."
"We will first define the tools we want to use. For this simple example, we will use a built-in search tool via Tavily. However, it is really easy to create your own tools - see documentation [here](https://python.langchain.com/docs/how_to/custom_tools) on how to do that."
]
},
{
@@ -7,7 +7,7 @@
"source": [
"# Agentic RAG\n",
"\n",
"[Retrieval Agents](https://python.langchain.com/v0.2/docs/tutorials/qa_chat_history/#agents) are useful when we want to make decisions about whether to retrieve from an index.\n",
"[Retrieval Agents](https://python.langchain.com/docs/tutorials/qa_chat_history/#agents) are useful when we want to make decisions about whether to retrieve from an index.\n",
"\n",
"To implement a retrieval agent, we simple need to give an LLM access to a retriever tool.\n",
"\n",
+1 -1
View File
@@ -27,7 +27,7 @@
"\n",
"* Let's skip the knowledge refinement phase as a first pass. This can be added back as a node, if desired. \n",
"* If *any* documents are irrelevant, let's opt to supplement retrieval with web search. \n",
"* We'll use [Tavily Search](https://python.langchain.com/v0.2/docs/integrations/tools/tavily_search/) for web search.\n",
"* We'll use [Tavily Search](https://python.langchain.com/docs/integrations/tools/tavily_search/) for web search.\n",
"* Let's use query re-writing to optimize the query for web search.\n",
"\n",
"![Screenshot 2024-04-01 at 9.28.30 AM.png](attachment:683fae34-980f-43f0-a9c2-9894bebd9157.png)"
@@ -26,7 +26,7 @@
"\n",
"* If *any* documents are irrelevant, we'll supplement retrieval with web search. \n",
"* We'll skip the knowledge refinement, but this can be added back as a node if desired. \n",
"* We'll use [Tavily Search](https://python.langchain.com/v0.2/docs/integrations/tools/tavily_search/) for web search.\n",
"* We'll use [Tavily Search](https://python.langchain.com/docs/integrations/tools/tavily_search/) for web search.\n",
"\n",
"![Screenshot 2024-06-24 at 3.03.16 PM.png](attachment:b77a7d3b-b28a-4dcf-9f1a-861f2f2c5f6c.png)"
]
@@ -43,7 +43,7 @@
"* Download [Ollama app](https://ollama.ai/).\n",
"* Pull your model of choice, e.g.: `ollama pull llama3`\n",
"\n",
"We'll use [Tavily](https://python.langchain.com/v0.2/docs/integrations/tools/tavily_search/) for web search.\n",
"We'll use [Tavily](https://python.langchain.com/docs/integrations/tools/tavily_search/) for web search.\n",
"\n",
"We'll use a vectorstore with [Nomic local embeddings](https://blog.nomic.ai/posts/nomic-embed-text-v1) or, optionally, OpenAI embeddings.\n",
"\n",
+1 -1
View File
@@ -41,7 +41,7 @@
"\n",
"## Setup\n",
"\n",
"For this example, we will provide the agent with a Tavily search engine tool. You can get an API key [here](https://app.tavily.com/sign-in) or replace with a free tool option (e.g., [duck duck go search](https://python.langchain.com/v0.2/docs/integrations/tools/ddg/)).\n",
"For this example, we will provide the agent with a Tavily search engine tool. You can get an API key [here](https://app.tavily.com/sign-in) or replace with a free tool option (e.g., [duck duck go search](https://python.langchain.com/docs/integrations/tools/ddg/)).\n",
"\n",
"Let's install the required packages and set our API keys"
]
+1 -1
View File
@@ -336,7 +336,7 @@
"source": [
"#### Node 1: Solver\n",
"\n",
"Create a `solver` node that prompts an LLM \"agent\" to use a [writePython tool](https://python.langchain.com/v0.2/docs/integrations/chat/anthropic/#integration-details) to generate the submitted code."
"Create a `solver` node that prompts an LLM \"agent\" to use a [writePython tool](https://python.langchain.com/docs/integrations/chat/anthropic/#integration-details) to generate the submitted code."
]
},
{