Skip to content

Commit 53276d3

Browse files
Slightly more informative naming
1 parent 702b035 commit 53276d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

routers/messages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ async def stream_response(
5252
) -> StreamingResponse:
5353
# Create a generator to stream the response from the assistant
5454
async def event_generator():
55-
stream: AsyncAssistantStreamManager = client.beta.threads.runs.stream(
55+
stream_manager: AsyncAssistantStreamManager = client.beta.threads.runs.stream(
5656
assistant_id=assistant_id,
5757
thread_id=thread_id
5858
)
5959

60-
async with stream as stream_manager:
61-
async for text in stream_manager.text_deltas:
60+
async with stream_manager as event_handler:
61+
async for text in event_handler.text_deltas:
6262
yield f"data: {text.replace('\n', '<br>')}\n\n"
6363

6464
# Send a done event when the stream is complete

0 commit comments

Comments
 (0)