This commit is contained in:
musistudio
2025-10-15 21:02:51 +08:00
parent ae531241ce
commit 538bf2f1a1

View File

@@ -122,11 +122,7 @@ const getUseModel = async (
req.log.info(`Using background model for ${req.body.model}`); req.log.info(`Using background model for ${req.body.model}`);
return config.Router.background; return config.Router.background;
} }
// if exits thinking, use the think model // The priority of websearch must be higher than thinking.
if (req.body.thinking && config.Router.think) {
req.log.info(`Using think model for ${req.body.thinking}`);
return config.Router.think;
}
if ( if (
Array.isArray(req.body.tools) && Array.isArray(req.body.tools) &&
req.body.tools.some((tool: any) => tool.type?.startsWith("web_search")) && req.body.tools.some((tool: any) => tool.type?.startsWith("web_search")) &&
@@ -134,6 +130,11 @@ const getUseModel = async (
) { ) {
return config.Router.webSearch; return config.Router.webSearch;
} }
// if exits thinking, use the think model
if (req.body.thinking && config.Router.think) {
req.log.info(`Using think model for ${req.body.thinking}`);
return config.Router.think;
}
return config.Router!.default; return config.Router!.default;
}; };