mirror of
https://github.com/garrytan/gbrain.git
synced 2026-08-14 00:48:18 +00:00
fix(cycle): raise atom maxTokens + case-normalize atom_type for Gemini (#3211)
This commit is contained in:
@@ -558,7 +558,7 @@ export async function runPhaseExtractAtoms(
|
||||
content: `Source: ${originLabel}\n\n---\n\n${item.content.slice(0, 50_000)}`,
|
||||
},
|
||||
],
|
||||
maxTokens: 2000,
|
||||
maxTokens: 4096,
|
||||
});
|
||||
// Post-await yield: closes the "long LLM call past TTL" hazard
|
||||
// codex flagged. The 30s throttle inside maybeYield bounds the
|
||||
@@ -726,7 +726,7 @@ export function parseAtomsResponse(raw: string): ExtractedAtom[] {
|
||||
if (typeof item !== 'object' || item === null) continue;
|
||||
const obj = item as Record<string, unknown>;
|
||||
const title = typeof obj.title === 'string' ? obj.title.slice(0, 200) : null;
|
||||
const atomType = typeof obj.atom_type === 'string' ? obj.atom_type : null;
|
||||
const atomType = typeof obj.atom_type === 'string' ? obj.atom_type.trim().toLowerCase() : null;
|
||||
const body = typeof obj.body === 'string' ? obj.body : null;
|
||||
if (!title || !atomType || !body) continue;
|
||||
if (!ATOM_TYPES.includes(atomType as typeof ATOM_TYPES[number])) continue;
|
||||
|
||||
Reference in New Issue
Block a user