feat(chat): 完善 Chat Completions 兼容层

This commit is contained in:
2026-05-19 17:46:27 +08:00
parent ba419cd90a
commit 13186f8ed1
13 changed files with 1611 additions and 85 deletions
@@ -40,14 +40,14 @@ type ValueOption = { label: string; value: string };
const textFields: FieldDefinition[] = [
{ key: 'supportTool', label: '工具调用', hint: 'function calling / tools', type: 'boolean' },
{ key: 'supportStructuredOutput', label: '结构化输出', hint: 'JSON Schema 等输出', type: 'boolean' },
{ key: 'supportThinking', label: '思考能力', hint: '支持 thinking 参数', type: 'boolean' },
{ key: 'supportThinking', label: '推理能力', hint: '支持 reasoning / thinking 参数', type: 'boolean' },
{ key: 'supportThinkingModeSwitch', label: '思考开关', hint: '可按请求切换', type: 'boolean' },
{ key: 'supportWebSearch', label: '联网搜索', type: 'boolean' },
{ key: 'max_context_tokens', label: '上下文 Token', placeholder: '128000', type: 'number' },
{ key: 'max_input_tokens', label: '最大输入 Token', placeholder: '64000', type: 'number' },
{ key: 'max_output_tokens', label: '最大输出 Token', placeholder: '8192', type: 'number' },
{ key: 'max_thinking_tokens', label: '最大思考 Token', placeholder: '32768', type: 'number' },
{ key: 'thinkingEffortLevels', label: '思考强度', placeholder: 'minimal, low, medium, high', type: 'list' },
{ key: 'thinkingEffortLevels', label: '推理深度', hint: '声明模型支持的 reasoning_effort 取值,可填写 max 等供应商自定义值', placeholder: 'none, minimal, low, medium, high, xhigh, max', type: 'list' },
];
const embeddingFields: FieldDefinition[] = [
@@ -535,7 +535,7 @@ const imageAspectRatioOptions = [
'7:4',
'4:7',
];
const thinkingEffortOptions = ['minimal', 'low', 'medium', 'high'];
const thinkingEffortOptions = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
const omniVideoModeOptions = ['text_to_video', 'image_reference', 'element_reference', 'first_last_frame', 'video_reference', 'video_edit', 'multi_shot'];
const durationOptionValues = ['1', '2', '3', '4', '5', '6', '8', '10', '15', '20', '25', '30'];
const exclusiveCapabilityFields: Record<string, string> = {