Commit a9f1c3c8 authored by Jan Reimes's avatar Jan Reimes
Browse files

♻️ refactor(ai): make storage parameter required in summarize_document

parent f0e5367f
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ def _parse_structured_summary(payload: str) -> dict[str, list[str]]:
def summarize_document(
    document_id: str,
    markdown: str,
    storage: AiStorage | None = None,
    storage: AiStorage,
    workspace: str | None = None,
) -> DocumentSummary:
    """Generate summary for a document.
@@ -213,14 +213,8 @@ def summarize_document(
    Returns:
        DocumentSummary object.
    """
    from tdoc_crawler.ai.container import AiServiceContainer

    config = _get_ai_config()

    if storage is None:
        container = AiServiceContainer.get_instance()
        storage = container.get_ai_storage()

    normalized_workspace = normalize_workspace_name(workspace)

    # Compute content hash