tools not available in ollama #135

Closed
opened 2026-02-15 16:28:13 -05:00 by yindo · 3 comments
Owner

Originally created by @zahid-ahmad on GitHub (Aug 19, 2024).

I am trying to use tools attribute for function calling, but it is showing that there is no attribute tools in ollama. I tried by upgrading ollama

Originally created by @zahid-ahmad on GitHub (Aug 19, 2024). I am trying to use tools attribute for function calling, but it is showing that there is no attribute tools in ollama. I tried by upgrading ollama
yindo closed this issue 2026-02-15 16:28:13 -05:00
Author
Owner

@asuivelentine commented on GitHub (Sep 8, 2024):

I stumbled across the same issue.
After ensuring ollama server is 0.2.6 or above and ollama-python is above 0.3.0, I realized that I was trying to use function calling with .generate() instead of .chat().

This makes sense, since you need multiple calls to ollama until the final answer is generated. The context would not be part of the .generate() call.
The example works well.

@asuivelentine commented on GitHub (Sep 8, 2024): I stumbled across the same issue. After ensuring ollama server is 0.2.6 or above and ollama-python is above 0.3.0, I realized that I was trying to use function calling with `.generate()` instead of `.chat()`. This makes sense, since you need multiple calls to ollama until the final answer is generated. The context would not be part of the `.generate()` call. The [example](https://github.com/ollama/ollama-python/blob/main/examples/tools/main.py) works well.
Author
Owner

@zahid-ahmad commented on GitHub (Sep 8, 2024):

I stumbled across the same issue. After ensuring ollama server is 0.2.6 or above and ollama-python is above 0.3.0, I realized that I was trying to use function calling with .generate() instead of .chat().

This makes sense, since you need multiple calls to ollama until the final answer is generated. The context would not be part of the .generate() call. The example works well.

Thanks for you response, What do you think about using function calling in chat bot that makes phone calls. I think function calling is for specific cases where you have to mention that field or words. For example in ollama's python documentation we have to mention weather, or flight time. It should match the exact words. And chat() do not allow responses to be conversation matter.

@zahid-ahmad commented on GitHub (Sep 8, 2024): > I stumbled across the same issue. After ensuring ollama server is 0.2.6 or above and ollama-python is above 0.3.0, I realized that I was trying to use function calling with `.generate()` instead of `.chat()`. > > This makes sense, since you need multiple calls to ollama until the final answer is generated. The context would not be part of the `.generate()` call. The [example](https://github.com/ollama/ollama-python/blob/main/examples/tools/main.py) works well. Thanks for you response, What do you think about using function calling in chat bot that makes phone calls. I think function calling is for specific cases where you have to mention that field or words. For example in ollama's python documentation we have to mention weather, or flight time. It should match the exact words. And chat() do not allow responses to be conversation matter.
Author
Owner

@ParthSareen commented on GitHub (Nov 27, 2024):

Closing this out - please use .chat for function calling!

@ParthSareen commented on GitHub (Nov 27, 2024): Closing this out - please use `.chat` for function calling!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#135