Function Calling with tool support
Ollama API: chat request with tools https://github.com/ollama/ollama/blob/main/docs/api.md#chat-request-with-tools
Since Ollama 0.3.0
, Ollama supports tools calling, blog post: https://ollama.com/blog/tool-support.
A list of supported models can be found under the Tools category on the models page: https://ollama.com/search?c=tools
Define a list of tools
use a supported model
Set the Tools property of the query
- set the
Temperature
to0.0
- you don't need to set the row mode to true
- set
query.Tools
withtoolsList
Run the completion
The result will look like this:
Or you can use the ToolCallsToJSONString
helper
Note
Look here for a complete sample: examples/19-mistral-function-calling-tool-support
Or (better) you can use the ToolCallsToJSONString
helper
The result will look like this:
Note
Look at these samples: