NousToolCalling 0.1.0
See the version list below for details.
dotnet add package NousToolCalling --version 0.1.0
NuGet\Install-Package NousToolCalling -Version 0.1.0
<PackageReference Include="NousToolCalling" Version="0.1.0" />
<PackageVersion Include="NousToolCalling" Version="0.1.0" />
<PackageReference Include="NousToolCalling" />
paket add NousToolCalling --version 0.1.0
#r "nuget: NousToolCalling, 0.1.0"
#:package NousToolCalling@0.1.0
#addin nuget:?package=NousToolCalling&version=0.1.0
#tool nuget:?package=NousToolCalling&version=0.1.0
NousToolCalling
Make on-prem / OpenAI-compatible LLMs that emit tool calls as XML text work with Microsoft.Extensions.AI and Microsoft Agent Framework tools.
Many self-hosted models (Qwen, Hermes, DeepSeek, …) served via vLLM, llama.cpp, Ollama or a corporate gateway don't fill the OpenAI tool_calls field. They reply with plain text like:
<tool_call>{"name": "get_weather", "arguments": {"city": "Istanbul"}}</tool_call>
FunctionInvokingChatClient never sees that, so your tools never run. NousToolCallingChatClient is a DelegatingChatClient that:
- injects your
ChatOptions.Toolsinto the system prompt as<tools>JSON schemas, - parses
<tool_call>blocks (streaming and non-streaming) intoFunctionCallContent, - sends tool results back as
<tool_response>messages, - handles
<think>reasoning blocks safely.
Usage
using Microsoft.Extensions.AI;
IChatClient client = new OpenAI.Chat.ChatClient(
model: "qwen3-32b",
credential: new System.ClientModel.ApiKeyCredential("not-needed"),
options: new OpenAI.OpenAIClientOptions { Endpoint = new Uri("http://localhost:8080/v1") })
.AsIChatClient()
.AsBuilder()
.UseFunctionInvocation() // must come first (outermost)
.UseNousToolCalling()
.Build();
var response = await client.GetResponseAsync(
"What's the weather in Istanbul?",
new ChatOptions { Tools = [AIFunctionFactory.Create((string city) => $"Sunny, 22C in {city}", "get_weather")] });
client can also be wrapped in a ChatClientAgent (client.AsAIAgent(...)), so agents, RAG and MCP tools work unchanged.
Options
| Option | Default | Description |
|---|---|---|
StrictThinkMode |
true |
Don't parse tool calls while a <think> block is still open |
PreserveThinkBlocks |
false |
Store <think> content in AdditionalProperties["nous_think"] |
ToolCallIdPrefix |
"nous" |
Prefix for generated call IDs (unique per response) |
Docs, samples and source: https://github.com/Murat7Ay/nous-tool-calling
| 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 is compatible. 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 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.AI (>= 10.10.0)
-
net8.0
- Microsoft.Extensions.AI (>= 10.10.0)
-
net9.0
- Microsoft.Extensions.AI (>= 10.10.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NousToolCalling:
| Package | Downloads |
|---|---|
|
NousToolCalling.AgentFramework
Composition helpers for Nous-style tool calling with Microsoft Agent Framework: a one-call ChatClientAgent pipeline for on-prem OpenAI-compatible models and an MCP tool host that exposes server tools as AIFunctions. |
GitHub repositories
This package is not used by any popular GitHub repositories.