feat(canvas): 生成合同 - 统一节点参数并补充模型上下文能力
This commit is contained in:
@@ -350,7 +350,7 @@ export function ModelCapabilityEditor({ value, onChange, protocol, capability =
|
||||
}
|
||||
|
||||
function TextCapabilityEditor({ value, onChange, protocol, disabled, section }: Pick<Props, "value" | "onChange" | "protocol" | "disabled" | "section">) {
|
||||
const profile = value?.text || defaultModelCapabilityConfig(protocol).text!;
|
||||
const profile = normalizeModelCapabilityConfig(value || defaultModelCapabilityConfig(protocol)).text!;
|
||||
const update = (patch: Partial<TextCapabilityConfig>) => {
|
||||
onChange?.({ version: 1, text: { ...profile, ...patch } });
|
||||
};
|
||||
@@ -369,8 +369,17 @@ function TextCapabilityEditor({ value, onChange, protocol, disabled, section }:
|
||||
}
|
||||
|
||||
if (section === "references") {
|
||||
const contextWindowFields = (
|
||||
<CapabilityGroup title="上下文能力" description="这是上游文本模型的能力合同,决定 Agent 本轮可保留的输入预算;不会改变运行时 checkpoint 的持久化上限。">
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<NumberField label="上下文窗口 Token" value={profile.contextWindowTokens} min={4_096} max={10_000_000} disabled={Boolean(disabled)} onChange={(next) => update({ contextWindowTokens: next || 4_096 })} />
|
||||
<NumberField label="最大输出 Token" value={profile.maxOutputTokens} min={256} max={1_000_000} disabled={Boolean(disabled)} onChange={(next) => update({ maxOutputTokens: next || 256 })} />
|
||||
</div>
|
||||
</CapabilityGroup>
|
||||
);
|
||||
return (
|
||||
<div className="admin-capability-reference-editor">
|
||||
{contextWindowFields}
|
||||
<div className="admin-capability-reference-grid is-three">
|
||||
<ReferenceCard title="图片引用" description="文本模型可接收的图片范围">
|
||||
<NumberField label="最大参考图片数" value={profile.references.maxImages} min={0} max={100} disabled={Boolean(disabled)} onChange={(next) => updateReferences({ maxImages: next || 0 })} />
|
||||
@@ -394,6 +403,12 @@ function TextCapabilityEditor({ value, onChange, protocol, disabled, section }:
|
||||
<div className="text-sm font-medium">文本理解能力</div>
|
||||
<div className="mt-0.5 text-[var(--fs-tiny)] text-foreground/48">默认不假设支持图片或视频,只有明确配置后相关请求才会进入该模型。</div>
|
||||
</div>
|
||||
<CapabilityGroup title="上下文能力" description="这是上游文本模型的能力合同,决定 Agent 本轮可保留的输入预算;不会改变运行时 checkpoint 的持久化上限。">
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<NumberField label="上下文窗口 Token" value={profile.contextWindowTokens} min={4_096} max={10_000_000} disabled={Boolean(disabled)} onChange={(next) => update({ contextWindowTokens: next || 4_096 })} />
|
||||
<NumberField label="最大输出 Token" value={profile.maxOutputTokens} min={256} max={1_000_000} disabled={Boolean(disabled)} onChange={(next) => update({ maxOutputTokens: next || 256 })} />
|
||||
</div>
|
||||
</CapabilityGroup>
|
||||
<CapabilityGroup title="图片" description="文本模型可接收的图片参考范围">
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<NumberField label="最大参考图片数" value={profile.references.maxImages} min={0} max={100} disabled={Boolean(disabled)} onChange={(next) => updateReferences({ maxImages: next || 0 })} />
|
||||
|
||||
Reference in New Issue
Block a user