Wie ordne ich Corpus+LLM-Chatblasen in der richtigen Reihenfolge neu an?HTML

HTML-Programmierer
Anonymous
 Wie ordne ich Corpus+LLM-Chatblasen in der richtigen Reihenfolge neu an?

Post by Anonymous »

Ich schreibe ein generatives AI-Corpus- und AI-Vocal-Analyse-Tool, das dazu dient, die Stimme von Menschen zu trainieren und Feedback zu geben. Ich verwende qwen4b-instruct als LLM und habe es wirklich gut veranlasst, aber meine Pipeline sieht so aus. Korpus > Wiki-Daten > LLM mit Umleitung, Ausweichfunktionen und Sicherheitsmaßnahmen. Ich bin zu 99,5 % fertig, das schwöre ich, und habe ein Vorstellungsgespräch, in dem ich sagte, ich würde dieses Projekt vorstellen, aber alles funktioniert, aber der JS druckt nicht in Ordnung. Ich habe zwei Versionen, ein fehlerhaftes, aber konsistenteres Backup, das Nachrichten in der richtigen Reihenfolge schreibt, und eine voll funktionsfähige KI, die immer wieder dieselbe Wortblase ersetzt.
In beiden Codes verwende ich

Code: Select all

function onSendMessage(textRaw) {
if (!textRaw || !textRaw.trim()) return;

appendMessage(textRaw, 'user');
showTypingIndicator();

const interp = interpretUserText(textRaw);
const artist = extractArtistName(textRaw);

setTimeout(async () => {
removeTypingIndicator();
if (!CORPUS_READY && corpusPromise) await corpusPromise;

if (artist) {
const facts =
(await fetchArtistFactsWikidataSearch(artist)) ||
getArtistFactsMock(artist);

const intent = interp.wants_style ? "style_compare" : "artist_info";

const corpusLine = getResponseByIntent(intent, {
artist: facts?.name || artist
});

appendMessage(corpusLine, "coach");

if (USE_LLM) {
const prompt = buildLLMPrompt({
userText: textRaw,
intent,
corpusLine,
artistFacts: facts
});

// Optional: shadow prompt logging (your flag)
if (SHADOW_LLM) {
console.group("🜂 Shadow LLM Prompt");
console.log(prompt);
console.groupEnd();
}

callLLM(prompt).then(llmReply => {
if (llmReply && llmReply.trim()) {
updateLastCoachMessage(
[
corpusLine,
facts?.description ? `\n\n${facts.description}` : "",
llmReply
].filter(Boolean).join("\n\n")
);
}
});
}

return;
}

if (interp.technique) {
const corpusLine = getResponseByIntent("technique_coaching", {
technique: interp.technique
});

appendMessage(corpusLine, "coach");

if (USE_LLM) {
const prompt = buildLLMPrompt({
userText: textRaw,
intent: "technique_coaching",
corpusLine,
artistFacts: null
});

if (SHADOW_LLM) {
console.group("🜂 Shadow LLM Prompt");
console.log(prompt);
console.groupEnd();
}

callLLM(prompt).then(llmReply => {
if (llmReply && llmReply.trim()) {
updateLastCoachMessage(llmReply);
}
});
}

return;
}

const corpusLine = getResponseByIntent("metal_fallback");

appendMessage(corpusLine, "coach");

if (USE_LLM) {
const prompt = buildLLMPrompt({
userText: textRaw,
intent: "metal_fallback",
corpusLine,
artistFacts: null
});

if (SHADOW_LLM) {
console.group("🜂 Shadow LLM Prompt");
console.log(prompt);
console.groupEnd();
}

callLLM(prompt).then(llmReply => {
if (llmReply && llmReply.trim()) {
updateLastCoachMessage(llmReply);
}
});
}

}, 900);
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post