[Blazor] Add multimodal message input components - #68672
kotlarmilos wants to merge 21 commits into
Conversation
dd8b97e to
489a976
Compare
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
b67462b to
11410ef
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ab398e0-c70e-427e-93a8-134ee977fb17
javiercn
left a comment
There was a problem hiding this comment.
More feedback.
I'm still not done, I think there are some issues with how the InputMessage component works witht the underlying input sources (like audio)
dariatiurina
left a comment
There was a problem hiding this comment.
Both of my notes here are applicable in more places than what I have marked.
Azure Identity can wrap a canceled token request in an AuthenticationFailedException. Normalize that specific case to an OperationCanceledException so canceling voice transcription does not terminate the Blazor circuit. Add regression coverage for the wrapped cancellation.
I have doubts about "live voice". What about simplifying to one component only? We would support 3 modes: backend speech recognition only (equivalent of recorded voice with |
Double checking in #68227, section "Journey 8 — Ask by voice" has no requirements about hands-free mode nor about components separation. I underlines multiple times that all transcriptions have to be editable.
|
Add configurable speech recognition modes, auto-submit, and continuous listening to AudioCaptureButton, replacing LiveSpeechButton.
|
Demo of redesigned one-component.mp4 |
From #68227 (comment). We're missing tests for this, I am working on covering that gap. Fixed in 84f8832. |
…oads and causes compiler errors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 94653859-e420-46e8-828f-80dd291e33e5
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 94653859-e420-46e8-828f-80dd291e33e5
Keep audio button content stable while microphone permission is pending and render accessible requesting, denied, and unavailable feedback above the message composer. Support custom messages, rendering, state inspection, and dismissal. Harden late permission cleanup, update ClaimApp for the current media API, and add unit and browser coverage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4f835455-8409-4733-b968-69f7d3b9dd90
|
@javiercn @dariatiurina I resolved the remaining comments to resolve stale threads. Please un-resolve threads where you want to keep the discussion open. @dariatiurina will isolate the sample app in a follow-up PR to make it easier for review. |
Keep this change focused on the reusable multimodal message input components. The vehicle claim sample, the DojoClient.E2E.Tests -> Components.AI.E2E.Tests rename, and the ClaimApp scenario tests move to a follow-up change stacked on top of this branch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
I divided PR into two: multimodal support and ClaimApp sample app. I couldn't do stack PR, so |
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