Refactor plugin

This commit is contained in:
jinhui.li
2025-06-23 06:05:58 +08:00
parent dba8b1e6c8
commit cba0536c45
12 changed files with 432 additions and 162 deletions

View File

@@ -1,8 +1,10 @@
module.exports = async function handle(req, res) {
if (req?.body?.tools?.length) {
req.body.system.push({
type: "text",
text: `## **Important Instruction:** \nYou must use tools as frequently and accurately as possible to help the user solve their problem.\nPrioritize tool usage whenever it can enhance accuracy, efficiency, or the quality of the response.`
})
}
module.exports = {
afterTransformRequest(req, res) {
if (req?.body?.tools?.length) {
req.body.messages.push({
role: "system",
content: `## **Important Instruction:** \nYou must use tools as frequently and accurately as possible to help the user solve their problem.\nPrioritize tool usage whenever it can enhance accuracy, efficiency, or the quality of the response. `,
});
}
},
};