From 549237fb05cff8a14ca3ad93913ed7c4c6619b0f Mon Sep 17 00:00:00 2001 From: Diwakar Singh Maurya Date: Tue, 20 May 2025 18:58:13 +0000 Subject: [PATCH] Show tool call parameters along tool ouput --- backend/open_webui/utils/middleware.py | 2 +- src/lib/components/chat/Messages/CitationsModal.svelte | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index f0ff460c9..16ce553e6 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -252,7 +252,7 @@ async def chat_completion_tools_handler( "name": (f"TOOL:{tool_name}"), }, "document": [tool_result], - "metadata": [{"source": (f"TOOL:{tool_name}")}], + "metadata": [{"source": (f"TOOL:{tool_name}"), "parameters": tool_function_params}], } ) else: diff --git a/src/lib/components/chat/Messages/CitationsModal.svelte b/src/lib/components/chat/Messages/CitationsModal.svelte index 35a5594f1..ed1fb95cd 100644 --- a/src/lib/components/chat/Messages/CitationsModal.svelte +++ b/src/lib/components/chat/Messages/CitationsModal.svelte @@ -117,6 +117,12 @@ {/if} + {#if document.metadata?.parameters} +
+ {$i18n.t('Parameters')} +
+
{JSON.stringify(document.metadata.parameters, null, 2)}
+ {/if} {#if showRelevance}
{$i18n.t('Relevance')}