Compare commits

...

2 Commits

Author SHA1 Message Date
m.dabbagh
2753b913fb enable swagger auth 2026-01-28 10:46:37 +03:30
m.dabbagh
a1fbd12874 fix: paragraph_chunker was adding "None" when the section.title was none 2026-01-27 21:08:32 +03:30
2 changed files with 20 additions and 17 deletions

View File

@ -52,8 +52,8 @@ app = FastAPI(
title="Text Processor API", title="Text Processor API",
description="Text extraction and chunking system using Hexagonal Architecture", description="Text extraction and chunking system using Hexagonal Architecture",
version="1.0.0", version="1.0.0",
# docs_url=None, docs_url=None,
# redoc_url=None, redoc_url=None,
) )
router = APIRouter( router = APIRouter(
@ -364,20 +364,20 @@ async def health_check() -> HealthCheckResponse:
# Protected Documentation Routes # Protected Documentation Routes
# ============================================================================= # =============================================================================
# @app.get("/docs", include_in_schema=False) @app.get("/docs", include_in_schema=False)
# def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)): def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)):
# return get_swagger_ui_html( return get_swagger_ui_html(
# openapi_url="/openapi.json", openapi_url="/openapi.json",
# title="Protected Text-Processor API Docs" title="Protected Text-Processor API Docs"
# ) )
#
#
# @app.get("/redoc", include_in_schema=False) @app.get("/redoc", include_in_schema=False)
# def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)): def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)):
# return get_redoc_html( return get_redoc_html(
# openapi_url="/openapi.json", openapi_url="/openapi.json",
# title="Protected Text-Processor API Docs" title="Protected Text-Processor API Docs"
# ) )
# ============================================================================= # =============================================================================
# Application Setup # Application Setup

View File

@ -309,7 +309,10 @@ class ParagraphChunker(IChunker):
# Create chunks for this section with title prefix # Create chunks for this section with title prefix
for text in chunk_texts: for text in chunk_texts:
# Prepend document title and section title to chunk content # Prepend document title and section title to chunk content
prefixed_content = f"{document_title}\n{section.title}\n{text}" if section.title:
prefixed_content = f"{document_title}\n{section.title}\n\n{text}"
else:
prefixed_content = f"{document_title}\n\n{text}"
chunk = Chunk( chunk = Chunk(
document_id=document.id, document_id=document.id,