Set whether to stream responses for this model individually, overriding the global setting

This commit is contained in:
kivvi 2024-09-24 11:51:47 +08:00
parent 6b463164f4
commit 40d7d7d6dd
2 changed files with 27 additions and 2 deletions

View File

@ -912,7 +912,7 @@
await tick();
const stream = $settings?.streamResponse ?? true;
const stream = model?.info?.params?.stream_response ?? $settings?.streamResponse ?? true;
const [res, controller] = await generateChatCompletion(localStorage.token, {
stream: stream,
model: model.id,
@ -1206,7 +1206,7 @@
await tick();
try {
const stream = $settings?.streamResponse ?? true;
const stream = model?.info?.params?.stream_response ?? $settings?.streamResponse ?? true;
const [res, controller] = await generateOpenAIChatCompletion(
localStorage.token,
{

View File

@ -10,6 +10,7 @@
export let params = {
// Advanced
stream_response: null, // Set stream responses for this model individually
seed: null,
stop: null,
temperature: null,
@ -42,6 +43,30 @@
</script>
<div class=" space-y-1 text-xs pb-safe-bottom">
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">
{$i18n.t('Stream Chat Response')}
</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
on:click={() => {
params.stream_response = (params?.stream_response ?? null) === null ? true : (params.stream_response ? false : null);
}}
type="button"
>
{#if params.stream_response === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else if params.stream_response === false}
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Default')}</span>
{/if}
</button>
</div>
</div>
<div class=" py-0.5 w-full justify-between">
<div class="flex w-full justify-between">
<div class=" self-center text-xs font-medium">{$i18n.t('Seed')}</div>