diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 045fe0a3d7..be93dc34a4 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -52,6 +52,7 @@ import CommandLine from '../icons/CommandLine.svelte'; import { KokoroWorker } from '$lib/workers/KokoroWorker'; import ToolServersModal from './ToolServersModal.svelte'; + import Wrench from '../icons/Wrench.svelte'; const i18n = getContext('i18n'); @@ -90,7 +91,7 @@ webSearchEnabled }); - let showToolServers = false; + let showTools = false; let loaded = false; let recording = false; @@ -353,7 +354,7 @@ - + {#if loaded}
@@ -397,38 +398,6 @@
- {#if selectedToolIds.length > 0} -
-
-
- - - - -
-
- {#each selectedToolIds.map((id) => { - return $tools ? $tools.find((t) => t.id === id) : { id: id, name: id }; - }) as tool, toolIdx (toolIdx)} - - {tool.name} - - - {#if toolIdx !== selectedToolIds.length - 1} - , - {/if} - {/each} -
-
-
- {/if} - {#if atSelectedModel !== undefined}
@@ -1133,6 +1102,29 @@
+ {#if toolServers.length + selectedToolIds.length > 0} + + + + {/if} + {#if $_user} {#if $config?.features?.enable_web_search && ($_user.role === 'admin' || $_user?.permissions?.features?.web_search)} @@ -1195,47 +1187,6 @@
- {#if toolServers.length > 0} - - - - {/if} - {#if !history?.currentId || history.messages[history.currentId]?.done == true}
-
-
- Open WebUI can use tools provided by any OpenAPI server.
Learn more about OpenAPI tool servers. -
-
- {#each $toolServers as toolServer} - -
-
- {toolServer?.openapi?.info?.title} - v{toolServer?.openapi?.info?.version} -
+ {#if selectedTools.length > 0} + {#if $toolServers.length > 0} +
+
{$i18n.t('Tools')}
+
+ {/if} -
- {toolServer?.openapi?.info?.description} -
- -
- {toolServer?.url} -
-
- -
- {#each toolServer?.specs ?? [] as tool_spec} -
-
- {tool_spec?.name} -
- -
- {tool_spec?.description} -
+
+
+ {#each selectedTools as tool} + +
+
+ {tool?.name}
- {/each} -
-
- {/each} + + {#if tool?.meta?.description} +
+ {tool?.meta?.description} +
+ {/if} +
+ + + + {/each} +
-
+ {/if} + + {#if $toolServers.length > 0} +
+
{$i18n.t('Tool Servers')}
+
+ +
+
+ Open WebUI can use tools provided by any OpenAPI server.
Learn more about OpenAPI tool servers. +
+
+ {#each $toolServers as toolServer} + +
+
+ {toolServer?.openapi?.info?.title} - v{toolServer?.openapi?.info?.version} +
+ +
+ {toolServer?.openapi?.info?.description} +
+ +
+ {toolServer?.url} +
+
+ +
+ {#each toolServer?.specs ?? [] as tool_spec} +
+
+ {tool_spec?.name} +
+ +
+ {tool_spec?.description} +
+
+ {/each} +
+
+ {/each} +
+
+ {/if}