feat: response notification

This commit is contained in:
Timothy J. Baek 2023-12-14 15:32:43 -08:00
parent ffaa1b17c5
commit e34b452509
3 changed files with 100 additions and 33 deletions

View file

@ -222,6 +222,21 @@
eval_duration: data.eval_duration
};
messages = messages;
if ($settings.responseNotification && !document.hasFocus()) {
const notification = new Notification(
selectedModelfile
? `${
selectedModelfile.title.charAt(0).toUpperCase() +
selectedModelfile.title.slice(1)
}`
: `Ollama - ${model}`,
{
body: responseMessage.content,
icon: selectedModelfile?.imageUrl ?? '/favicon.png'
}
);
}
}
}
}

View file

@ -234,6 +234,21 @@
eval_duration: data.eval_duration
};
messages = messages;
if ($settings.responseNotification && !document.hasFocus()) {
const notification = new Notification(
selectedModelfile
? `${
selectedModelfile.title.charAt(0).toUpperCase() +
selectedModelfile.title.slice(1)
}`
: `Ollama - ${model}`,
{
body: responseMessage.content,
icon: selectedModelfile?.imageUrl ?? '/favicon.png'
}
);
}
}
}
}