Agent.NET v1.0.0-rc.8
Highlights
- New:
Tool.injectfor tool-function dependency injection. - Add ChatOptions support to ChatAgentConfig by @OnurGumus in #6 // <- this was actually in the previous version which I never made release notes for!
- Microsoft Agent Framework upgraded to the first stable release (
1.3.0).
New Feature: Tool.inject
Most real-world tool functions need a dependency — a database, an HTTP client, a domain service — but the agent shouldn't see (or attempt to fill in) that dependency. It's a host concern, not a model concern.
Tool.inject partially applies the leftmost parameter of a tool's underlying function with a value you supply, returning a new ToolDef whose metadata and method signature are exactly one parameter shorter. The captured dependency is forwarded to the original function automatically at invoke time.
/// <summary>Looks up a user by id</summary>
/// <param name="db">The database connection</param>
/// <param name="userId">The user's id</param>
let lookupUser (db: IDb) (userId: int) : string =
db.GetUserName userId
let lookupUserTool =
Tool.createWithDocs <@ lookupUser @>
|> Tool.inject realDb
// The agent now sees a 1-parameter tool: { Name = "lookupUser"; Parameters = [userId: int] }
// At invoke time, `realDb` is supplied automatically; the model only chooses `userId`.Why it matters:
- Hides infrastructure from the model. The LLM only sees parameters it can meaningfully reason about.
- Per-request dependencies. Capture a tenant-scoped service or request-scoped logger by injecting a fresh value when you build the agent.
- No wrapper boilerplate. No need to hand-write a closure-shaped tool function just to thread a dependency through.
- XML metadata is preserved. Descriptions on the remaining parameters survive the injection.
Tool.inject is composable, works whether the dep is the only parameter or one of many, and supports functions whose remaining input is unit:
let nowFromClock (clock: IClock) () : string = clock.Now()
let nowTool =
Tool.create <@ nowFromClock @>
|> Tool.inject systemClock
|> Tool.describe "Returns the current time"Dependency Updates
Microsoft Agent Framework graduated from release candidates to stable. Agent.NET tracks the stable line:
| Package | Previous | New |
|---|---|---|
Microsoft.Agents.AI |
1.0.0-rc4 |
1.3.0 |
Microsoft.Agents.AI.OpenAI |
1.0.0-rc4 |
1.3.0 |
Microsoft.Agents.AI.Workflows |
1.0.0-rc4 |
1.3.0 |
Microsoft.Extensions.AI |
10.4.0 |
10.5.0 |
Microsoft.Extensions.AI.Core |
10.4.0 |
10.5.0 |
Microsoft.Extensions.AI.OpenAI |
10.4.0 |
10.5.0 |
Microsoft.Extensions.AI.Abstractions |
10.4.0 |
10.5.0 |
Microsoft.DurableTask.Abstractions |
1.22.0 |
1.24.0 |
The MAF stable release was source-compatible with Agent.NET — no API changes required on the consumer side.
Upgrading
dotnet add package AgentNet --version 1.0.0-rc.8
dotnet add package AgentNet.Durable --version 1.0.0-rc.8
dotnet add package AgentNet.InProcess --version 1.0.0-rc.8
dotnet add package AgentNet.InProcess.Polly --version 1.0.0-rc.8No code changes are required to upgrade from rc.7. Tool.inject is purely additive.
Full Changelog: v1.0.0-rc.6...v1.0.0-rc.8