AntRunner.ToolCalling
1.1.0
dotnet add package AntRunner.ToolCalling --version 1.1.0
NuGet\Install-Package AntRunner.ToolCalling -Version 1.1.0
<PackageReference Include="AntRunner.ToolCalling" Version="1.1.0" />
<PackageVersion Include="AntRunner.ToolCalling" Version="1.1.0" />
<PackageReference Include="AntRunner.ToolCalling" />
paket add AntRunner.ToolCalling --version 1.1.0
#r "nuget: AntRunner.ToolCalling, 1.1.0"
#:package AntRunner.ToolCalling@1.1.0
#addin nuget:?package=AntRunner.ToolCalling&version=1.1.0
#tool nuget:?package=AntRunner.ToolCalling&version=1.1.0
AntRunner.ToolCalling
The AntRunner.ToolCalling library provides a fully decoupled framework for defining and executing tool calls within AI assistant workflows. It separates assistant definitions and tool calling logic from the Assistants API, enabling flexible integration with any .NET library that supports the OpenAI Chat Completions API.
Purpose
This library enables assistants to dynamically invoke external tools or functions during conversations. Tools can be defined using OpenAPI specifications or as local functions, and the library manages the execution of these tools, including handling web API requests and processing responses.
Key Features
- Tool Definition and Execution: Supports defining tools as OpenAPI-based web APIs or local functions, with automatic request building and response handling.
- Request Builder Caching: Efficiently caches tool callers per assistant to optimize repeated tool invocations.
- Asynchronous Tool Calls: Executes multiple tool calls concurrently and integrates their outputs back into the assistant conversation.
- Schema Validation and Filtering: Validates OpenAPI specifications and filters API responses according to defined schemas.
- Seamless Integration: Designed to work with any .NET application using OpenAI's Chat Completions API for assistant interactions.
Usage Example
The AntRunner.Chat.ChatRunner class illustrates how to use the AntRunner.ToolCalling library in practice. It demonstrates:
- Loading assistant definitions and associated tools.
- Converting tool definitions into OpenAI-compatible function calls.
- Running chat loops that handle tool call requests from the assistant.
- Executing required tool calls asynchronously and appending their results to the conversation.
- Managing conversation flow and optional evaluation.
This sequence diagram illustrates the interaction between the ChatRunner class and the AntRunner.ToolCalling library during a chat run, highlighting tool calling lifecycle and execution.
For detailed implementation and usage, see the source code in \AntRunner\AntRunner.Chat\AntRunner.Chat\ChatRunner.cs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Azure.Storage.Blobs (>= 12.24.0)
- CliWrap (>= 3.8.2)
- Microsoft.Extensions.Http (>= 9.0.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.4)
- Microsoft.Identity.Client (>= 4.71.1)
- System.Text.Json (>= 9.0.4)
- YamlDotNet (>= 16.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AntRunner.ToolCalling:
| Package | Downloads |
|---|---|
|
AntRunner.Chat
Toolbased AI Agents via Chat Completions compatible with AntRunner assistant definitions |
GitHub repositories
This package is not used by any popular GitHub repositories.
Added ReasoningEffort