pepperoni21 / ollama-rs

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

Enable sending modelfile contents directly instead of using paths #5

Closed campbellcole closed 7 months ago

campbellcole commented 7 months ago

The API documentation says that we can send the contents of a Modelfile into the modelfile field in the request, so this PR adds the ability to do that.

The new API exposed by this crate requires the user constructing the request themselves, so I've added two constructors that do this using either the path or Modelfile contents.

pepperoni21 commented 7 months ago

Hey, that's a good idea, thanks for your contribution. Could you just change the example in README.md and https://github.com/pepperoni21/ollama-rs/blob/master/tests/create_model.rs accordingly?

pepperoni21 commented 7 months ago

@campbellcole If you don't have the time I can do it myself