mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 08:32:17 +00:00
fix: 去除context_management会导致压缩失败还原逻辑 [skip ci]
This commit is contained in:
@@ -179,18 +179,18 @@ async function handleMessagesRequest(req, res) {
|
||||
const isStream = req.body.stream === true
|
||||
|
||||
// 临时修复新版本客户端,删除context_management字段,避免报错
|
||||
if (req.body.context_management) {
|
||||
delete req.body.context_management
|
||||
}
|
||||
// if (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
|
||||
}
|
||||
})
|
||||
}
|
||||
// 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}`
|
||||
|
||||
Reference in New Issue
Block a user