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
d9316079
Commit
d9316079
authored
Jun 18, 2024
by
Timothy J. Baek
Browse files
refac: files
parent
b4bdea6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+14
-14
No files found.
src/lib/components/chat/Chat.svelte
View file @
d9316079
...
@@ -586,19 +586,19 @@
...
@@ -586,19 +586,19 @@
}
}
});
});
let
doc
s = [];
let
file
s = [];
if (model?.info?.meta?.knowledge ?? false) {
if (model?.info?.meta?.knowledge ?? false) {
doc
s = model.info.meta.knowledge;
file
s = model.info.meta.knowledge;
}
}
doc
s = [
file
s = [
...
doc
s,
...
file
s,
...messages
...messages
.filter((message) => message?.files ?? null)
.filter((message) => message?.files ?? null)
.map((message) =>
.map((message) =>
message.files.filter((item) =>
message.files.filter((item) =>
['doc', 'collection', 'web_search_results'].includes(item.type)
['doc',
'file',
'collection', 'web_search_results'].includes(item.type)
)
)
)
)
.flat(1)
.flat(1)
...
@@ -634,8 +634,8 @@
...
@@ -634,8 +634,8 @@
format: $settings.requestFormat ?? undefined,
format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined,
keep_alive: $settings.keepAlive ?? undefined,
tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined,
tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined,
docs: doc
s.length > 0 ?
doc
s : undefined,
files: file
s.length > 0 ?
file
s : undefined,
citations:
doc
s.length > 0,
citations:
file
s.length > 0,
chat_id: $chatId
chat_id: $chatId
});
});
...
@@ -831,19 +831,19 @@
...
@@ -831,19 +831,19 @@
let _response = null;
let _response = null;
const responseMessage = history.messages[responseMessageId];
const responseMessage = history.messages[responseMessageId];
let
doc
s = [];
let
file
s = [];
if (model?.info?.meta?.knowledge ?? false) {
if (model?.info?.meta?.knowledge ?? false) {
doc
s = model.info.meta.knowledge;
file
s = model.info.meta.knowledge;
}
}
doc
s = [
file
s = [
...
doc
s,
...
file
s,
...messages
...messages
.filter((message) => message?.files ?? null)
.filter((message) => message?.files ?? null)
.map((message) =>
.map((message) =>
message.files.filter((item) =>
message.files.filter((item) =>
['doc', 'collection', 'web_search_results'].includes(item.type)
['doc',
'file',
'collection', 'web_search_results'].includes(item.type)
)
)
)
)
.flat(1)
.flat(1)
...
@@ -937,8 +937,8 @@
...
@@ -937,8 +937,8 @@
frequency_penalty: $settings?.params?.frequency_penalty ?? undefined,
frequency_penalty: $settings?.params?.frequency_penalty ?? undefined,
max_tokens: $settings?.params?.max_tokens ?? undefined,
max_tokens: $settings?.params?.max_tokens ?? undefined,
tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined,
tool_ids: selectedToolIds.length > 0 ? selectedToolIds : undefined,
docs: doc
s.length > 0 ?
doc
s : undefined,
files: file
s.length > 0 ?
file
s : undefined,
citations:
doc
s.length > 0,
citations:
file
s.length > 0,
chat_id: $chatId
chat_id: $chatId
},
},
`${OPENAI_API_BASE_URL}`
`${OPENAI_API_BASE_URL}`
...
...
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