Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorrectiveRAG Notebook Error fixes #16422

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/docs/examples/workflow/corrective_rag_pack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
"\n",
" index = await ctx.get(\"index\", default=None)\n",
" tavily_tool = await ctx.get(\"tavily_tool\", default=None)\n",
" if not (index or tavily_tool)\n",
" if not (index or tavily_tool):\n",
" raise ValueError(\n",
" \"Index and tavily tool must be constructed. Run with 'documents' and 'tavily_ai_apikey' params first.\"\n",
" )\n",
Expand All @@ -288,7 +288,8 @@
"\n",
" relevancy_results = []\n",
" for node in retrieved_nodes:\n",
" relevancy = await ctx.get(\"relevancy_pipeline\").run(\n",
" relevancy_pipeline = await ctx.get(\"relevancy_pipeline\")\n",
" relevancy = relevancy_pipeline.run(\n",
" context_str=node.text, query_str=query_str\n",
" )\n",
" relevancy_results.append(relevancy.message.content.lower().strip())\n",
Expand Down Expand Up @@ -327,7 +328,8 @@
" qp = await ctx.get(\"transform_query_pipeline\")\n",
" transformed_query_str = (qp.run(query_str=query_str).message.content)\n",
" # Conduct a search with the transformed query string and collect the results.\n",
" search_results = await ctx.get(\"tavily_tool\").search(\n",
" tavily_tool = await ctx.get(\"tavily_tool\")\n",
" search_results = tavily_tool.search(\n",
" transformed_query_str, max_results=5\n",
" )\n",
" search_text = \"\\n\".join([result.text for result in search_results])\n",
Expand Down
Loading