Sfoglia il codice sorgente

some colab links and typo fixes

Jeff Tang 11 mesi fa
parent
commit
64643142cf

+ 6 - 6
recipes/use_cases/agents/langchain/langgraph-custom-agent.ipynb

@@ -5,7 +5,7 @@
    "id": "1d42f85e-a931-4942-aa6e-b833291f102a",
    "id": "1d42f85e-a931-4942-aa6e-b833291f102a",
    "metadata": {},
    "metadata": {},
    "source": [
    "source": [
-    "<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/use_cases/agents/langchain/langgraph-agent.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
+    "<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/use_cases/agents/langchain/langgraph-custom-agent.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
    ]
    ]
   },
   },
   {
   {
@@ -42,7 +42,7 @@
     "\n",
     "\n",
     "We can still implement an agent in LangGraph.\n",
     "We can still implement an agent in LangGraph.\n",
     "\n",
     "\n",
-    "As we showed before, we'll give Llama 3 with various multi-model capabilities using an agent. \n",
+    "As we showed before, we'll give Llama 3 with various multi-modal capabilities using an agent. \n",
     "\n",
     "\n",
     "![Screenshot 2024-05-14 at 3.28.29 PM.png](attachment:bfb9c05d-e857-423e-bacd-26e52fff67a9.png)"
     "![Screenshot 2024-05-14 at 3.28.29 PM.png](attachment:bfb9c05d-e857-423e-bacd-26e52fff67a9.png)"
    ]
    ]
@@ -126,7 +126,7 @@
    "source": [
    "source": [
     "### 3. Text-2-Image\n",
     "### 3. Text-2-Image\n",
     "\n",
     "\n",
-    "We'll use Replicate, which [hosts an open DALL-E model](https://replicate.com/lucataco/open-dalle-v1.1/versions/1c7d4c8dec39c7306df7794b28419078cb9d18b9213ab1c21fdc46a1deca0144).\n",
+    "We'll use [Replicate](https://replicate.com/), which offers free to try API key and hosts an [open DALL-E model](https://replicate.com/lucataco/open-dalle-v1.1/versions/1c7d4c8dec39c7306df7794b28419078cb9d18b9213ab1c21fdc46a1deca0144).\n",
     "\n",
     "\n",
     "Test the code before converting it to a tool (this may take 1-2 minutes to run):"
     "Test the code before converting it to a tool (this may take 1-2 minutes to run):"
    ]
    ]
@@ -213,7 +213,7 @@
    "source": [
    "source": [
     "### 4. Image-2-Text\n",
     "### 4. Image-2-Text\n",
     "\n",
     "\n",
-    "We'll use Replicate, which [hosts llava-13b](https://replicate.com/yorickvp/llava-13b).\n",
+    "We'll use Replicate, which hosts [llava-13b](https://replicate.com/yorickvp/llava-13b).\n",
     "\n",
     "\n",
     "Test the code before converting it to a tool:"
     "Test the code before converting it to a tool:"
    ]
    ]
@@ -261,7 +261,7 @@
    "source": [
    "source": [
     "### 5. Text-2-Speech\n",
     "### 5. Text-2-Speech\n",
     "\n",
     "\n",
-    "We'll use Replicate, which [hosts text-2-speech](https://replicate.com/cjwbw/seamless_communication)."
+    "We'll use Replicate, which hosts [text-2-speech](https://replicate.com/cjwbw/seamless_communication)."
    ]
    ]
   },
   },
   {
   {
@@ -923,7 +923,7 @@
    "name": "python",
    "name": "python",
    "nbconvert_exporter": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
    "pygments_lexer": "ipython3",
-   "version": "3.11.9"
+   "version": "3.10.14"
   }
   }
  },
  },
  "nbformat": 4,
  "nbformat": 4,

+ 14 - 6
recipes/use_cases/agents/langchain/langgraph-tool-calling-agent.ipynb

