add optional web search functionality with UI updates and backend integration
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
import {normalizeSources} from "./webSearchService.js";
|
||||
|
||||
export function parseSources(value) {
|
||||
try { return normalizeSources(typeof value === "string" ? JSON.parse(value) : value); }
|
||||
catch { return []; }
|
||||
}
|
||||
|
||||
export const retryStylePrompts = Object.freeze({
|
||||
shorter: "Rewrite the assistant reply to be shorter and tighter while preserving its meaning.",
|
||||
direct: "Rewrite the assistant reply to be more direct and less padded.",
|
||||
@@ -34,6 +41,7 @@ export function formatChatMessage(row) {
|
||||
id: row.id,
|
||||
role: row.role,
|
||||
content: row.content,
|
||||
...(row.sources ? {sources: parseSources(row.sources)} : {}),
|
||||
modelName: row.model_name || null,
|
||||
retryVariants,
|
||||
retryActiveIndex,
|
||||
|
||||
Reference in New Issue
Block a user