adding phrase matching to ebook rag engen #36

Merged
Richie merged 36 commits from feature/adding-phrase-matching-to-ebook-rag-engen into main 2026-07-25 10:17:10 -04:00
Showing only changes of commit c135821534 - Show all commits
+2 -1
View File
@@ -159,13 +159,14 @@ async def ingest_file(session: AsyncSession, path: Path | AsyncPath, config: Ebo
await session.flush() await session.flush()
chunk_index = add_chapter_chunks(session, source, chapter, parsed_chapter, chunk_index, config) chunk_index = add_chapter_chunks(session, source, chapter, parsed_chapter, chunk_index, config)
await session.commit()
mention_count = await index_chunk_phrase_mentions_for_book(session, source.id, config) mention_count = await index_chunk_phrase_mentions_for_book(session, source.id, config)
await session.commit()
logger.info( logger.info(
f"ebook_ingest_file_complete {source.id=} {resolved_path=} chapters={len(parsed.chapters)} {chunk_index=} " f"ebook_ingest_file_complete {source.id=} {resolved_path=} chapters={len(parsed.chapters)} {chunk_index=} "
f"{mention_count=}" f"{mention_count=}"
) )
except Exception: except Exception:
await session.rollback()
logger.exception(f"ebook_ingest_file_error {path=}") logger.exception(f"ebook_ingest_file_error {path=}")
return False return False
else: else: