mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
refac
This commit is contained in:
parent
f7a533cda6
commit
e4694d6c3f
1 changed files with 12 additions and 12 deletions
|
|
@ -2744,23 +2744,23 @@
|
|||
};
|
||||
|
||||
const responseCompletionEventHandler = (data, message) => {
|
||||
const output = Array.isArray(data?.output)
|
||||
? data.output
|
||||
: applyResponseStreamEvent(message.output ?? [], data);
|
||||
|
||||
const updatedMessage = {
|
||||
...message,
|
||||
output
|
||||
};
|
||||
message.output = applyResponseStreamEvent(message.output ?? [], data);
|
||||
|
||||
if (data?.type === 'response.output_text.delta') {
|
||||
if (navigator.vibrate && ($settings?.hapticFeedback ?? false)) {
|
||||
navigator.vibrate(5);
|
||||
const value = data.delta ?? '';
|
||||
if (!(message.content == '' && value == '\n')) {
|
||||
message.content += value;
|
||||
|
||||
if (navigator.vibrate && ($settings?.hapticFeedback ?? false)) {
|
||||
navigator.vibrate(5);
|
||||
}
|
||||
dispatchCallOverlayAudio(message);
|
||||
}
|
||||
dispatchCallOverlayAudio(updatedMessage);
|
||||
} else if (data?.type === 'response.completed' || data?.type?.endsWith('.done')) {
|
||||
message.content = getOutputText(message.output) || message.content;
|
||||
}
|
||||
|
||||
history.messages[message.id] = updatedMessage;
|
||||
history.messages[message.id] = message;
|
||||
history = history;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue