mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-30 10:25:05 +08:00
feat: add Chat Completions routing for 22 Codex third-party presets
Enable openai_chat routing with explicit model catalogs across the major Chinese/Asian providers (DeepSeek, Zhipu GLM, Kimi, MiniMax, Baidu Qianfan, Bailian, StepFun, Volcengine Agent Plan, BytePlus, DouBaoSeed, ModelScope, Longcat, BaiLing, Xiaomi MiMo, SiliconFlow, Novita AI, Nvidia, etc.). Each preset declares its context window so the UI can size catalog rows when the preset is picked. Also lands two consistency fixes uncovered along the way: - Include setCodexCatalogModels in resetCodexConfig's useCallback deps to match the new third parameter it consumes. - Realign TheRouter Codex test to the "custom" model_provider bucket established by the recent third-party unification; the previous assertion predated that refactor and had been failing on HEAD.
This commit is contained in:
@@ -1512,7 +1512,7 @@ function ProviderFormFull({
|
||||
const auth = preset.auth ?? {};
|
||||
const config = preset.config ?? "";
|
||||
|
||||
resetCodexConfig(auth, config);
|
||||
resetCodexConfig(auth, config, preset.modelCatalog ?? []);
|
||||
setLocalCodexApiFormat(
|
||||
preset.apiFormat ??
|
||||
codexApiFormatFromWireApi(extractCodexWireApi(config)) ??
|
||||
|
||||
@@ -224,7 +224,7 @@ export function useCodexConfigState({ initialData }: UseCodexConfigStateProps) {
|
||||
setCodexApiKey("");
|
||||
}
|
||||
},
|
||||
[setCodexAuth, setCodexConfig],
|
||||
[setCodexAuth, setCodexConfig, setCodexCatalogModels],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user