VOOZH about

URL: https://www.nuget.org/packages/AntRunner.ToolCalling/

⇱ NuGet Gallery | AntRunner.ToolCalling 2.0.1




👁 Image
AntRunner.ToolCalling 2.0.1

dotnet add package AntRunner.ToolCalling --version 2.0.1
 
 
NuGet\Install-Package AntRunner.ToolCalling -Version 2.0.1
 
 
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="2.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AntRunner.ToolCalling" Version="2.0.1" />
 
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 2.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AntRunner.ToolCalling, 2.0.1"
 
 
#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@2.0.1
 
 
#: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=2.0.1
 
Install as a Cake Addin
#tool nuget:?package=AntRunner.ToolCalling&version=2.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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.
  • Annotation-Driven Tool Discovery: Use [Tool], [Parameter], and related attributes to declaratively register tools, eliminating the need for hardcoded schema generators.
  • Dynamic OpenAPI Schema Generation: The ToolContractRegistry automatically generates OpenAPI schemas from method signatures and attributes at runtime.
  • Crew-Based Assistant Orchestration: The CrewBridgeSchemaGenerator enables multi-agent workflows by exposing crew member assistants as callable tools.
  • 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.

Declarative Tool Registration

Tools can be registered using attributes instead of static JSON schema files:

[Tool(OperationId = "search_documents", Summary = "Search for documents by query")]
public static async Task<string> SearchDocuments(
 [Parameter(Description = "The search query")] string query,
 [Parameter(Description = "Maximum results to return")] int maxResults = 10)
{
 // Implementation
}

Available Attributes

Attribute Target Description
[Tool] Method Marks a method as a callable tool with OperationId and Summary
[Parameter] Parameter Provides description, default value, and visibility for parameters
[RequiresNotebookContext] Method Indicates the tool needs notebook context injection
[OAuth] Method Specifies OAuth token handling policy (None, Forward, Required)

Crew Bridge Support

The CrewBridgeSchemaGenerator generates OpenAPI schemas for multi-agent orchestration, allowing a lead assistant to delegate tasks to crew member assistants:

var schema = CrewBridgeSchemaGenerator.GetSchema(new[] { "ResearchAgent", "WriterAgent", "ReviewerAgent" });

This creates tool definitions that route through Agent.Invoke for assistant-to-assistant communication.

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 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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
2.0.1 164 1/2/2026
1.1.0 432 5/19/2025
1.0.3 350 5/12/2025
1.0.2 230 5/10/2025
1.0.1 292 4/30/2025
1.0.0 332 4/24/2025

Added ReasoningEffort