feat: add configurable AI model pool
This commit is contained in:
@@ -179,112 +179,10 @@ CATEGORIES = [
|
||||
),
|
||||
SettingCategory(
|
||||
id="models",
|
||||
label="AI 模型",
|
||||
description="统一配置总调度、空间理解和生图模型;同一个聚合 API 可以同时承担三类能力。",
|
||||
test_targets=["ai_models"],
|
||||
label="模型池",
|
||||
description="分别添加大语言模型与多模态模型。每个模型独立配置、独立测试,再用于总调度、空间理解或生图路由。",
|
||||
required_for_workflow=True,
|
||||
fields=[
|
||||
SettingField(
|
||||
key="ai_provider",
|
||||
label="API 来源",
|
||||
description="选择自然语意预设;自建或其他聚合服务选择兼容接口。",
|
||||
kind="select",
|
||||
required=True,
|
||||
default="lingke",
|
||||
options=[
|
||||
option("lingke", "聚合引擎 AIGC", "你提供的 lk666.ai 聚合服务,模型名以其控制台为准。"),
|
||||
option("openai", "OpenAI 官方", "直接使用 OpenAI 官方 API。"),
|
||||
option("custom", "其他兼容接口", "支持 OpenAI 请求格式的代理、自建或聚合服务。"),
|
||||
],
|
||||
),
|
||||
SettingField(
|
||||
key="ai_base_url",
|
||||
label="API Base URL",
|
||||
description="填写到 /v1 层级;聚合引擎的准确地址请从登录后的开发者文档复制。",
|
||||
kind="url",
|
||||
required=True,
|
||||
placeholder="https://example.com/v1",
|
||||
),
|
||||
SettingField(
|
||||
key="ai_api_key",
|
||||
label="API Key",
|
||||
description="同一聚合账号可供总调度、多模态和生图使用。",
|
||||
kind="password",
|
||||
required=True,
|
||||
secret=True,
|
||||
),
|
||||
SettingField(
|
||||
key="orchestrator_model",
|
||||
label="总调度模型",
|
||||
description="负责追问、拆解任务、维护 Plan / Scene / Style 状态。",
|
||||
kind="combobox",
|
||||
required=True,
|
||||
placeholder="选择预设或输入平台模型 ID",
|
||||
options=[
|
||||
option("gpt-5.6-terra", "GPT-5.6 Terra", "速度与规划能力均衡,适合日常工作流。"),
|
||||
option("gpt-5.6-sol", "GPT-5.6 Sol", "更强推理,适合复杂户型和高价值方案。"),
|
||||
option("gpt-5", "GPT-5", "通用调度预设,具体可用性取决于账号。"),
|
||||
],
|
||||
),
|
||||
SettingField(
|
||||
key="vision_model",
|
||||
label="空间理解模型",
|
||||
description="读取户型、参考图和渲染结果,判断空间关系与审美一致性。",
|
||||
kind="combobox",
|
||||
required=True,
|
||||
placeholder="选择预设或输入多模态模型 ID",
|
||||
options=[
|
||||
option("gpt-5.6-sol", "GPT-5.6 Sol", "优先空间推理和复杂视觉评审。"),
|
||||
option("gemini-3-pro", "Gemini 3 Pro", "长上下文与多模态理解预设。"),
|
||||
option("gpt-5", "GPT-5", "通用多模态预设。"),
|
||||
],
|
||||
),
|
||||
SettingField(
|
||||
key="image_model",
|
||||
label="默认生图模型",
|
||||
description="先使用你指定的 gpt-image-2;后续可以增加按任务自动路由。",
|
||||
kind="combobox",
|
||||
required=True,
|
||||
default="gpt-image-2",
|
||||
options=[
|
||||
option("gpt-image-2", "GPT Image 2", "默认室内方向图与局部编辑模型。"),
|
||||
option("seedream-5.0", "Seedream 5.0", "适合高质量中文场景生成,模型 ID 以平台为准。"),
|
||||
option("nano-banana-pro", "Nano Banana Pro", "适合参考图编辑,模型 ID 以平台为准。"),
|
||||
],
|
||||
),
|
||||
SettingField(
|
||||
key="ai_models_path",
|
||||
label="模型列表路径",
|
||||
description="测试按钮使用。OpenAI 兼容接口通常为 /models。",
|
||||
kind="text",
|
||||
default="/models",
|
||||
advanced=True,
|
||||
),
|
||||
SettingField(
|
||||
key="ai_chat_path",
|
||||
label="对话路径",
|
||||
description="OpenAI 兼容接口通常为 /chat/completions。",
|
||||
kind="text",
|
||||
default="/chat/completions",
|
||||
advanced=True,
|
||||
),
|
||||
SettingField(
|
||||
key="ai_image_generation_path",
|
||||
label="生图路径",
|
||||
description="OpenAI 兼容接口通常为 /images/generations。",
|
||||
kind="text",
|
||||
default="/images/generations",
|
||||
advanced=True,
|
||||
),
|
||||
SettingField(
|
||||
key="ai_image_edit_path",
|
||||
label="图片编辑路径",
|
||||
description="OpenAI 兼容接口通常为 /images/edits。",
|
||||
kind="text",
|
||||
default="/images/edits",
|
||||
advanced=True,
|
||||
),
|
||||
],
|
||||
fields=[],
|
||||
),
|
||||
SettingCategory(
|
||||
id="gpu",
|
||||
|
||||
Reference in New Issue
Block a user