AI prompt
AIPromptControlGive users a prompt box with suggestions, commands and history; plug in any model.
Overview
AIPromptControl is a Blazor prompt panel: users type or pick a prompt, generate an answer, run commands such as Shorten, and reuse the result. Use it to draft replies or summaries inside your app: it calls no service itself, and your Generate delegate turns the prompt and command into text, so any model plugs in. The examples use a stub that returns canned text, so no model is called.
Examples
#Prompt, suggestions and commands
Click a suggestion, then Generate or one of the commands; Use in draft copies the response below, and the history buttons bring earlier ones back.
Ticket TKT-1042 Albus Door · Router keeps restarting · every evening since Monday · wants a technician visit on Saturday
Responses so far: 0
#Driving the prompt from the page
Use the page's own buttons: they call GenerateAsync and CancelAsync on the control. The stub takes two and a half seconds, so Stop has time to work; turn on Billing system is down and the next request fails with the message in the card; turn on Ticket solved and Enabled locks the prompt, Generate and the commands, and the card's Add to the ticket button then does nothing. The history buttons show each response's time and prompt, not its command, so a shortened note is captioned like the full one.
Keeps the last three responses. The answers are canned, so no model is called.
Note on Hermione Ranger's ticket TKT-1043: none yet