Skip to content

Commit 2bea091

Browse files
jamesbrazaCopilot
andauthored
Denying empty text going to citation_prompt (#998)
Co-authored-by: Copilot <[email protected]>
1 parent 49f9361 commit 2bea091

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paperqa/docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ async def aadd( # noqa: PLR0912
283283
use_block_parsing=parse_config.pdfs_use_block_parsing,
284284
parse_pdf=parse_config.parse_pdf,
285285
)
286-
if not texts:
286+
if not texts or not texts[0].text.strip():
287287
raise ValueError(f"Could not read document {path}. Is it empty?")
288288
result = await llm_model.call_single(
289289
messages=[

0 commit comments

Comments
 (0)