Skip to main content

51 posts tagged with "Agents"

Intelligent Agents and Their Applications

View All Tags

How to Use an Enum Parameter in a Microsoft Agent Framework Function Tool in C#

· 10 min read
Jagdish Kumawat
Founder @ Dewiride

Some tool parameters can only take a few values: a size, a priority, a status. Make such a parameter a C# enum, and Microsoft Agent Framework tells the model exactly which values exist, so it picks one of them instead of making one up. One thing still gets through: a number that isn't one of the values. This guide shows both with a small coffee-ordering agent and a real model, and adds the one-line check that closes the gap.

Fixed: Microsoft Agent Framework Agent Calls a Tool Again After It Succeeded

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

A Microsoft Agent Framework agent that books meeting rooms booked K2, then booked Denali as well, and told the user that no room was free. I first blamed parallel tool calls, and that was wrong. The model called the tool one room at a time, and read the tool's own success message, K2 is booked at 10:00., as K2 is taken. A success message that can't be read as a failure fixed it.

How to See an Agent's Tool Calls in an AG-UI Stream

· 15 min read
Jagdish Kumawat
Founder @ Dewiride

When an agent answers over AG-UI, the text isn't the only thing in the stream: every function tool the agent calls shows up too, as four events, before the answer. This guide builds the smallest agent with one tool, a die roller, and reads each event from a real Microsoft Agent Framework stream, first with one call and then with two calls in the same turn.

How to Give a Microsoft Agent Framework Tool the Signed-In User in ASP.NET Core

· 15 min read
Jagdish Kumawat
Founder @ Dewiride

A tool such as get_my_notes has to know whose notes to read. If the AI model tells it, anyone who can talk the model into it can read anyone's notes. This guide gives a Microsoft Agent Framework tool the signed-in user from the request's validated token instead, and shows two users each getting only their own notes.

How to Add a Function Tool to a Microsoft Agent Framework Agent in C#

· 15 min read
Jagdish Kumawat
Founder @ Dewiride

An AI model can't read a clock, query your database or call your API: it can only ask. A function tool turns a C# method into something a Microsoft Agent Framework agent can ask for, and the agent runs the method for it. This guide adds one tool to a small console app and shows the difference with a real model: without the tool, the agent can't tell the time in Tokyo; with it, it can.

Fixed: JsonTypeInfo metadata for type was not provided by TypeInfoResolver of type 'Microsoft.Extensions.AI.AIJsonUtilities+JsonContext'

· 11 min read
Jagdish Kumawat
Founder @ Dewiride

In a .NET 10 file-based app, turning a method into a Microsoft Agent Framework tool with AIFunctionFactory.Create crashed with System.NotSupportedException: JsonTypeInfo metadata for type ... was not provided by TypeInfoResolver of type 'Microsoft.Extensions.AI.AIJsonUtilities+JsonContext'. File-based apps target Native AOT by default, and that turns off reflection-based JSON. One #:property PublishAot=false line fixed it; a source-generated JSON context fixes it while keeping Native AOT.

Fixed: "System.MissingMethodException: Method not found: … OpenAI.Responses.ResponsesClient.CreateResponseStreamingAsync" with Microsoft Agent Framework

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

My Microsoft Agent Framework agent built without a warning, started, and then failed on every question with System.MissingMethodException: Method not found in CreateResponseStreamingAsync. The cause was one extra line in my project file: I had added the newest OpenAI package myself, and Agent Framework was built against the version before it.

Fixed: "error OPENAI001: 'OpenAI.Responses.ResponsesClient' is for evaluation purposes only and is subject to change or removal in future updates"

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

I connected a Microsoft Agent Framework agent to a Microsoft Foundry model the keyless way Microsoft documents — the OpenAI client library, the OpenAI v1 endpoint and a Microsoft Entra ID token — and the build failed with four errors, all OPENAI001: for evaluation purposes only and is subject to change or removal in future updates. Nothing was wrong with the code; the compiler wanted my consent.

How to Keep Each User's Conversations Separate in a Microsoft Agent Framework AG-UI Server

· 24 min read
Jagdish Kumawat
Founder @ Dewiride

An AG-UI request names the conversation it continues with a threadId, and a Microsoft Agent Framework server continues whichever conversation that ID points to. Unless the server also files conversations by who is asking, anyone who sends your threadId continues your conversation. This guide files every conversation under the signed-in caller's Microsoft Entra ID object ID, with real runs: the same person continuing a conversation, and a second caller getting a new one with the same threadId.

How to Add a Stop Button to an AG-UI Chat

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

A long AI answer needs a way out: a Stop button that ends it where it is. With the AG-UI TypeScript client, the stop itself is one call, abortRun(). Around it, the page needs to know when a run is going, show Stop instead of Send, and not mistake the stop for an error. This guide adds all of that to a React chat and shows the result.