ZIm/crates/language_models/src
tidely 769ec59162
ollama: Add tool call support (#29563)
The goal of this PR is to support tool calls using ollama. A lot of the
serialization work was done in
https://github.com/zed-industries/zed/pull/15803 however the abstraction
over language models always disables tools.

## Changelog:

- Use `serde_json::Value` inside `OllamaFunctionCall` just as it's used
in `OllamaFunctionCall`. This fixes deserialization of ollama tool
calls.
- Added deserialization tests using json from official ollama api docs.
- Fetch model capabilities during model enumeration from ollama provider
- Added `supports_tools` setting to manually configure if a model
supports tools

## TODO:

- [x] Fix tool call serialization/deserialization
- [x] Fetch model capabilities from ollama api
- [x] Add tests for parsing model capabilities 
- [ ] Documentation for `supports_tools` field for ollama language model
config
- [ ] Convert between generic language model types
- [x] Pass tools to ollama

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2025-05-05 17:52:23 +00:00
..
provider ollama: Add tool call support (#29563) 2025-05-05 17:52:23 +00:00
ui chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
language_models.rs language_models: Remove language-models feature flag (#29416) 2025-04-25 14:18:48 +00:00
provider.rs assistant: Add Bedrock support (#21092) 2025-02-24 18:10:12 -05:00
settings.rs VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
ui.rs assistant: Refine settings view's instruction visuals (#25812) 2025-02-28 12:06:47 -03:00