feat: 新增服务商 + 文件上传优化 + AskQuestion 改进

新增功能:
- 新增字节火山方舟 (Volcengine Ark) 快速配置预设
  - 支持用户输入模型名称,映射到聊天输入框模型选择器
  - 模型名称存入 extra_env 的 ANTHROPIC_MODEL
- 新增阿里云百炼 (Aliyun Bailian) 快速配置预设
  - 内置 7 个模型供用户直接选择(Qwen 3.5 Plus、Kimi K2.5、GLM-5 等)
  - 无需额外配置模型名称
- 两个服务商均使用 @lobehub/icons 品牌图标 (Volcengine, Bailian)
- ProviderManager 图标识别规则新增 volces.com/dashscope 等 URL 匹配
- PresetConnectDialog 新增 model_names 字段类型,渲染模型名称输入框
- models route 动态读取 extra_env 中的 ANTHROPIC_MODEL 展示到模型选择器

修复 & 优化:
- 移除文件上传的类型限制 (ACCEPTED_FILE_TYPES) 和大小限制 (MAX_FILE_SIZE)
  现在支持所有文件类型和任意大小,由 API 端处理限制
- AskQuestion 按钮样式对齐权限确认按钮 (h-8 px-3 text-sm font-medium)
- AskQuestion 组件渲染位置从工具调用区域移到流式文本下方
  解决长文本输出后用户找不到选择组件的问题
- Anthropic Third-party API 预设的 provider_type 从 "custom" 改为 "anthropic"
  修复第三方 Anthropic 兼容 API 无法正确生效的问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7418andClaude Opus 4.6 committed 2026-02-28 12:44:07 +08:00
1 parent d872f91478
commit 68bb6b60bb
8 files changed
+102 -39

No files matched your search

+22 -1
View File
@@ -51,6 +51,15 @@ const PROVIDER_MODEL_LABELS: Record<string, { value: string; label: string }[]>
{ value: 'opus', label: 'Opus 4.6' },
{ value: 'haiku', label: 'Haiku 4.5' },
],
'https://coding.dashscope.aliyuncs.com/apps/anthropic': [
{ value: 'qwen3.5-plus', label: 'Qwen 3.5 Plus' },
{ value: 'qwen3-coder-next', label: 'Qwen 3 Coder Next' },
{ value: 'qwen3-coder-plus', label: 'Qwen 3 Coder Plus' },
{ value: 'kimi-k2.5', label: 'Kimi K2.5' },
{ value: 'glm-5', label: 'GLM-5' },
{ value: 'glm-4.7', label: 'GLM-4.7' },
{ value: 'MiniMax-M2.5', label: 'MiniMax-M2.5' },
],
};
/**
@@ -90,7 +99,19 @@ export async function GET() {
for (const provider of providers) {
if (MEDIA_PROVIDER_TYPES.has(provider.provider_type)) continue;
const matched = PROVIDER_MODEL_LABELS[provider.base_url];
const rawModels = matched || DEFAULT_MODELS;
let rawModels = matched || DEFAULT_MODELS;
// For providers with ANTHROPIC_MODEL in extra_env (e.g. Volcengine Ark),
// show the configured model name in the selector
if (!matched) {
try {
const envObj = JSON.parse(provider.extra_env || '{}');
if (envObj.ANTHROPIC_MODEL) {
rawModels = [{ value: envObj.ANTHROPIC_MODEL, label: envObj.ANTHROPIC_MODEL }];
}
} catch { /* use default */ }
}
const models = deduplicateModels(rawModels);
groups.push({