-
I'm trying to understand tool calls. I've managed to implement one with the help of the demo app, but I don't understand how tool calls and results are mapped. I'm probably missing something, but in ToolConsole.cs the result is sent back without referring to the name of the function. I couldn't find that in any of the SendAsAsync overloads either. If there was more than one tool call, we would be sending several results in the order they were listed. In ollama-python I found another tool call demo where the function name is part of the message. Although due to the indentation, if I understand Python correctly, the "output" variable would be the result of the last tool call and the "tool" variable should be out of scope at that point (I didn't try to run it). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The code you linked is pretty basic. What happens there is simply that I model some tools in code but it's just the meta data so that the LLMs knows which tools there are to call. After the LLM chose some tools, I run them with a But I felt that the tool support is too basic this way. That's why I started a pull request #171. With that OllamaSharp can generate tool meta data by their implementation. It's pretty basic yet but works pretty good. However it's not available on NuGet yet. |
Beta Was this translation helpful? Give feedback.
-
Does the LLM have to support tool calls for this to work? |
Beta Was this translation helpful? Give feedback.
The code you linked is pretty basic. What happens there is simply that I model some tools in code but it's just the meta data so that the LLMs knows which tools there are to call.
After the LLM chose some tools, I run them with a
FunctionHelper
by their names and arguments. This is actually lame but the idea was just to provide the bindings and the data transfer objects to send and receive data and let the developers decide how to do it.But I felt that the tool support is too basic this way. That's why I started a pull request #171. With that OllamaSharp can generate tool meta data by their implementation. It's pretty basic yet but works pretty good. However it's not available on NuGet yet.