{"record":{"id":"89be642491da99f9","repo":"zylon-ai/private-gpt","slug":"streaming-responses-are-not-yet-implemented-for-su","errorCode":null,"errorMessage":"Streaming responses are not yet implemented for summarization","messagePattern":"Streaming responses are not yet implemented for summarization","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/workflows/others/summary.py","lineNumber":241,"sourceCode":"\n        if ev.output_cls and isinstance(response, PydanticResponse):\n            if not response.response:\n                raise ValueError(\"No response was generated\")\n\n            return SummarizeResultEvent(\n                output_obj=response.response,\n            )\n\n        if isinstance(response, Response):\n            summary = response.response or ev.empty_response_fallback or \"\"\n            if not summary:\n                raise ValueError(\"No summary was generated\")\n\n            sanitized = MarkdownHelper.sanitize_markdown(summary)\n            return SummarizeResultEvent(summary=sanitized or summary)\n\n        elif isinstance(response, StreamingResponse):\n            raise NotImplementedError(\n                \"Streaming responses are not yet implemented for summarization\"\n            )\n\n        raise TypeError(f\"Unsupported response type: {type(response)}\")\n","sourceCodeStart":223,"sourceCodeEnd":246,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/workflows/others/summary.py#L223-L246","documentation":"execute_summarize explicitly rejects StreamingResponse: the summarization workflow requires a complete response to sanitize and return as one SummarizeResultEvent, so a query engine configured for streaming (response_mode='compact'/'streaming', streaming=True, or a streaming synthesizer) raises NotImplementedError by design.","triggerScenarios":"Constructing the summary query engine with streaming=True or a CustomSynthesisBuilder that returns StreamingResponse, then running the SummarizeWorkflow; using a shared engine instance configured for chat streaming inside the summarize path.","commonSituations":"Reusing the chat-ingestion engine (streaming) for summarization; upgrading pipelines where the default engine became streaming; wiring a StreamingResponse-capable retriever/synthesizer into the summary workflow.","solutions":["Configure a separate non-streaming query engine for the SummarizeWorkflow (streaming=False, complete responses).","If streaming summaries are required, collect the stream to completion (response.response_gen fully consumed -> Response) before feeding the workflow, or implement a streaming branch in execute_summarize.","Check CustomSynthesisBuilder / synthesize() settings used by summary_query_engine to ensure they produce Response, not StreamingResponse."],"exampleFix":"# before\nengine = summary_query_engine(..., streaming=True)\n\n# after\nengine = summary_query_engine(..., streaming=False)","handlingStrategy":"validation","validationCode":"engine = summary_query_engine(..., streaming=False)\nassert not getattr(engine, 'streaming', False), 'summarization engine must not stream'","typeGuard":"def is_complete_response(r: object) -> bool:\n    return isinstance(r, Response) or isinstance(r, PydanticResponse)","tryCatchPattern":"except NotImplementedError as e:\n    if 'Streaming' in str(e):\n        response = await collect_stream_to_response(response_gen)\n    else:\n        raise","preventionTips":["Dedicate a non-streaming engine instance to the summary workflow","Integration-test the workflow with the production engine config","Document that SummarizeWorkflow requires complete responses"],"tags":["streaming","not-implemented","summarization","configuration"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}