summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Peter Christen <mc@yacy.net>2026-03-28 17:26:50 +0100
committerMichael Peter Christen <mc@yacy.net>2026-03-28 17:26:50 +0100
commit115fdf131b940e905d1f825adde91d78bafadd1b (patch)
tree6c0311ce23180ca61e8de850e41adf0107e7cb1e
parent106730d36b4bdfa34eb12a194453b8c0208487b3 (diff)
showing different waiting messages for different activities
-rw-r--r--htroot/yacychat.html17
1 files changed, 14 insertions, 3 deletions
diff --git a/htroot/yacychat.html b/htroot/yacychat.html
index 294da5eee..447293e34 100644
--- a/htroot/yacychat.html
+++ b/htroot/yacychat.html
@@ -1829,7 +1829,7 @@
if (delta) {
if (!sawFirstDelta) {
sawFirstDelta = true;
- applyMessageContent(assistantNode, 'assistant', '');
+ applyMessageContent(assistantNode, 'assistant', 'waiting for an answer...');
if (!focusShown && typeof onFirstToken === 'function') {
focusShown = true;
onFirstToken();
@@ -1863,7 +1863,9 @@
}
}, 2000);
}
- applyMessageContent(assistantNode, 'assistant', assistantText);
+ if (assistantText) {
+ applyMessageContent(assistantNode, 'assistant', assistantText);
+ }
performAutoScroll();
}
} catch (err) {
@@ -1984,6 +1986,9 @@
if (message.tool_calls) {
sanitized.tool_calls = message.tool_calls;
}
+ if (message.tool_results) {
+ sanitized.tool_results = message.tool_results;
+ }
if (message.tool_call_id) {
sanitized.tool_call_id = message.tool_call_id;
}
@@ -2019,6 +2024,12 @@
return '';
}
+ function initialAssistantPlaceholder(message) {
+ return message?.search && message.search !== SEARCH_DEFAULTS.none
+ ? 'searching for content...'
+ : 'waiting for an answer...';
+ }
+
function inferAttachmentFromContent(content) {
if (!Array.isArray(content)) return null;
const mediaPart = content.find(part => part?.type === 'image_url' && part?.image_url?.url);
@@ -2672,7 +2683,7 @@
dom.input.value = '';
clearAttachment();
resizeComposer();
- const assistantNode = appendMessage('assistant', 'waiting for an answer...');
+ const assistantNode = appendMessage('assistant', initialAssistantPlaceholder(userMessage));
try {
await streamChat(userMessage, assistantNode, { onFirstToken: showComposer, includeUserInPayload: false, pushUserToState: false, currentUserIndex: userIndex });
} catch (err) {