Compare commits

..

No commits in common. "2753b913fb90e99660d5035c67c0cbcff8cfbe0b" and "80dd901e427f1482f9dc1dd7cb2bb55c05f8d3b4" have entirely different histories.

2 changed files with 17 additions and 20 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,10 +309,7 @@ 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
if section.title: prefixed_content = f"{document_title}\n{section.title}\n{text}"
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,