fix: restore ai detail default frame count
This commit is contained in:
parent
f97e96c5f9
commit
c823910185
@ -2864,7 +2864,7 @@ export function AgentGenerationWorkspaceDarkV2({
|
|||||||
? `\n\n【工作流风格要求】\n${workflowContext.promptText}`
|
? `\n\n【工作流风格要求】\n${workflowContext.promptText}`
|
||||||
: "";
|
: "";
|
||||||
const detailPromptWithWorkflow = `${detailPrompt}${workflowHint}`.trim();
|
const detailPromptWithWorkflow = `${detailPrompt}${workflowHint}`.trim();
|
||||||
const detailCount = extractAgentDetailFrameCount(detailPromptWithWorkflow);
|
const detailCount = extractAgentDetailFrameCount(detailPrompt);
|
||||||
const referenceImageNotes = detailGenerationVisibleSlotIndexes.map((slotIndex, visibleIndex) => {
|
const referenceImageNotes = detailGenerationVisibleSlotIndexes.map((slotIndex, visibleIndex) => {
|
||||||
const config = AGENT_DETAIL_SLOT_CONFIGS[slotIndex];
|
const config = AGENT_DETAIL_SLOT_CONFIGS[slotIndex];
|
||||||
const current = detailGenerationSlots[slotIndex];
|
const current = detailGenerationSlots[slotIndex];
|
||||||
|
|||||||
@ -1367,9 +1367,9 @@ function deriveSessionTitleFromMessages(messages: ChatMessage[]): string {
|
|||||||
function extractDetailFrameCount(text: string): number {
|
function extractDetailFrameCount(text: string): number {
|
||||||
const normalized = text.replace(/\s+/g, "");
|
const normalized = text.replace(/\s+/g, "");
|
||||||
const matched = normalized.match(/(\d{1,2})(?:张|屏|页)/);
|
const matched = normalized.match(/(\d{1,2})(?:张|屏|页)/);
|
||||||
if (!matched) return 14;
|
if (!matched) return 15;
|
||||||
const value = Number(matched[1]);
|
const value = Number(matched[1]);
|
||||||
if (!Number.isFinite(value)) return 14;
|
if (!Number.isFinite(value)) return 15;
|
||||||
return Math.min(20, Math.max(5, Math.round(value)));
|
return Math.min(20, Math.max(5, Math.round(value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,9 +139,9 @@ export function sanitizeAgentDetailBrief(input: unknown): AgentDetailBriefForm {
|
|||||||
export function extractAgentDetailFrameCount(text: string) {
|
export function extractAgentDetailFrameCount(text: string) {
|
||||||
const normalized = String(text || "").replace(/\s+/g, "");
|
const normalized = String(text || "").replace(/\s+/g, "");
|
||||||
const matched = normalized.match(/(\d{1,2})(?:张|屏|页)/);
|
const matched = normalized.match(/(\d{1,2})(?:张|屏|页)/);
|
||||||
if (!matched) return 14;
|
if (!matched) return 15;
|
||||||
const value = Number(matched[1]);
|
const value = Number(matched[1]);
|
||||||
if (!Number.isFinite(value)) return 14;
|
if (!Number.isFinite(value)) return 15;
|
||||||
return Math.min(20, Math.max(5, Math.round(value)));
|
return Math.min(20, Math.max(5, Math.round(value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user