mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-09 03:18:18 +00:00
fix: apply model-attached tools in multi-model chats
In multi-model (compare) chats, tools attached to a model were not applied because the per-model request builder derived tool IDs only from the composer's selected tools, which are not reliably populated per model in that mode. Union each model's own attached tool IDs (limited to installed tools) into its request payload so model tools apply regardless of the composer selection state. Signed-off-by: Naveen R. Iyer <iyernaveenr@gmail.com>
This commit is contained in:
parent
09d4cccb79
commit
4c2f73b648
1 changed files with 6 additions and 1 deletions
|
|
@ -2528,7 +2528,12 @@
|
|||
const toolIds = [];
|
||||
const toolServerIds = [];
|
||||
|
||||
for (const toolId of selectedToolIds) {
|
||||
// Include this model's own attached tools so they apply in multi-model chats,
|
||||
// independent of the composer's selectedToolIds lifecycle.
|
||||
const modelDefaultToolIds = (model?.info?.meta?.toolIds ?? []).filter((id) =>
|
||||
$tools.find((t) => t.id === id)
|
||||
);
|
||||
for (const toolId of [...new Set([...selectedToolIds, ...modelDefaultToolIds])]) {
|
||||
if (toolId.startsWith('direct_server:')) {
|
||||
let serverId = toolId.replace('direct_server:', '');
|
||||
// Check if serverId is a number
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue