add computed page intelligence: 11 analyzers for deterministic LLM context augmentation
This commit is contained in:
parent
4555e8bf98
commit
c38cae3c13
1 changed files with 13 additions and 3 deletions
|
|
@ -1902,11 +1902,21 @@ async function openUncloseaiEmbeddedModalNew() {
|
|||
// Set up page context for existing conversation
|
||||
const pageContent = await extractWebpageContent();
|
||||
const pageTitle = document.title || window.location.hostname;
|
||||
const conversationContextAppend = `
|
||||
|
||||
// Computed intelligence: instant, no API call, free for returning users
|
||||
let computedContext = "";
|
||||
try {
|
||||
const computedIntel = computePageIntelligence(pageContent);
|
||||
computedContext = formatPageIntelligence(computedIntel);
|
||||
} catch (e) {
|
||||
console.warn("Computed page intelligence failed:", e);
|
||||
}
|
||||
|
||||
const conversationContextAppend = `
|
||||
${computedContext}
|
||||
PAGE CONTEXT FOR THIS CONVERSATION:
|
||||
You are embedded on the webpage: "${pageTitle}"
|
||||
URL: ${window.location.href}
|
||||
URI: ${window.location.href}
|
||||
|
||||
FULL PAGE CONTENT:
|
||||
${pageContent}
|
||||
|
|
@ -2440,7 +2450,7 @@ ${getUIText("systemPromptInstructions")} ${languageName}.${langInstruction}`;
|
|||
// SECOND: Set up conversation system prompt for follow-up messages
|
||||
// Include the analysis so follow-up messages inherit the classified context
|
||||
const conversationContextAppend = `
|
||||
${analysisContext}
|
||||
${computedContext}${analysisContext}
|
||||
PAGE CONTEXT FOR THIS CONVERSATION:
|
||||
You are embedded on the webpage: "${pageTitle}"
|
||||
URI: ${window.location.href}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue