mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
Render webpage read in chat response references on Web, Desktop apps
This commit is contained in:
@@ -87,7 +87,7 @@
|
|||||||
function generateOnlineReference(reference, index) {
|
function generateOnlineReference(reference, index) {
|
||||||
|
|
||||||
// Generate HTML for Chat Reference
|
// Generate HTML for Chat Reference
|
||||||
let title = reference.title;
|
let title = reference.title || reference.link;
|
||||||
let link = reference.link;
|
let link = reference.link;
|
||||||
let snippet = reference.snippet;
|
let snippet = reference.snippet;
|
||||||
let question = reference.question;
|
let question = reference.question;
|
||||||
@@ -191,6 +191,15 @@
|
|||||||
referenceSection.appendChild(polishedReference);
|
referenceSection.appendChild(polishedReference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onlineReference.webpages && onlineReference.webpages.length > 0) {
|
||||||
|
numOnlineReferences += onlineReference.webpages.length;
|
||||||
|
for (let index in onlineReference.webpages) {
|
||||||
|
let reference = onlineReference.webpages[index];
|
||||||
|
let polishedReference = generateOnlineReference(reference, index);
|
||||||
|
referenceSection.appendChild(polishedReference);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return numOnlineReferences;
|
return numOnlineReferences;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ To get started, just start typing below. You can also type / to see a list of co
|
|||||||
function generateOnlineReference(reference, index) {
|
function generateOnlineReference(reference, index) {
|
||||||
|
|
||||||
// Generate HTML for Chat Reference
|
// Generate HTML for Chat Reference
|
||||||
let title = reference.title;
|
let title = reference.title || reference.link;
|
||||||
let link = reference.link;
|
let link = reference.link;
|
||||||
let snippet = reference.snippet;
|
let snippet = reference.snippet;
|
||||||
let question = reference.question;
|
let question = reference.question;
|
||||||
@@ -205,6 +205,15 @@ To get started, just start typing below. You can also type / to see a list of co
|
|||||||
referenceSection.appendChild(polishedReference);
|
referenceSection.appendChild(polishedReference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onlineReference.webpages && onlineReference.webpages.length > 0) {
|
||||||
|
numOnlineReferences += onlineReference.webpages.length;
|
||||||
|
for (let index in onlineReference.webpages) {
|
||||||
|
let reference = onlineReference.webpages[index];
|
||||||
|
let polishedReference = generateOnlineReference(reference, index);
|
||||||
|
referenceSection.appendChild(polishedReference);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return numOnlineReferences;
|
return numOnlineReferences;
|
||||||
|
|||||||
Reference in New Issue
Block a user