-
🌐 admin_panel.phpWeb, 1.54 kB⬇
-
🌐 api.jsWeb, 12.79 kB⬇
-
🌐 api.phpWeb, 7.79 kB⬇
-
🌐 app.jsWeb, 150.45 kB⬇
-
🌐 base.cssWeb, 2.23 kB⬇
-
🌐 context.jsWeb, 9.26 kB⬇
-
🌐 conversation-index.jsWeb, 10.34 kB⬇
-
🌐 conversation.jsWeb, 1.11 kB⬇
-
🌐 conversations.jsWeb, 23.87 kB⬇
-
🌐 diction.jsWeb, 935 B⬇
-
🌐 document.jsWeb, 947 B⬇
-
🌐 dynamic.phpWeb, 533 B⬇
-
📷 favicon-lg.pngImage, 9.11 kB⬇
-
📷 favicon.pngImage, 3.12 kB⬇
-
🌐 index.phpWeb, 30.31 kB⬇
-
🌐 indexjs.jsWeb, 580 B⬇
-
🌐 login.phpWeb, 876 B⬇
-
❓ manifest.webmanifestUnknown, 262 B⬇
-
🌐 memory.jsWeb, 407 B⬇
-
🌐 model-presets.jsonWeb, 7.89 kB⬇
-
🌐 models.jsonWeb, 12.83 kB⬇
-
🌐 notebook-index.jsWeb, 721 B⬇
-
⚠️ php.iniOS File, 356 B⬇
-
🌐 scratchpad-conversation.jsWeb, 2.70 kB⬇
-
🌐 scratchpad-index.jsWeb, 14.47 kB⬇
-
🌐 storage.jsWeb, 20.49 kB⬇
-
🌐 style.cssWeb, 49.16 kB⬇
-
🌐 users.jsWeb, 45.79 kB⬇
-
🌐 utility-models.jsonWeb, 1.46 kB⬇
import { formatHistoryItem } from './util/conversation-format-utils.js';
/**
* Class Conversation
* Renders complete chat conversation histories into HTML by processing history turns with formatting utilities.
*/
class Conversation {
/**
* Initializes a new instance of the Conversation class.
*/
constructor() {
}
/**
* Renders an entire conversation's history turns into an HTML string.
* @param {Object} conversation - The conversation object containing HISTORY array.
* @param {Object} [options={}] - Render options (e.g. show_suggested, show_related).
* @returns {string} The complete HTML string for the conversation.
*/
render(conversation, options = {}) {
if (!conversation) return '<p>Enter a query to get started.</p>';
const history = conversation.HISTORY || conversation.history || (Array.isArray(conversation) ? conversation : []);
if (!Array.isArray(history) || history.length === 0) return '<p>Enter a query to get started.</p>';
let html = '';
history.forEach((data, index) => {
html += formatHistoryItem(data, index, options);
});
return html;
}
}
export default Conversation;
conversation.js
×
Type: Web, text/plain
1.11 Kilobytes
Last Modified 2026-09-23 02:24:21
⬇ Download File
Type: Web, text/plain
1.11 Kilobytes
Last Modified 2026-09-23 02:24:21
⬇ Download File