mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-27 08:14:33 +08:00
4fc7413ffa
**Changes:** - Remove all comments from custom template (align with Claude/Gemini) - Remove base_url field from template (user fills in form instead) - Simplify getCodexCustomTemplate() - no locale parameter needed - Keep preset configurations unchanged with their baseUrl values **Template now contains only:** - model_provider, model, model_reasoning_effort - disable_response_storage - [model_providers.custom] section with minimal fields **Benefits:** - ✅ Cleaner, more focused template - ✅ Consistent with other apps (no comments) - ✅ Forces users to fill base_url via form field - ✅ Reduced template size from 35+ lines to 12 lines Net change: -74 lines (codexTemplates.ts)
31 lines
585 B
TypeScript
31 lines
585 B
TypeScript
/**
|
|
* Codex 配置模板
|
|
* 用于新建自定义供应商时的默认配置
|
|
*/
|
|
|
|
export interface CodexTemplate {
|
|
auth: Record<string, any>;
|
|
config: string;
|
|
}
|
|
|
|
/**
|
|
* 获取 Codex 自定义模板
|
|
* @returns Codex 模板配置
|
|
*/
|
|
export function getCodexCustomTemplate(): CodexTemplate {
|
|
const config = `model_provider = "custom"
|
|
model = "gpt-5-codex"
|
|
model_reasoning_effort = "high"
|
|
disable_response_storage = true
|
|
|
|
[model_providers.custom]
|
|
name = "custom"
|
|
wire_api = "responses"
|
|
requires_openai_auth = true`;
|
|
|
|
return {
|
|
auth: { OPENAI_API_KEY: "" },
|
|
config,
|
|
};
|
|
}
|