Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const zhCapabilitiesCopy = {
visionEnabledOption: '启用',
visionDisabledOption: '禁用',
contextWindow: '上下文窗口(tokens)',
contextWindowHelp: '声明后压缩与预算按此值计算;留空跟随内置元数据。',
contextWindowHelp: '设置后作为 Maka 压缩的触发阈值。留空则不主动压缩,由供应商决定何时超限。',
contextWindowHint: (tokens: number) => `该模型声明的窗口为 ${tokens} tokens`,
contextWindowApplyHint: '填入',
saveCapabilities: '保存能力声明',
fastMode: 'Fast 模式',
fastModeHelp: '使用 OpenAI 的 fast service tier;留空跟随服务商默认值。',
Expand All @@ -70,7 +72,9 @@ const enCapabilitiesCopy = {
visionEnabledOption: 'Enabled',
visionDisabledOption: 'Disabled',
contextWindow: 'Context window (tokens)',
contextWindowHelp: 'When set, compaction and budgets use this value; when empty, built-in metadata decides.',
contextWindowHelp: 'When set, Maka compacts once the previous request\'s real usage exceeds it. Leave empty to never compact proactively; the provider decides.',
contextWindowHint: (tokens: number) => `This model declares a ${tokens}-token window`,
contextWindowApplyHint: 'Use it',
saveCapabilities: 'Save capability declarations',
fastMode: 'Fast mode',
fastModeHelp: "Use OpenAI's fast service tier; empty follows the provider default.",
Expand Down
47 changes: 35 additions & 12 deletions apps/desktop/src/renderer/settings/provider-connection-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -863,18 +863,41 @@ function ConnectionDetailInner(props: ConnectionDetailProps) {
/>
</CapabilityRow>
<CapabilityRow label={copy.contextWindow} description={copy.contextWindowHelp}>
<DeclaredContextWindowField
declared={declared?.contextWindow}
disabled={allActionsBusy}
/* Named per model, like the three controls around it:
the visible label is the row's, but the field's own
name is all a screen reader gets, and every row in
the section carries the same one. */
label={`${copy.contextWindow} — ${modelId}`}
onCommit={(value) =>
setDraftContextWindow(modelId, value ?? undefined)
}
/>
<VStack gap={1} hAlign="start">
<DeclaredContextWindowField
declared={declared?.contextWindow}
disabled={allActionsBusy}
/* Named per model, like the three controls around it:
the visible label is the row's, but the field's own
name is all a screen reader gets, and every row in
the section carries the same one. */
label={`${copy.contextWindow} — ${modelId}`}
onCommit={(value) =>
setDraftContextWindow(modelId, value ?? undefined)
}
/>
{declared?.contextWindow === undefined &&
connection.models?.find((model) => model.id === modelId)?.contextWindow !== undefined && (
<HStack gap={1} vAlign="center">
<Text size="sm" type="supporting" color="secondary">
{copy.contextWindowHint(
connection.models.find((model) => model.id === modelId)!.contextWindow!,
)}
</Text>
<Button
variant="ghost"
size="sm"
label={copy.contextWindowApplyHint}
isDisabled={allActionsBusy}
onClick={() =>
setDraftContextWindow(
modelId,
connection.models?.find((model) => model.id === modelId)?.contextWindow,
)}
/>
</HStack>
)}
</VStack>
</CapabilityRow>
{showsFastMode && (
<CapabilityRow label={copy.fastMode} description={copy.fastModeHelp}>
Expand Down