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
a75a9c95
Unverified
Commit
a75a9c95
authored
Aug 03, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Aug 03, 2024
Browse files
Merge pull request #4329 from cheahjs/fix/missing-openai-usage-info
fix: missing openai usage information
parents
800ba206
283234d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+1
-6
No files found.
src/lib/components/chat/Chat.svelte
View file @
a75a9c95
...
@@ -1128,7 +1128,6 @@
...
@@ -1128,7 +1128,6 @@
if (res && res.ok && res.body) {
if (res && res.ok && res.body) {
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
let lastUsage = null;
for await (const update of textStream) {
for await (const update of textStream) {
const { value, done, citations, error, usage } = update;
const { value, done, citations, error, usage } = update;
...
@@ -1154,7 +1153,7 @@
...
@@ -1154,7 +1153,7 @@
}
}
if (usage) {
if (usage) {
lastUsage = usage
;
responseMessage.info = { ...usage, openai: true }
;
}
}
if (citations) {
if (citations) {
...
@@ -1208,10 +1207,6 @@
...
@@ -1208,10 +1207,6 @@
document.getElementById(`speak-button-${responseMessage.id}`)?.click();
document.getElementById(`speak-button-${responseMessage.id}`)?.click();
}
}
if (lastUsage) {
responseMessage.info = { ...lastUsage, openai: true };
}
if ($chatId == _chatId) {
if ($chatId == _chatId) {
if ($settings.saveChatHistory ?? true) {
if ($settings.saveChatHistory ?? true) {
chat = await updateChatById(localStorage.token, _chatId, {
chat = await updateChatById(localStorage.token, _chatId, {
...
...
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