diff --git a/lib/src/models/llm_model_isolated.dart b/lib/src/models/llm_model_isolated.dart index c696ce8..7997196 100644 --- a/lib/src/models/llm_model_isolated.dart +++ b/lib/src/models/llm_model_isolated.dart @@ -138,8 +138,9 @@ Future _llamaIsolateWorkerMain(Map args) async { .listen( (chunk) { final text = chunk.choices.firstOrNull?.delta.content; - if (text != null) + if (text != null) { streamPort.send({'type': 'token', 'text': text}); + } }, onDone: () { streamPort.send({'type': 'done'}); diff --git a/lib/src/rag/llama_rag_coordinator.dart b/lib/src/rag/llama_rag_coordinator.dart index beb24f7..eed3476 100644 --- a/lib/src/rag/llama_rag_coordinator.dart +++ b/lib/src/rag/llama_rag_coordinator.dart @@ -166,8 +166,9 @@ Future _llamaRagWorkerMain(Map args) async { .listen( (chunk) { final text = chunk.choices.firstOrNull?.delta.content; - if (text != null) + if (text != null) { streamPort.send({'type': 'token', 'text': text}); + } }, onDone: () { streamPort.send({'type': 'done'});