Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lebrunel committed Apr 18, 2024
1 parent 045d1f0 commit 39b65bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ollama.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}} ->
Expand All @@ -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

0 comments on commit 39b65bc

Please sign in to comment.