add optional web search functionality with UI updates and backend integration

This commit is contained in:
2026-09-20 20:41:01 +02:00
parent abd5238252
commit 781f15b503
16 changed files with 603 additions and 41 deletions
+3
View File
@@ -1,3 +1,5 @@
import {parseSources} from "./chatMessageHelpers.js";
const VALID_PERSONA_TYPES = new Set(["assistant", "user"]);
const VALID_MESSAGE_ROLES = new Set(["user", "bot", "assistant", "system"]);
@@ -83,6 +85,7 @@ function validateMessage(message, chatIndex, messageIndex, errors) {
role: role === "assistant" ? "bot" : role,
content,
model_name: optionalText(message.model_name || message.modelName),
...(message.sources ? {sources: parseSources(message.sources)} : {}),
retryVariants,
retryActiveIndex: Number.isInteger(Number(message.retryActiveIndex ?? message.retry_active_index))
? Number(message.retryActiveIndex ?? message.retry_active_index)