Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
a9d112b5
Commit
a9d112b5
authored
Mar 01, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicit flush after yielding each stream chunk
parent
8a4458a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
coderai
coderai
+2
-0
No files found.
coderai
View file @
a9d112b5
...
@@ -1556,6 +1556,8 @@ async def stream_chat_response(
...
@@ -1556,6 +1556,8 @@ async def stream_chat_response(
}],
}],
}
}
yield
f
"data: {json.dumps(data)}
\n\n
"
yield
f
"data: {json.dumps(data)}
\n\n
"
# Explicitly flush to ensure data is sent immediately
await
asyncio
.
sleep
(
0
)
print
(
f
"DEBUG: stream_chat_response completed, {chunk_count} chunks, generated_text length: {len(generated_text)}"
)
print
(
f
"DEBUG: stream_chat_response completed, {chunk_count} chunks, generated_text length: {len(generated_text)}"
)
if
not
generated_text
.
strip
():
if
not
generated_text
.
strip
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment