pepperoni21 / ollama-rs

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

Function calling isn't optional #87

Open boswelja opened 1 week ago

boswelja commented 1 week ago

It seems like our options are either "always call a function" via send_function_call, or "never call a function" via send_chat_messages. This doesn't cover the case where an LLM has access to functions that it can choose to call though.

This is immediately apparent when trying to send_function_call, but the LLM decides not to call a function, resulting in

An error occurred with ollama-rs: An error occurred with ollama-rs: No valid function calls found