[Blazor] Add multimodal message input components - #68672
Open
kotlarmilos wants to merge 4 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8305953e-ce14-4a55-b291-77beaac47b0a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8305953e-ce14-4a55-b291-77beaac47b0a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8305953e-ce14-4a55-b291-77beaac47b0a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8305953e-ce14-4a55-b291-77beaac47b0a
kotlarmilos
marked this pull request as ready for review
August 21, 2026 08:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This is position 10 in the native Components.AI stack and depends directly on #68335. This three-commit layer adds reusable multimodal message input components for attachments, recorded audio, live speech, submission, and cancellation, then exercises them in a production-oriented vehicle claim sample. The shipping UI runtime remains provider-neutral while the sample uses the real
UIAgent -> AGUIChatClient -> HTTP/SSE -> AGUI.Serverpath and Microsoft Foundry for chat, vision, transcription, and grounded repair research.Design
MessageInputbecomes the composition boundary for text andDataContent. It owns the draft, attachments, validation state, submission state, and cancellation state throughMessageInputContext.MessageAttachButton,AudioCaptureButton,LiveSpeechButton,MessageSendButton, andMessageStopButtonconsume that shared context instead of duplicating composer state.Recorded voice and live voice have separate behavior. Recorded voice streams interim browser recognition into the textbox and sends the completed audio to the configured transcription callback. Live voice submits finalized browser transcripts directly as conversation turns, keeps listening across model responses and recoverable failures, and stops only when the user explicitly disables it or browser speech recognition reports a fatal error. Assistant responses remain text-only.
Media enters the existing content pipeline through
DataContentBlock,DataContentHandler, andMediaContent. This keeps images and audio represented asMicrosoft.Extensions.AI.DataContentthroughout the agent pipeline instead of introducing provider-specific message types.Microsoft.AspNetCore.Components.Media.Audioprovides the corresponding audio rendering surface. Audio capture uses the browser-nativeMediaRecorderandSpeechRecognitionAPIs without third-party JavaScript dependencies.Retries now treat each protocol round as a transaction. A failed user message or continuation is not committed to conversation history, partial response blocks are removed, and retry replays the exact failed round without duplicating the rendered request, text, attachments, tool results, or approval responses.
Implementation
The vehicle claim sample demonstrates the complete composition model:
MessageInput.IClaimAssistantBackend.AGUIChatClient, HTTP, SSE serialization,AGUI.Server, client tools, state mapping, and approval continuations remain production code.claim-agentrequest endpoint.ClaimAgent:BaseAddressand otherwise resolves fromNavigationManager.BaseUri, preserving reverse-proxy path prefixes.The sample also covers light, dark, and high-contrast themes, keyboard submission and cancellation, accessible attachment and voice controls, cumulative evidence reassessment, approval rejection, and retry recovery.
Outcome
git diff --checkpassed