Skip to main content

48 posts tagged with "AI"

Artificial Intelligence Technologies and Solutions

View All Tags

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.

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.

How to Customize the Request an AG-UI HttpAgent Sends

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

HttpAgent from @ag-ui/client sends a complete AG-UI request on every run: the whole conversation, tools, state and more. That's right for talking to an AG-UI server directly, but not for a server route that accepts only a few fields — or an agent that keeps its own history. HttpAgent builds each request in a method you can override, requestInit. This guide shows the default body, the override, and the real bodies before and after.

How to Filter AG-UI Events Before They Reach the Browser

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

An AG-UI server streams a lot more than a chat page shows. Microsoft Agent Framework's events carry the model provider's own update in rawEvent — response IDs and the exact model version — the final event reports token usage, and reasoning models send encrypted reasoning. A server route between the agent and the browser can pass on only what the page needs. This guide shows the filter and real events before and after it.

Fixed: "signal is aborted without reason" After Stopping an AG-UI Run

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

My chat page had a Stop button that calls abortRun() on its AG-UI agent. Pressing it stopped the answer — and showed signal is aborted without reason in red, as if something had failed. That text is the browser's wording for a cancelled request: @ag-ui/client 1.0.5 ends a stopped run with its own RUN_ERROR event, code abort. Skipping that one code fixed it.

Fixed: next dev "Generated AGENTS.md for AI agents" in a Next.js App

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

I ran npm run dev from an AI coding assistant, and Next.js 16.4.6 printed ✓ Generated AGENTS.md for AI agents and added an AGENTS.md file to the project — although I had created the app with --no-agents-md. It's the agentRules option of next dev, and agentRules: false in next.config.ts turns it off and removes the file.