Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
7538dc05
"tests/git@developer.sourcefind.cn:tsoc/superbenchmark.git" did not exist on "eeaa9b1ac9be74c0cde7c747f84e5a120ae454aa"
Commit
7538dc05
authored
May 11, 2024
by
Jun Siang Cheah
Browse files
feat: use url as source name for citations
parent
77928ae1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+6
-1
No files found.
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
7538dc05
...
...
@@ -453,6 +453,11 @@
citation.document.forEach((document, index) => {
const metadata = citation.metadata?.[index];
const id = metadata?.source ?? 'N/A';
let source = citation?.source;
// Check if ID looks like a URL
if (id.startsWith('http://') || id.startsWith('https://')) {
source = { name: id };
}
const existingSource = acc.find((item) => item.id === id);
...
...
@@ -460,7 +465,7 @@
existingSource.document.push(document);
existingSource.metadata.push(metadata);
} else {
acc.push( { id: id, source:
citation?.
source, document: [document], metadata: metadata ? [metadata] : [] } );
acc.push( { id: id, source: source, document: [document], metadata: metadata ? [metadata] : [] } );
}
});
return acc;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment