Skip to content

Commit

Permalink
AsyncGenerator typing bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jstzwj committed Jul 1, 2024
1 parent 84b3e07 commit 56e7eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions langport/routers/gateway/openai_compatible.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async def generate_completion_stream_generator(app_settings: AppSettings, payloa
yield "data: [DONE]\n\n"


async def generate_completion_stream(app_settings: AppSettings, url: str, payload: Dict[str, Any]) -> AsyncGenerator[GenerationWorkerResult, Any, None]:
async def generate_completion_stream(app_settings: AppSettings, url: str, payload: Dict[str, Any]) -> AsyncGenerator[GenerationWorkerResult, None]:
async with httpx.AsyncClient() as client:
try:
worker_addr = await _get_worker_address(app_settings, payload["model"], "generation", client, DispatchMethod.LOTTERY)
Expand Down Expand Up @@ -252,7 +252,7 @@ async def single_completions_non_stream(app_settings: AppSettings, payload: Dict

async def chat_completion_stream_generator(
app_settings: AppSettings, payload: Dict[str, Any], n: int
) -> AsyncGenerator[str, Any, None]:
) -> AsyncGenerator[str, None]:
"""
Event stream format:
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format
Expand Down

0 comments on commit 56e7eb7

Please sign in to comment.