From 39b65bc2c651dfadd60f795218fc9cd28dd6b554 Mon Sep 17 00:00:00 2001 From: lebrunel <124721263+lebrunel@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:43:08 +0100 Subject: [PATCH] comments --- lib/ollama.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ollama.ex b/lib/ollama.ex index 5623aa9..3a27afb 100644 --- a/lib/ollama.ex +++ b/lib/ollama.ex @@ -830,7 +830,7 @@ defmodule Ollama do defp stream_merge(res, data), do: put_in(res.body, data) - # TODO + # Recieve messages into a stream defp stream_next(%Task{pid: pid, ref: ref} = task) do receive do {^pid, {:data, data}} -> @@ -852,6 +852,7 @@ defmodule Ollama do end end + # Tidy up when the streaming request is finished defp stream_end(%Task{ref: ref}), do: Process.demonitor(ref, [:flush]) end