Compare commits
2 Commits
80dd901e42
...
2753b913fb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2753b913fb | ||
|
|
a1fbd12874 |
@ -52,8 +52,8 @@ app = FastAPI(
|
||||
title="Text Processor API",
|
||||
description="Text extraction and chunking system using Hexagonal Architecture",
|
||||
version="1.0.0",
|
||||
# docs_url=None,
|
||||
# redoc_url=None,
|
||||
docs_url=None,
|
||||
redoc_url=None,
|
||||
)
|
||||
|
||||
router = APIRouter(
|
||||
@ -364,20 +364,20 @@ async def health_check() -> HealthCheckResponse:
|
||||
# Protected Documentation Routes
|
||||
# =============================================================================
|
||||
|
||||
# @app.get("/docs", include_in_schema=False)
|
||||
# def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)):
|
||||
# return get_swagger_ui_html(
|
||||
# openapi_url="/openapi.json",
|
||||
# title="Protected Text-Processor API Docs"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# @app.get("/redoc", include_in_schema=False)
|
||||
# def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)):
|
||||
# return get_redoc_html(
|
||||
# openapi_url="/openapi.json",
|
||||
# title="Protected Text-Processor API Docs"
|
||||
# )
|
||||
@app.get("/docs", include_in_schema=False)
|
||||
def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)):
|
||||
return get_swagger_ui_html(
|
||||
openapi_url="/openapi.json",
|
||||
title="Protected Text-Processor API Docs"
|
||||
)
|
||||
|
||||
|
||||
@app.get("/redoc", include_in_schema=False)
|
||||
def api_docs(_: HTTPBasicCredentials = Depends(check_docs_credentials)):
|
||||
return get_redoc_html(
|
||||
openapi_url="/openapi.json",
|
||||
title="Protected Text-Processor API Docs"
|
||||
)
|
||||
|
||||
# =============================================================================
|
||||
# Application Setup
|
||||
|
||||
@ -309,7 +309,10 @@ class ParagraphChunker(IChunker):
|
||||
# Create chunks for this section with title prefix
|
||||
for text in chunk_texts:
|
||||
# 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(
|
||||
document_id=document.id,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user