fix: 临时剔除tools的input_examples参数引发的bug

This commit is contained in:
shaw
2025-11-15 14:41:05 +08:00
parent 69ecf02f46
commit d0f23dac46

View File

@@ -108,6 +108,15 @@ async function handleMessagesRequest(req, res) {
delete req.body.context_management 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( logger.api(
`🚀 Processing ${isStream ? 'stream' : 'non-stream'} request for key: ${req.apiKey.name}` `🚀 Processing ${isStream ? 'stream' : 'non-stream'} request for key: ${req.apiKey.name}`
) )