Repository navigation
How do you indicate which tools get applied to the chat? #382
|
The documentation indicates you pass the tool when you call SendAsync but that method signature appears to have changed. var chat = new Chat(ollamaApiClient, systemPrompt); // callback for tool execution - this is where you can monitor which tools are being called and push updates to the frontend }; // |
Replies: 1 comment
|
Here is the solution: // callback for tool execution - this is where you can monitor which tools are being called and push updates to the frontend }; // 3. Stream the response directly to the HTTP response body |
Here is the solution:
var chat = new Chat(ollamaApiClient, systemPrompt);
var searchCollectoddtionTool = new SearchCollectionTool();
var tools = new List
{
new SearchCollectionTool()
};
// callback for tool execution - this is where you can monitor which tools are being called and push updates to the frontend
chat.OnToolCall += async (sender, toolCall) =>
{
// This is your monitoring point
Log.Information($"Executing: {toolCall.Function.Name}");
};
// 3. Stream the response directly to the…