|
@@ -238,7 +238,7 @@
|
|
|
"rag_chain = prompt | llm | StrOutputParser()\n",
|
|
|
"\n",
|
|
|
"# Run\n",
|
|
|
- "generation = rag_chain.invoke({\"context\": docs, \"question\": question})\n",
|
|
|
+ "generation = rag_chain.invoke({\"context\": format_docs(docs), \"question\": question})\n",
|
|
|
"print(generation)"
|
|
|
]
|
|
|
},
|
|
@@ -330,6 +330,7 @@
|
|
|
"source": [
|
|
|
"from typing_extensions import TypedDict\n",
|
|
|
"from typing import List\n",
|
|
|
+ "from langchain.schema import Document\n",
|
|
|
"\n",
|
|
|
"### State\n",
|
|
|
"\n",
|
|
@@ -346,9 +347,9 @@
|
|
|
" question : str\n",
|
|
|
" generation : str\n",
|
|
|
" web_search : str\n",
|
|
|
- " documents : List[str]\n",
|
|
|
+ " documents : List[Document]\n",
|
|
|
+ "\n",
|
|
|
"\n",
|
|
|
- "from langchain.schema import Document\n",
|
|
|
"\n",
|
|
|
"### Nodes\n",
|
|
|
"\n",
|