diff --git a/client/src/components/ai/PromptPanel.vue b/client/src/components/ai/PromptPanel.vue index 2ff3d11..237b43d 100644 --- a/client/src/components/ai/PromptPanel.vue +++ b/client/src/components/ai/PromptPanel.vue @@ -146,11 +146,10 @@ const messagesRef = ref() const naiveMessage = useMessage() const modelOptions = [ - { label: "豆包", value: "doubao-seed-2-0-lite-260215" }, - { label: "DeepSeek", value: "deepseek-v4-flash" }, - { label: "DeepSeek(思考)", value: "deepseek-v4-flash-thinking" }, + { label: "豆包", value: "doubao-seed-2-1-lite-260915" }, + { label: "DeepSeek", value: "deepseek-flash" }, ] -const selectedModel = useStorage("prompt-model", "deepseek-v4-flash") +const selectedModel = useStorage("prompt-model", "deepseek-flash") // Group messages into user+assistant pairs const submittingId = ref(null) diff --git a/server/.env.example b/server/.env.example index 2698363..6a12d2c 100644 --- a/server/.env.example +++ b/server/.env.example @@ -16,7 +16,7 @@ ENV=dev # JWT_SECRET= LLM_API_KEY= -LLM_MODEL=deepseek-v4-flash +LLM_MODEL=deepseek-flash # LLM_BASE_URL=https://api.deepseek.com ARK_API_KEY= # ARK_BASE_URL=https://ark.cn-beijing.volces.com/api/v3 diff --git a/server/src/config.ts b/server/src/config.ts index b2410b4..e7732e6 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -28,7 +28,7 @@ export const config = { // 测试时不调用真实的模型接口 llmApiKey: env.NODE_ENV === "test" ? "" : (env.LLM_API_KEY ?? ""), llmBaseUrl: env.LLM_BASE_URL ?? "https://api.deepseek.com", - llmModel: env.LLM_MODEL ?? "deepseek-v4-flash", + llmModel: env.LLM_MODEL ?? "deepseek-flash", arkApiKey: env.NODE_ENV === "test" ? "" : (env.ARK_API_KEY ?? ""), arkBaseUrl: env.ARK_BASE_URL ?? "https://ark.cn-beijing.volces.com/api/v3", } diff --git a/server/src/services/llm.ts b/server/src/services/llm.ts index cb3c3ed..77b5080 100644 --- a/server/src/services/llm.ts +++ b/server/src/services/llm.ts @@ -46,13 +46,9 @@ export const GUIDANCE_SYSTEM_PROMPT = `你是一个提示词写作教练,帮 5. 如果回复以 [READY] 开头,[READY] 不要加粗,必须保持原始文本 6. 不要生成任何代码` -const DEFAULT_MODEL = "deepseek-v4-flash" -const MODEL_ALIASES: Record = { - "deepseek-v4-flash-thinking": DEFAULT_MODEL, -} -const NON_THINKING_MODELS = new Set(["deepseek-v4-flash"]) +const DEFAULT_MODEL = "deepseek-flash" // 走火山方舟(ARK)接口的模型 -const ARK_MODELS = new Set(["doubao-seed-2-0-lite-260215"]) +const ARK_MODELS = new Set(["doubao-seed-2-1-lite-260915"]) export interface ChatMessage { role: "system" | "user" | "assistant" @@ -70,18 +66,14 @@ interface CompletionOptions { export const llmConfigured = () => !!config.llmApiKey function buildRequest(messages: ChatMessage[], opts: CompletionOptions) { - const requested = opts.model || DEFAULT_MODEL - const resolved = MODEL_ALIASES[requested] ?? requested - const ark = ARK_MODELS.has(resolved) + const model = opts.model || DEFAULT_MODEL + const ark = ARK_MODELS.has(model) const body: Record = { - model: resolved, + model, messages, stream: opts.stream, } if (opts.maxTokens) body.max_tokens = opts.maxTokens - if (NON_THINKING_MODELS.has(resolved) && !(requested in MODEL_ALIASES)) { - body.thinking = { type: "disabled" } - } const apiKey = ark ? config.arkApiKey : config.llmApiKey if (!apiKey) throw new Error("未配置模型接口密钥") const baseUrl = (ark ? config.arkBaseUrl : config.llmBaseUrl).replace(/\/$/, "")