Corrige a iteração sobre o modelo na função getAIResponse para aguardar a resolução da promessa antes de processar os chunks de resposta.

This commit is contained in:
Gabriel Cano 2025-08-24 20:37:57 -03:00
commit 414f84599e

View file

@ -135,7 +135,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
});
let fullResponse = '';
for await (const chunk of model) {
for await (const chunk of await model) {
fullResponse += chunk.text || '';
}