pepperoni21 / ollama-rs

A Rust library allowing to interact with the Ollama API.
MIT License
547 stars 81 forks source link

removal index (is 0) should be < len (is 0) #73

Closed ShayBox closed 2 months ago

ShayBox commented 2 months ago

removal index (is 0) should be < len (is 0) https://github.com/pepperoni21/ollama-rs/blob/master/src/history.rs#L42

This panics if there's no messages (sending the first message), also there can be multiple system messages, and the system message could be at any point in the list, not just the start.

pepperoni21 commented 2 months ago

Yeah makes sense, I'll fix that