ollama-python icon indicating copy to clipboard operation
ollama-python copied to clipboard

tools not available in ollama

Open zahid-ahmad opened this issue 1 year ago • 2 comments

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

zahid-ahmad avatar Aug 19 '24 07:08 zahid-ahmad

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 avatar Sep 08 '24 16:09 asuivelentine

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 avatar Sep 08 '24 16:09 zahid-ahmad

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

ParthSareen avatar Nov 27 '24 17:11 ParthSareen