AntRunner.ToolCalling 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package AntRunner.ToolCalling --version 1.0.3
                    
NuGet\Install-Package AntRunner.ToolCalling -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AntRunner.ToolCalling" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AntRunner.ToolCalling" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="AntRunner.ToolCalling" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AntRunner.ToolCalling --version 1.0.3
                    
#r "nuget: AntRunner.ToolCalling, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AntRunner.ToolCalling@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AntRunner.ToolCalling&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=AntRunner.ToolCalling&version=1.0.3
                    
Install as a Cake Tool

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.

ToolCalling Sequence Diagram - Warm Theme

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.1.0 379 5/19/2025
1.0.3 291 5/12/2025
1.0.2 177 5/10/2025
1.0.1 236 4/30/2025
1.0.0 284 4/24/2025

Use properties of static objects as tools, e.g. System.DateTime.Now