fix: type SSE stream wrapper as AsyncIterator (basedpyright)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
adavyas 2026-07-24 11:37:57 -04:00
parent fc9de0f0d9
commit 9334852a3e
1 changed files with 2 additions and 2 deletions

View File

@ -281,7 +281,7 @@ async def chat(
workspace-wide questions ("what themes are common across users?",
"which peers discussed X?").
"""
from typing import Any as _Any
from collections.abc import AsyncIterator
from pydantic import BaseModel as _BaseModel
@ -300,7 +300,7 @@ async def chat(
if options.stream:
async def format_sse_stream(chunks: _Any) -> _Any:
async def format_sse_stream(chunks: AsyncIterator[str]) -> AsyncIterator[str]:
async for chunk in chunks:
yield f"data: {json.dumps({'delta': {'content': chunk}, 'done': False})}\n\n"
yield f"data: {json.dumps({'done': True})}\n\n"