diff --git a/tools/server/public/index.html.gz b/tools/server/public/index.html.gz
index 53b71079c1e2a..c6f1afa4bf67d 100644
Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ
diff --git a/tools/server/webui/src/utils/app.context.tsx b/tools/server/webui/src/utils/app.context.tsx
index 96cffd95aba7c..a4256494e48c3 100644
--- a/tools/server/webui/src/utils/app.context.tsx
+++ b/tools/server/webui/src/utils/app.context.tsx
@@ -249,14 +249,37 @@ export const AppContextProvider = ({
throw new Error(body?.error?.message || 'Unknown error');
}
const chunks = getSSEStreamAsync(fetchResponse);
+ let thinkingTagOpen = false;
for await (const chunk of chunks) {
// const stop = chunk.stop;
if (chunk.error) {
throw new Error(chunk.error?.message || 'Unknown error');
}
+
+ const reasoningContent = chunk.choices[0].delta.reasoning_content;
+ if (reasoningContent) {
+ if (pendingMsg.content === null || pendingMsg.content === '') {
+ thinkingTagOpen = true;
+ pendingMsg = {
+ ...pendingMsg,
+ content: '' + reasoningContent,
+ };
+ } else {
+ pendingMsg = {
+ ...pendingMsg,
+ content: pendingMsg.content + reasoningContent,
+ };
+ }
+ }
+
const addedContent = chunk.choices[0].delta.content;
- const lastContent = pendingMsg.content || '';
+ let lastContent = pendingMsg.content || '';
if (addedContent) {
+ if (thinkingTagOpen) {
+ lastContent = lastContent + '';
+ thinkingTagOpen = false;
+ }
+
pendingMsg = {
...pendingMsg,
content: lastContent + addedContent,