dotnet / dotnet/aspnetcore

Components.AI: Allow UI actions to complete without a model follow-up

Open
#68,780 1 comment 0 reactions 0 assignees View on GitHub
api-proposal area-blazor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is your feature request related to a problem? Please describe the problem.

UI actions always send their result back to the model and request another response.
Sometimes the rendered UI is already the complete answer, so the extra model response adds latency, token usage, and redundant transcript text.

For example:

```text
User: Write me a haiku
UI: Renders the haiku card
AI: "Your haiku is ready"
```

The final AI message is unnecessary because the card is the answer.

### Describe the solution you'd like

Allow applications to opt individual UI actions out of the automatic model follow-up.
The existing follow-up behavior must remain the default.

Possible API shape:

```csharp
options.RegisterUIAction(
generateHaiku,
followUp: false);
```

With follow-up disabled, Components.AI should:

- Execute and render the UI action normally.
- Store its correlated `FunctionResultContent` in conversation history.
- Return the conversation to idle without invoking the model.
- Include the stored result when the user sends a later message.

### Additional context

CopilotKit uses `followUp: false` for its Tool-Based Generative UI haiku action because the rendered card is the final response.

- ASP.NET Core scenario: https://github.com/dotnet/aspnetcore/pull/68330#issuecomment-5409644717
- CopilotKit implementation: https://github.com/ag-ui-protocol/ag-ui/blob/61940951c8ec43121f9c21d9e2c7b2b0043c8dad/apps/dojo/src/app/%5BintegrationId%5D/feature/(v2)/tool_based_generative_ui/page.tsx

Requires public API review.

Contributor guide

Open the contributing guide

Research direction

Start with the Components.AI UI-action registration API and review the proposed followUp option alongside the linked ASP.NET Core discussion. Verify the default follow-up behavior, the no-follow-up conversation state, and later inclusion of the stored FunctionResultContent; completion also requires public API review.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.