From 25ce18d8761d409f89ad46a54d73782d18f8b18a Mon Sep 17 00:00:00 2001 From: Samuel Date: Wed, 6 Nov 2024 19:50:31 +0000 Subject: [PATCH] changes to the UI to support native_tool_call param --- src/lib/components/chat/Chat.svelte | 13 ++++++++ .../Settings/Advanced/AdvancedParams.svelte | 31 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 83e3b967f..f6819f4bc 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -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) ? { diff --git a/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte b/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte index 95b27b889..382924b19 100644 --- a/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte +++ b/src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte @@ -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 @@ +
+
+
+ {$i18n.t('Native Tool Calls')} +
+ + +
+
+ +