You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET: [.NET] Make AGUI event types + AsAGUIEventStreamAsync public #2270
The provided MapAGUI() method is very convenient but impose all the agent logic to be in the AiAgent.
In some case, we may want to have some custom logic executing before/after the agent run (for example by having a custom controller).
Making the underlying AsAGUIEventStreamAsync and the underlying event types public would give developpers more flexibility when adopting AGUI on top of more custom implementations.
changed the title [-][.NET] Make AGUI event types + AsAGUIEventStreamAsync public[/-][+].NET: [.NET] Make AGUI event types + AsAGUIEventStreamAsync public[/+]on Nov 17, 2025
We already have some agents built using MEAI and AgentFramework, but we expose them through custom controllers, which contains additional logic (ex: creating new OTel Activity with custom tags for our Langfuse integration).
This pattern led several of our teams (managing different agents) to implement controller differently, so we don't have a common way to expose an agent response to the UI. Which in turn lead to per-agent glue code in the frontend.
That makes AGUI attractive for us, But the current pattern (.MapAGUI) would mean some rework in several teams (moving said custom logic "in" the AIAgent), so that will slow adoption.
Having a way to simply expose to map AiAgent's AgentRunResponseUpdate (or even MEAI's ChatResponseUpdate) to AGUI events, would makes it easier to gradually adopt AGUI for us.
One is, can you use an IEndpointFilter to wrap the call to Map AGUI and take action before/after?
The other one is, can you instead capture the delegate from MapAGUI and use that within your controller? You'll have a RequestDelegate instance that you can invoke within the controller itself.
Activity
[-][.NET] Make AGUI event types + AsAGUIEventStreamAsync public[/-][+].NET: [.NET] Make AGUI event types + AsAGUIEventStreamAsync public[/+]javiercn commentedon Nov 17, 2025
Jean-Baptiste Muscat (@ouvreboite) thanks for contacting us.
At this point the choice of keeping AG-UI related types as an implementation detail is an explicit choice on our part.
It will help us if you can give us concrete examples on what you are trying to achieve so we can see if we can give you alternative approaches.
ouvreboite commentedon Nov 18, 2025
Hi.
We already have some agents built using MEAI and AgentFramework, but we expose them through custom controllers, which contains additional logic (ex: creating new OTel Activity with custom tags for our Langfuse integration).
This pattern led several of our teams (managing different agents) to implement controller differently, so we don't have a common way to expose an agent response to the UI. Which in turn lead to per-agent glue code in the frontend.
That makes AGUI attractive for us, But the current pattern (
.MapAGUI) would mean some rework in several teams (moving said custom logic "in" the AIAgent), so that will slow adoption.Having a way to simply expose to map AiAgent's
AgentRunResponseUpdate(or even MEAI's ChatResponseUpdate) to AGUI events, would makes it easier to gradually adopt AGUI for us.javiercn commentedon Nov 28, 2025
Jean-Baptiste Muscat (@ouvreboite) thanks for the additional details.
A couple of thoughts in this regard.
One is, can you use an IEndpointFilter to wrap the call to Map AGUI and take action before/after?
The other one is, can you instead capture the delegate from MapAGUI and use that within your controller? You'll have a RequestDelegate instance that you can invoke within the controller itself.
ouvreboite commentedon Dec 3, 2025
Javier Calvarro Nelson (@javiercn) thanks! I'll look into both options.