diff --git a/README.md b/README.md index e2c80af..ca5a78d 100644 --- a/README.md +++ b/README.md @@ -242,5 +242,6 @@ Thanks to the following sponsors for supporting the continued development of thi [@bobleer](https://github.com/bobleer) @\*苗 (可通过主页邮箱联系我修改 github 用户名) @\*划 (可通过主页邮箱联系我修改 github 用户名) -[@Clarence-pan](https://github.com/Clarence-pan) -[@carter003](https://github.com/carter003) +[@Clarence-pan](https://github.com/Clarence-pan) +[@carter003](https://github.com/carter003) +@S\*r (可通过主页邮箱联系我修改 github 用户名) \ No newline at end of file diff --git a/src/utils/router.ts b/src/utils/router.ts index cbe86a6..7f167a7 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -9,19 +9,19 @@ const getUseModel = (req: any, tokenCount: number, config: any) => { return req.body.model; } // if tokenCount is greater than 60K, use the long context model - if (tokenCount > 1000 * 60) { + if (tokenCount > 1000 * 60 && config.Router.longContext) { log("Using long context model due to token count:", tokenCount); - return config.Router!.longContext; + return config.Router.longContext; } // If the model is claude-3-5-haiku, use the background model - if (req.body.model?.startsWith("claude-3-5-haiku")) { + if (req.body.model?.startsWith("claude-3-5-haiku") && config.Router.background) { log("Using background model for ", req.body.model); - return config.Router!.background; + return config.Router.background; } // if exits thinking, use the think model - if (req.body.thinking) { + if (req.body.thinking && config.Router.think) { log("Using think model for ", req.body.thinking); - return config.Router!.think; + return config.Router.think; } return config.Router!.default; };