set system prompt at the top
This commit is contained in:
parent
d031c8ce86
commit
e98dad71e5
@ -3,6 +3,7 @@ import { showAlert } from './shared_functions.js';
|
||||
let chatCount = 0; // Zähler für Chat-Sessions
|
||||
let currentChatId = null; // Aktuell angezeigte Chat-ID
|
||||
let useMarkdown = true;
|
||||
let sysprompt = "You are a knowledgeable assistant.";
|
||||
|
||||
document.getElementById('newChatButton').addEventListener('click', () => {
|
||||
createNewChat();
|
||||
@ -268,7 +269,7 @@ async function stream_api_open_ai(userMessage) {
|
||||
botMessageDiv.className = 'chat-message assistant';
|
||||
chatBox.prepend(botMessageDiv);
|
||||
|
||||
let send_message_system = [{ role: "system", content: "You are a knowledgeable assistant." }];
|
||||
let send_message_system = [{ role: "system", content: sysprompt }];
|
||||
let send_message_user = getAllCurrentChatMessages();
|
||||
let send_message_final = send_message_system.concat(send_message_user)
|
||||
console.log(send_message_final)
|
||||
@ -342,7 +343,7 @@ function formatArrayToCustomString(array) {
|
||||
// Tokenizer
|
||||
async function tokenize_api_open_ai() {
|
||||
|
||||
let send_message_system = [{ role: "system", content: "You are a knowledgeable assistant." }];
|
||||
let send_message_system = [{ role: "system", content: sysprompt }];
|
||||
let send_message_user = getAllCurrentChatMessages();
|
||||
let send_message_final = send_message_system.concat(send_message_user)
|
||||
let formattedString = `"${formatArrayToCustomString(send_message_final)}"`;
|
||||
|
Loading…
Reference in New Issue
Block a user