AIPromptEventBuilder
Methods
CommandExecute(System.String)
Triggered when a command item from the Commands view is clicked. The panel bar dataItem of the selected item is available through the event argument.
For more information see CommandExecute event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the commandExecute event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
CommandExecute(System.Func)
Triggered when a command item from the Commands view is clicked. The panel bar dataItem of the selected item is available through the event argument.
For more information see CommandExecute event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .
PromptRequest(System.String)
Triggered when the prompt view Generate output button is clicked. The prompt text is available through the event argument. Suitable to make a request to the AI service to receive an output. Use the addPromptOutput method to add the generated output to the promptOutputs collection.The prompt, output, history and isRetry properties are available in the event argument. When the output is generated after clicking the retry button of an output, the isRetry property is true and the output property is the output content of the output card. The history property is an array of prompt outputs generated before the current output.
For more information see PromptRequest event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the promptRequest event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
PromptRequest(System.Func)
Triggered when the prompt view Generate output button is clicked. The prompt text is available through the event argument. Suitable to make a request to the AI service to receive an output. Use the addPromptOutput method to add the generated output to the promptOutputs collection.The prompt, output, history and isRetry properties are available in the event argument. When the output is generated after clicking the retry button of an output, the isRetry property is true and the output property is the output content of the output card. The history property is an array of prompt outputs generated before the current output.
For more information see PromptRequest event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .
PromptResponse(System.String)
Triggered when the AI service response is received. The response data is available through the event argument. Triggered only when the serviceUrl option is set.
For more information see PromptResponse event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the promptResponse event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
PromptResponse(System.Func)
Triggered when the AI service response is received. The response data is available through the event argument. Triggered only when the serviceUrl option is set.
For more information see PromptResponse event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .
OutputRatingChange(System.String)
Triggered when the rating of an output is changed through the rate buttons of an output. The output id and the new rating are available through the event argument.
For more information see OutputRatingChange event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the outputRatingChange event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
OutputRatingChange(System.Func)
Triggered when the rating of an output is changed through the rate buttons of an output. The output id and the new rating are available through the event argument.
For more information see OutputRatingChange event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .
OutputCopy(System.String)
Triggered when the copy output button of an output is clicked. The prompt and the output object are available through the event argument.
For more information see OutputCopy event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the outputCopy event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
OutputCopy(System.Func)
Triggered when the copy output button of an output is clicked. The prompt and the output object are available through the event argument.
For more information see OutputCopy event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .
OutputAction(System.String)
Triggered when an action button on an output card is clicked. This event is fired for both built-in and custom actions.
For more information see OutputAction event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the outputAction event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
OutputAction(System.Func)
Triggered when an action button on an output card is clicked. This event is fired for both built-in and custom actions.
For more information see OutputAction event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .
PromptRequestCancel(System.String)
Triggered when a prompt request is cancelled, typically by clicking the stop generation button during streaming operations.
For more information see PromptRequestCancel event.
Parameters
handler - System.String
The name of the JavaScript function that will handle the promptRequestCancel event.
RETURNS
Returns the current instance of AIPromptEventBuilder .
PromptRequestCancel(System.Func)
Triggered when a prompt request is cancelled, typically by clicking the stop generation button during streaming operations.
For more information see PromptRequestCancel event.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag.
RETURNS
Returns the current instance of AIPromptEventBuilder .