Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors streaming #4

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Refactors streaming #4

merged 3 commits into from
Feb 19, 2024

Conversation

lebrunel
Copy link
Owner

A breaking API change, but benefits dev ergonomics.

Streaming requests no longer return a t:task/0 - they return a t:Ollama.Streaming.t/0 struct. Ollama.Streaming implements Enumerable so can be used with Stream functions.

Ollama.Streaming.send_to/2 is a convenience function for sending each message in the stream to a given process.

This PR also refactors the tests to use a mock server for API requests.

@lebrunel lebrunel merged commit 3b92eb6 into main Feb 19, 2024
8 checks passed
@lebrunel lebrunel deleted the streaming branch February 19, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant