lovart3/lib/ai/models.ts
2025-12-17 20:15:18 +08:00

50 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export const DEFAULT_CHAT_MODEL: string =
process.env.NEXT_PUBLIC_DEFAULT_CHAT_MODEL ?? "chat-model";
export type ChatModel = {
id: string;
name: string;
description: string;
};
const baseName = (id: string, fallback: string): string =>
process.env[`NEXT_PUBLIC_MODEL_${id.toUpperCase()}_NAME`] ?? fallback;
const baseDescription = (id: string, fallback: string): string =>
process.env[`NEXT_PUBLIC_MODEL_${id.toUpperCase()}_DESCRIPTION`] ?? fallback;
export const chatModels: ChatModel[] = [
{
id: "chat-model",
name: baseName("chat-model", "Grok Vision"),
description: baseDescription(
"chat-model",
"多模态模型,支持文字与图片理解"
),
},
{
id: "chat-model-reasoning",
name: baseName("chat-model-reasoning", "Grok Reasoning"),
description: baseDescription(
"chat-model-reasoning",
"偏重复杂推理、链式思考的模型"
),
},
{
id: "qwen3-vl-plus",
name: baseName("qwen3-vl-plus", "Qwen3 VL Plus"),
description: baseDescription(
"qwen3-vl-plus",
"阿里云通义千问多模态模型(Qwen3 VL Plus,支持图文理解与推理)"
),
},
{
id: "gpt-5-nano",
name: baseName("gpt-5-nano", "GPT-5 Nano"),
description: baseDescription(
"gpt-5-nano",
"第三方 GPT-5 Nano 模型(通过 OpenAI 兼容 API 接入)"
),
},
];