@@ -1,6 +1,14 @@
 {
 {
  "cells": [
  "cells": [
   {
   {
+   "cell_type": "markdown",
+   "id": "8ac4ba3b-c438-4f2e-8f52-39846beb5642",
+   "metadata": {},
+   "source": [
+    "<a href=\"https://colab.research.google.com/github/meta-llama/llama-recipes/blob/main/recipes/use_cases/agents/langchain/langgraph-tool-calling-agent.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
+   ]
+  },
+  {
    "cell_type": "code",
    "cell_type": "code",
    "execution_count": null,
    "execution_count": null,
    "id": "974c2eb0-4844-4e0d-ae91-91571d070a3f",
    "id": "974c2eb0-4844-4e0d-ae91-91571d070a3f",
@@ -30,8 +38,8 @@
     "\n",
     "\n",
     "It allows for more customization than agent executor:\n",
     "It allows for more customization than agent executor:\n",
     "\n",
     "\n",
-    "1) It allows us to define `nodes` for our assistant (which decides whether to call a tool) and our actions (tool calls)\n",
-    "2) It allows us to define specific `edges` that connect these nodes (e.g., based upon whether a tool call is decided)\n",
+    "1) It allows us to define `nodes` for our assistant (which decides whether to call a tool) and our actions (tool calls).\n",
+    "2) It allows us to define specific `edges` that connect these nodes (e.g., based upon whether a tool call is decided).\n",
     "3) It enables `cycles`, where we can call our assistant in a loop until a stopping condition.\n",
     "3) It enables `cycles`, where we can call our assistant in a loop until a stopping condition.\n",
     "\n",
     "\n",
     "![Screenshot 2024-05-14 at 2.17.55 PM.png](attachment:76e788ea-72ee-4a39-9f6c-6911d2937b84.png)\n",
     "![Screenshot 2024-05-14 at 2.17.55 PM.png](attachment:76e788ea-72ee-4a39-9f6c-6911d2937b84.png)\n",
@@ -42,7 +50,7 @@
     "\n",
     "\n",
     "As before, we'll use [Tavily](https://tavily.com/#api) for web search.\n",
     "As before, we'll use [Tavily](https://tavily.com/#api) for web search.\n",
     "\n",
     "\n",
-    "We'll use Replicate for various multi-modal capabilities.\n",
+    "We'll use [Replicate](https://replicate.com/), which offers free to try API key and for various multi-modal capabilities.\n",
     "\n",
     "\n",
     "We can review LangChain LLM integrations that support tool calling [here](https://python.langchain.com/docs/integrations/chat/).\n",
     "We can review LangChain LLM integrations that support tool calling [here](https://python.langchain.com/docs/integrations/chat/).\n",
     "\n",
     "\n",
@@ -250,9 +258,9 @@
    "source": [
    "source": [
     "### Assistant \n",
     "### Assistant \n",
     "\n",
     "\n",
-    "This is llama3, with tool-calling, using [Groq](https://python.langchain.com/v0.1/docs/integrations/chat/groq/).\n",
+    "This is Llama 3, with tool-calling, using [Groq](https://python.langchain.com/v0.1/docs/integrations/chat/groq/).\n",
     "\n",
     "\n",
-    "We bind the available tools to the llm. \n",
+    "We bind the available tools to Llama 3. \n",
     "\n",
     "\n",
     "And we further specify the available tools in our assistant prompt."
     "And we further specify the available tools in our assistant prompt."
    ]
    ]
@@ -815,7 +823,7 @@
    "name": "python",
    "name": "python",
    "nbconvert_exporter": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
    "pygments_lexer": "ipython3",
-   "version": "3.11.9"
+   "version": "3.10.14"
   }
   }
  },
  },
  "nbformat": 4,
  "nbformat": 4,

+ 5 - 5
recipes/use_cases/agents/langchain/tool-calling-agent.ipynb

@@ -34,7 +34,7 @@
     "\n",
     "\n",
     "LangChain's [agent executor](https://python.langchain.com/docs/modules/agents/agent_types/tool_calling/) offers a simple way to quickly get started with agents.\n",
     "LangChain's [agent executor](https://python.langchain.com/docs/modules/agents/agent_types/tool_calling/) offers a simple way to quickly get started with agents.\n",
     "\n",
     "\n",
-    "Here, we will show how to augment a tool-calling version of Llama 3 with various multi-model capabilities using an agent. \n",
+    "Here, we will show how to augment a tool-calling version of Llama 3 with various multi-modal capabilities using an agent. \n",
     "\n",
     "\n",
     "![image.png](attachment:6af2e76d-6f3d-44c9-a128-c19e70a400e9.png)"
     "![image.png](attachment:6af2e76d-6f3d-44c9-a128-c19e70a400e9.png)"
    ]
    ]
@@ -133,7 +133,7 @@
    "source": [
    "source": [
     "### 3. Text-2-Image\n",
     "### 3. Text-2-Image\n",
     "\n",
     "\n",
-    "We'll use Replicate, which [hosts an open DALL-E model](https://replicate.com/lucataco/open-dalle-v1.1/versions/1c7d4c8dec39c7306df7794b28419078cb9d18b9213ab1c21fdc46a1deca0144).\n",
+    "We'll use [Replicate](https://replicate.com/), which offers free to try API key and hosts an [open DALL-E model](https://replicate.com/lucataco/open-dalle-v1.1/versions/1c7d4c8dec39c7306df7794b28419078cb9d18b9213ab1c21fdc46a1deca0144).\n",
     "\n",
     "\n",
     "Test the code (this may take 1-2 minutes to run):"
     "Test the code (this may take 1-2 minutes to run):"
    ]
    ]
@@ -259,7 +259,7 @@
    "source": [
    "source": [
     "### 4. Image-2-Text\n",
     "### 4. Image-2-Text\n",
     "\n",
     "\n",
-    "We'll use Replicate, which [hosts llava-13b](https://replicate.com/yorickvp/llava-13b).\n",
+    "We'll use Replicate, which hosts [llava-13b](https://replicate.com/yorickvp/llava-13b).\n",
     "\n",
     "\n",
     "Test the code before converting it to a tool:"
     "Test the code before converting it to a tool:"
    ]
    ]
@@ -340,7 +340,7 @@
    "source": [
    "source": [
     "### 5. Text-2-Speech\n",
     "### 5. Text-2-Speech\n",
     "\n",
     "\n",
-    "We'll use Replicate, which [hosts text-2-speech](https://replicate.com/cjwbw/seamless_communication).\n",
+    "We'll use Replicate, which hosts [text-2-speech](https://replicate.com/cjwbw/seamless_communication).\n",
     "\n",
     "\n",
     "Test the code before creating yet another custom tool (this may take a couple of minutes to run):"
     "Test the code before creating yet another custom tool (this may take a couple of minutes to run):"
    ]
    ]
@@ -833,7 +833,7 @@
    "name": "python",
    "name": "python",
    "nbconvert_exporter": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
    "pygments_lexer": "ipython3",
-   "version": "3.11.9"
+   "version": "3.10.14"
   }
   }
  },
  },
  "nbformat": 4,
  "nbformat": 4,