Example of Overview in ASP.NET Core Inline AI Assist Control
This sample demonstrates the overview functionalities of the Inline AI Assist component in an email draft assistant scenario. Users can access AI assistance in two ways: hover over any paragraph to see a sparkle button for inline editing, or click the AI Assistant button to enhance the entire email content.
📧 Email Draft Assistant
Dear Team,
I hope this email finds you well. I wanted to provide you with an update on our current project status. We successfully completed Phase 1 last week, and I'm pleased to share that all deliverables were met according to schedule. The client presentation went well and they expressed satisfaction with our progress.
As we move forward into Phase 2, I would appreciate it if everyone could submit their progress reports by Friday. Additionally, we should schedule a team meeting next week to discuss the upcoming timeline and address any questions or concerns you may have.
Thank you for your continued dedication and hard work on this project.
Best regards,
Project Management Team
In this example, the Inline AI Assist component showcases the following key features:
commandSettings- Defines predefined AI commands (Summarize, Fix Grammar, Make Professional, Make Friendly)relateTo- Positions the popup relative to the element provided in the relateTo propertypromptRequest- Processes AI requests through the backend API serviceresponseSettings- Handles Accept and Reject actions for AI responsesshowPopup- Programmatically opens the AI Assist popupopenandclose- Events for tracking popup state
Processing of the Prompt:
- When a prompt is executed, the
promptRequestevent is triggered, followed by afetchrequest to the backend API service. - The response from the LLM is streamed back using the
addResponsemethod. - When the Stop Responding button is clicked, the streaming process is cancelled using
abortController.