|
14 | 14 | "In this notebook, we demonstrate how to use Llama3 with LlamaIndex for a comprehensive set of use cases. \n",
|
15 | 15 | "1. Basic completion / chat \n",
|
16 | 16 | "2. Basic RAG (Vector Search, Summarization)\n",
|
17 |
| - "3. Advanced RAG (Routing, Sub-Questions)\n", |
| 17 | + "3. Advanced RAG (Routing)\n", |
18 | 18 | "4. Text-to-SQL \n",
|
19 | 19 | "5. Structured Data Extraction\n",
|
20 | 20 | "6. Agents\n",
|
|
444 | 444 | "id": "68918eb6-f1e6-460c-b1d5-fb49c3fed4b8",
|
445 | 445 | "metadata": {},
|
446 | 446 | "source": [
|
447 |
| - "## 3. Advanced RAG (Routing, Sub-Questions)" |
| 447 | + "## 3. Advanced RAG (Routing)" |
448 | 448 | ]
|
449 | 449 | },
|
450 | 450 | {
|
|
526 | 526 | "print(response)"
|
527 | 527 | ]
|
528 | 528 | },
|
529 |
| - { |
530 |
| - "cell_type": "markdown", |
531 |
| - "id": "2af04881-6a64-475c-8c1e-e5bd3e8006ee", |
532 |
| - "metadata": {}, |
533 |
| - "source": [ |
534 |
| - "### Break Complex Questions down into Sub-Questions\n", |
535 |
| - "\n", |
536 |
| - "Our Sub-Question Query Engine breaks complex questions down into sub-questions.\n" |
537 |
| - ] |
538 |
| - }, |
539 |
| - { |
540 |
| - "cell_type": "code", |
541 |
| - "execution_count": null, |
542 |
| - "id": "2f9430df-ece7-493c-be6b-d5b371c7b8b0", |
543 |
| - "metadata": {}, |
544 |
| - "outputs": [], |
545 |
| - "source": [ |
546 |
| - "drake_index = VectorStoreIndex.from_documents(docs_drake)\n", |
547 |
| - "drake_query_engine = drake_index.as_query_engine(similarity_top_k=3)\n", |
548 |
| - "\n", |
549 |
| - "kendrick_index = VectorStoreIndex.from_documents(docs_kendrick)\n", |
550 |
| - "kendrick_query_engine = kendrick_index.as_query_engine(similarity_top_k=3)" |
551 |
| - ] |
552 |
| - }, |
553 |
| - { |
554 |
| - "cell_type": "code", |
555 |
| - "execution_count": null, |
556 |
| - "id": "f16fa210-7e15-474a-9bd2-1ac681290006", |
557 |
| - "metadata": {}, |
558 |
| - "outputs": [], |
559 |
| - "source": [ |
560 |
| - "from llama_index.core.tools import QueryEngineTool, ToolMetadata\n", |
561 |
| - "\n", |
562 |
| - "drake_tool = QueryEngineTool(\n", |
563 |
| - " drake_index.as_query_engine(),\n", |
564 |
| - " metadata=ToolMetadata(\n", |
565 |
| - " name=\"drake_search\",\n", |
566 |
| - " description=\"Useful for searching over Drake's life.\",\n", |
567 |
| - " ),\n", |
568 |
| - ")\n", |
569 |
| - "\n", |
570 |
| - "kendrick_tool = QueryEngineTool(\n", |
571 |
| - " kendrick_index.as_query_engine(),\n", |
572 |
| - " metadata=ToolMetadata(\n", |
573 |
| - " name=\"kendrick_summary\",\n", |
574 |
| - " description=\"Useful for searching over Kendrick's life.\",\n", |
575 |
| - " ),\n", |
576 |
| - ")" |
577 |
| - ] |
578 |
| - }, |
579 |
| - { |
580 |
| - "cell_type": "code", |
581 |
| - "execution_count": null, |
582 |
| - "id": "21e05b95-95cb-45f3-8fbe-d0b54a9ba988", |
583 |
| - "metadata": {}, |
584 |
| - "outputs": [], |
585 |
| - "source": [ |
586 |
| - "# from llama_index.core.query_engine import SubQuestionQueryEngine\n", |
587 |
| - "\n", |
588 |
| - "# query_engine = SubQuestionQueryEngine.from_defaults(\n", |
589 |
| - "# [drake_tool, kendrick_tool],\n", |
590 |
| - "# llm=llm_70b, # llama3-70b\n", |
591 |
| - "# verbose=True,\n", |
592 |
| - "# )\n", |
593 |
| - "\n", |
594 |
| - "# response = query_engine.query(\"Which albums did Drake release in his career?\")\n", |
595 |
| - "\n", |
596 |
| - "# print(response)" |
597 |
| - ] |
598 |
| - }, |
599 | 529 | {
|
600 | 530 | "cell_type": "markdown",
|
601 | 531 | "id": "a795f0bc-e871-4580-8983-6fb27d421fc5",
|
|
0 commit comments