mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Pass a list of functions/tools to client like in the API #118
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jmorzeck on GitHub (Jul 24, 2024).
Hi there, with more and more models supporting function calling now, I am missing a way to pass a list of functions (tools) to the client. This what works perfectly calling the API:
With this, I get a response with the different tool choices and their parameters.
However, I am missing the feature to pass the list of tools to the client. I was thinking of something like this:
Is there a way to do this without passing the tools into the system prompt? Apologies if I didn't find it elsewhere.
@anthonywu commented on GitHub (Jul 31, 2024):
I think this was implemented in
chat(...): #213 https://github.com/ollama/ollama-python/pull/213/files#diff-0f246a9c084dd2ef9d4a58c02fb818ac4a114c34877e558cac88ab351daae9eeR183help(ollama.Client.chat)in latest clientmainbranch:P@ParthSareen commented on GitHub (Dec 18, 2024):
Closing this out with the recent tool passing updates https://ollama.com/blog/functions-as-tools