File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,16 @@ async def event_generator():
56
56
assistant_id = assistant_id ,
57
57
thread_id = thread_id
58
58
)
59
+
59
60
async with stream as stream_manager :
60
61
async for text in stream_manager .text_deltas :
62
+ logger .info (text )
61
63
yield f"data: { text } \n \n "
62
64
65
+ logger .info ("Sending end message" )
66
+
63
67
# Send a done event when the stream is complete
64
- yield f "event: EndMessage\n \n "
68
+ yield "event: EndMessage\n data: DONE \n \n "
65
69
66
70
return StreamingResponse (
67
71
event_generator (),
Original file line number Diff line number Diff line change @@ -158,6 +158,10 @@ pre {
158
158
height : 100% ;
159
159
}
160
160
161
+ .assistantMessage {
162
+ white-space : pre-wrap;
163
+ }
164
+
161
165
.fileViewer {
162
166
display : flex;
163
167
flex-direction : column;
Original file line number Diff line number Diff line change 7
7
< link rel ="icon " href ="{{ url_for('static', path='openai.svg') }} ">
8
8
< link rel ="stylesheet " href ="{{ url_for('static', path='styles.css') }} ">
9
9
< link rel ="favicon " href ="{{ url_for('static', path='favicon.png') }} ">
10
- < script src ="https://unpkg.com/htmx.org@1.9.10 "> </ script >
11
- < script src ="https://unpkg.com/htmx.org/dist/ ext/sse.js "> </ script >
10
+ < script src ="https://unpkg.com/htmx.org@2.0.4 " integrity =" sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+ " crossorigin =" anonymous "> </ script >
11
+ < script src ="
https://unpkg.com/htmx- ext[email protected] /sse.js "
> </ script >
12
12
</ head >
13
13
< body >
14
14
{% block content %}
You can’t perform that action at this time.
0 commit comments