Aller au contenu
A minimalistic 8-bit style image depicts a stylized computer file with a glowing gear symbol and an arrow, suggesting file processing or modification. Nearby, a trash can has small colored documents hovering above it, representing files being cleaned or deleted. The image uses five flat colors, geometric forms, and has no background, text, people, shadows, or gradients, maintaining a clean, corporate-friendly look in a 128x128 pixel format.

Sortie personnalisée

AI generated translation.

La fonction defOutputProcessor enregistre un rappel pour effectuer un traitement personnalisé de la sortie du LLM à la fin du processus de génération. Cette fonction permet de créer de nouveaux fichiers ou de modifier des fichiers existants.

// compute a filepath
const output = path.join(path.dirname(env.spec), "output.txt")
// post processing
defOutputProcessor(output => {
return {
files: [
// emit entire content to a specific file
[output]: output.text
]
}
})

Cet exemple vide l’objet fileEdits, qui contient les mises à jour de fichiers analysées.

defOutputProcessor((output) => {
// clear out any parsed content
for (const k of Object.keys(output.fileEdits)) {
delete output.fileEdits[k]
}
})