From d0f23dac4699a7aca76c15ea0c08ab57eea5b7f3 Mon Sep 17 00:00:00 2001 From: shaw Date: Sat, 15 Nov 2025 14:41:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=B4=E6=97=B6=E5=89=94=E9=99=A4tool?= =?UTF-8?q?s=E7=9A=84input=5Fexamples=E5=8F=82=E6=95=B0=E5=BC=95=E5=8F=91?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/api.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/routes/api.js b/src/routes/api.js index d731c5e2..0e749e6a 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -108,6 +108,15 @@ async function handleMessagesRequest(req, res) { delete req.body.context_management } + // 遍历tools数组,删除input_examples字段 + if (req.body.tools && Array.isArray(req.body.tools)) { + req.body.tools.forEach((tool) => { + if (tool && typeof tool === 'object' && tool.input_examples) { + delete tool.input_examples + } + }) + } + logger.api( `🚀 Processing ${isStream ? 'stream' : 'non-stream'} request for key: ${req.apiKey.name}` )