Improve Ollama tool use (#30120)

<img width="458" alt="Screenshot 2025-05-07 at 9 37 39 AM"
src="https://github.com/user-attachments/assets/80f8a9b8-6a13-4e84-b91d-140e11475638"
/>

<img width="603" alt="Screenshot 2025-05-07 at 9 37 33 AM"
src="https://github.com/user-attachments/assets/7fe67a68-3885-4a0e-a282-aad37e92068b"
/>


Release Notes:

- Ollama models no longer require the supports_tools field in settings
(defaults to false)

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Richard Feldman 2025-05-07 11:37:06 -04:00 committed by GitHub
parent 0a44048af8
commit fcb9706022
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 39 deletions

View file

@ -37,7 +37,7 @@ pub struct Model {
pub display_name: Option<String>,
pub max_tokens: usize,
pub keep_alive: Option<KeepAlive>,
pub supports_tools: bool,
pub supports_tools: Option<bool>,
}
fn get_max_tokens(name: &str) -> usize {
@ -67,7 +67,7 @@ impl Model {
name: &str,
display_name: Option<&str>,
max_tokens: Option<usize>,
supports_tools: bool,
supports_tools: Option<bool>,
) -> Self {
Self {
name: name.to_owned(),