Compare commits
2 Commits
80dd901e42
...
2753b913fb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2753b913fb | ||
|
|
a1fbd12874 |
@ -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
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user