fix: hand off complete changes and retain verified source context
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export interface BudgetPauseSource { reason?: string; limitingReason?: string }
|
||||
export function budgetPausePresentation(pause?: BudgetPauseSource, stopReason?: string): {
|
||||
title: string; inputLabel: string; guidance: string;
|
||||
} | null;
|
||||
@@ -0,0 +1,18 @@
|
||||
const reasons = {
|
||||
context_limit: '上下文窗口不足', engine_input_budget: '原生引擎输入或剩余预算不足',
|
||||
token_limit: '本次运行预算不足', task_token_limit: '任务累计预算不足', time_limit: '本次运行时间已用完',
|
||||
};
|
||||
|
||||
export function budgetPausePresentation(pause, stopReason = '') {
|
||||
const reason = pause?.reason ?? stopReason;
|
||||
if (!reasons[reason]) return null;
|
||||
if (reason === 'engine_input_budget' && pause?.limitingReason === 'remaining_token_budget') return {
|
||||
title: '原生引擎剩余预算不足', inputLabel: '当前窗口可用输入',
|
||||
guidance: '输入可容纳于当前上下文窗口;下一次请求的用量预留超过剩余预算。请核对运行和任务预算。',
|
||||
};
|
||||
if (reason === 'engine_input_budget' && pause?.limitingReason === 'context_limit') return {
|
||||
title: '原生引擎上下文窗口不足', inputLabel: '当前窗口可用输入',
|
||||
guidance: '必需输入超过当前上下文窗口可用容量。请核对模型容量和输入范围。',
|
||||
};
|
||||
return { title: reasons[reason], inputLabel: '当前可用输入', guidance: '' };
|
||||
}
|
||||
Reference in New Issue
Block a user