tuna-agent 0.1.149 → 0.1.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -179,9 +179,17 @@ ${rawText}`,
|
|
|
179
179
|
async function geminiGenerate(parts, maxOutputTokens, model = GEMINI_MODEL) {
|
|
180
180
|
if (!GEMINI_KEYS.length)
|
|
181
181
|
return { text: '' };
|
|
182
|
+
const generationConfig = { maxOutputTokens, temperature: 0.4 };
|
|
183
|
+
// Gemini 2.5 Flash is a thinking model: with thinking ON it burns the whole
|
|
184
|
+
// maxOutputTokens budget on internal reasoning and returns EMPTY text. These
|
|
185
|
+
// are extraction/description tasks (no CoT needed) → disable thinking so the
|
|
186
|
+
// budget goes to the actual answer.
|
|
187
|
+
if (model.includes('2.5-flash')) {
|
|
188
|
+
generationConfig.thinkingConfig = { thinkingBudget: 0 };
|
|
189
|
+
}
|
|
182
190
|
const body = JSON.stringify({
|
|
183
191
|
contents: [{ parts }],
|
|
184
|
-
generationConfig
|
|
192
|
+
generationConfig,
|
|
185
193
|
});
|
|
186
194
|
const MAX_ATTEMPTS = 6;
|
|
187
195
|
let keyIdx = 0;
|
|
@@ -280,6 +288,7 @@ Return ONLY a JSON object, no markdown fences:
|
|
|
280
288
|
Rules:
|
|
281
289
|
- characters.name: a stable short uppercase label reused for this subject (e.g. "THE BISHOP", "U-94 SUBMARINE"). Max 4 words.
|
|
282
290
|
- RECALL (CRITICAL): list EVERY distinct recurring subject SEPARATELY. If a family or group recurs, include EACH member as its own entry (e.g. adult man, adult woman, older boy, younger girl) — never merge them into one. Skip only true one-off background extras. Be COMPLETE: missing a recurring character is worse than one extra. Up to 8.
|
|
291
|
+
- NO GROUP ENTRIES (CRITICAL): NEVER output a collective/crowd label as a single entry — forbidden: "VILLAGERS", "LADIES GROUP", "KNITTING GROUP", "CROWD", "GROUP OF ...", any "*_GROUP". If 2+ similar secondary people RECUR across scenes, list them as SEPARATE numbered individuals (e.g. WOMAN_1, WOMAN_2, WOMAN_3), each with its OWN distinct face/hair/body/age. Only a truly anonymous one-off background that never recurs may be omitted entirely.
|
|
283
292
|
- characters.description: ENGLISH only, factual, no camera/action words.
|
|
284
293
|
- DISTINCT FACES (CRITICAL): every character MUST have a HIGHLY UNIQUE facial structure, a distinct hairstyle, a specific body type and a clearly different age. NEVER reuse the same or a similar facial description for two characters — they must look completely different from one another.`;
|
|
285
294
|
// Phase-1 on Gemini 2.5 Flash: image-heavy read is far cheaper than gpt-4o,
|
|
@@ -373,7 +382,8 @@ Rules:
|
|
|
373
382
|
- ADD any recurring subject that appears in multiple scenes but is missing from the seed (e.g. a family member, a recurring animal/mascot/object). Missing a recurring character is the main failure to avoid.
|
|
374
383
|
- Merge entries that clearly refer to the SAME subject under one name.
|
|
375
384
|
- If a group/family recurs, list EACH member SEPARATELY (e.g. adult man, adult woman, older boy, younger girl) — never merge them.
|
|
376
|
-
-
|
|
385
|
+
- NO GROUP ENTRIES (CRITICAL): NEVER output a collective/crowd label as one entry — forbidden: "VILLAGERS", "LADIES GROUP", "KNITTING GROUP", "CROWD", "GROUP OF ...", any "*_GROUP". If a seed or scenes contain such a group, REPLACE it with separate numbered individuals (WOMAN_1, WOMAN_2, WOMAN_3...), each with its own distinct face/hair/body/age.
|
|
386
|
+
- Skip true one-off background extras (anonymous, never recurs) — omit them entirely, do NOT bundle them into a group entry.
|
|
377
387
|
- DISTINCT FACES: every character must have a UNIQUE facial structure, hairstyle, body type and a clearly different age — never reuse a similar facial description for two characters.
|
|
378
388
|
- Stable short UPPERCASE name, max 4 words. Up to 8 characters total.`,
|
|
379
389
|
}],
|