From f5263896121721de1051ce58338a1e0ea6950ca7 Mon Sep 17 00:00:00 2001
From: Jerry Liu <jerryjliu98@gmail.com>
Date: Fri, 22 Mar 2024 00:20:33 -0700
Subject: [PATCH] edit query understanding llamapack (#12167)

---
 .../README.md                                 |  2 ++
 .../examples/query_understanding_agent.ipynb  | 27 +++++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/llama-index-packs/llama-index-packs-query-understanding-agent/README.md b/llama-index-packs/llama-index-packs-query-understanding-agent/README.md
index 2fcadd1c28..9668098d4b 100644
--- a/llama-index-packs/llama-index-packs-query-understanding-agent/README.md
+++ b/llama-index-packs/llama-index-packs-query-understanding-agent/README.md
@@ -4,6 +4,8 @@ This LlamaPack implements Query Understanding Agent
 
 Taking inspiration from Humans - when asked a query, humans would clarify what the query means before proceeding if the human sensed the query is unclear. This LlamaPack implements this.
 
+Check out the [full notebook here](https://github.com/run-llama/llama_index/blob/main/llama-index-packs/llama-index-packs-query-understanding-agent/examples/query_understanding_agent.ipynb).
+
 ### Installation
 
 ```bash
diff --git a/llama-index-packs/llama-index-packs-query-understanding-agent/examples/query_understanding_agent.ipynb b/llama-index-packs/llama-index-packs-query-understanding-agent/examples/query_understanding_agent.ipynb
index 8dea220651..3e8ccf31af 100644
--- a/llama-index-packs/llama-index-packs-query-understanding-agent/examples/query_understanding_agent.ipynb
+++ b/llama-index-packs/llama-index-packs-query-understanding-agent/examples/query_understanding_agent.ipynb
@@ -1,5 +1,22 @@
 {
  "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Query Understanding Agent LlamaPack\n",
+    "\n",
+    "<a href=\"https://colab.research.google.com/github/run-llama/llama_index/blob/main/llama-index-packs/llama-index-packs-query-understanding-agent/examples/query_understanding_agent.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
+    "\n",
+    "This notebook shows you how to use our Query Understanding Agent LlamaPack.\n",
+    "\n",
+    "This is a template showing you how to build an agent that can explicitly trigger a call for human intervention. In this specific agent, human intervention is triggered if the input query is not clear.\n",
+    "\n",
+    "This is determined by having the agent pick a given tool using our `RouterQueryEngine`, getting back the response, and then using the response and tools to determine whether the question itself is clear.\n",
+    "\n",
+    "If human intervention is needed, then a `HumanInputRequiredException` is thrown. We have an example showing how to use this exception to seek for additional human input/query clarification."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -26,7 +43,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Grab Data"
+    "## Grab Data"
    ]
   },
   {
@@ -70,7 +87,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Load Data"
+    "## Load Data"
    ]
   },
   {
@@ -97,7 +114,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Agents"
+    "## Agents"
    ]
   },
   {
@@ -131,7 +148,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Baseline"
+    "## Baseline"
    ]
   },
   {
@@ -177,7 +194,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "# Query Understanding Agent Worker"
+    "## Query Understanding Agent Worker"
    ]
   },
   {
-- 
GitLab