mirror of
https://github.com/musistudio/claude-code-router.git
synced 2026-01-30 06:12:06 +00:00
fix #900
This commit is contained in:
@@ -122,18 +122,19 @@ const getUseModel = async (
|
||||
req.log.info(`Using background model for ${req.body.model}`);
|
||||
return config.Router.background;
|
||||
}
|
||||
// The priority of websearch must be higher than thinking.
|
||||
if (
|
||||
Array.isArray(req.body.tools) &&
|
||||
req.body.tools.some((tool: any) => tool.type?.startsWith("web_search")) &&
|
||||
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;
|
||||
}
|
||||
if (
|
||||
Array.isArray(req.body.tools) &&
|
||||
req.body.tools.some((tool: any) => tool.type?.startsWith("web_search")) &&
|
||||
config.Router.webSearch
|
||||
) {
|
||||
return config.Router.webSearch;
|
||||
}
|
||||
return config.Router!.default;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user