changes to the UI to support native_tool_call param

This commit is contained in:
Samuel 2024-11-06 19:50:31 +00:00
parent 3724e888c6
commit 25ce18d876
2 changed files with 44 additions and 0 deletions

View File

@ -1094,8 +1094,14 @@
$settings?.params?.stream_response ??
params?.stream_response ??
true;
const native_tool_call =
model?.info?.params?.native_tool_call ??
$settings?.params?.native_tool_call ??
params?.native_tool_call ??
true;
const [res, controller] = await generateChatCompletion(localStorage.token, {
stream: stream,
native_tool_call: native_tool_call,
model: model.id,
messages: messagesBody,
options: {
@ -1419,10 +1425,17 @@
params?.stream_response ??
true;
const native_tool_call =
model?.info?.params?.native_tool_call ??
$settings?.params?.native_tool_call ??
params?.native_tool_call ??
true;
const [res, controller] = await generateOpenAIChatCompletion(
localStorage.token,
{
stream: stream,
native_tool_call : native_tool_call,
model: model.id,
...(stream && (model.info?.meta?.capabilities?.usage ?? false)
? {

View File

@ -11,6 +11,7 @@
export let params = {
// Advanced
stream_response: null, // Set stream responses for this model individually
native_tool_call: null,
seed: null,
stop: null,
temperature: null,
@ -71,6 +72,36 @@
</button>
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs font-medium">
{$i18n.t('Native Tool Calls')}
</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
on:click={() => {
params.native_tool_call=
(params?.native_tool_call?? null) === null
? true
: params.native_tool_call
? false
: null;
}}
type="button"
>
{#if params.native_tool_call === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else if params.native_tool_call === 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">