You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
current_doc.page_content += el.metadata.text_as_html if el.category == "Table" else el.text
171
172
if el.category == "Table":
172
-
documents.append(current_doc)
173
+
if current_doc is not None:
174
+
documents.append(current_doc)
173
175
current_doc = None
174
176
175
177
astra_db_store.add_documents(documents)
@@ -197,7 +199,7 @@ chain = (
197
199
198
200
== Execute queries
199
201
200
-
. Ask a question that should be answered by the text of the document - this query should return a relevant response.
202
+
. Ask a question that should be answered by the text of the document - this query should return `Reducing the attention key size hurts model quality.`.
. Ask a question with an expected lack of context.
218
-
This query should return `I don't know. The context does not provide any information about George Washington's birthdate.` because your document does not contain information about the George Washington.
222
+
This query should return `I don't know. The context does not provide any information about George Washington's birthdate.` because your document does not contain information about George Washington.
219
223
+
220
224
[source,python]
221
225
----
@@ -235,20 +239,25 @@ import os
235
239
import requests
236
240
237
241
from dotenv import load_dotenv
238
-
from langchain_community.document_loaders import unstructured
239
242
from langchain_astradb import AstraDBVectorStore
240
243
from langchain_core.documents import Document
241
244
from langchain_core.output_parsers import StrOutputParser
242
245
from langchain_core.prompts import PromptTemplate
243
246
from langchain_core.runnables import RunnablePassthrough
244
247
248
+
from langchain_community.document_loaders import (
0 commit comments