promptResponse
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.
Event Data
e.output Object
The output object containing the AI service response data with the following properties:
output
- The generated text content from the AI serviceprompt
- The original prompt text that was sent to the AI serviceid
- The unique identifier for the outputisRetry
- Whether this is a retry operationactiveView
- The index of the view to activate after adding the outputisLoading
- Whether the output is in loading stateisStreaming
- Whether the output is being streamed
e.prompt String
The original prompt text that was sent to the AI service.
e.outputId String
The unique identifier for the output.
e.isRetry Boolean
Whether this is a retry operation.
Example
<div id="aiprompt"></div>
<script>
$("#aiprompt").kendoAIPrompt({
service: "/api/llm",
promptResponse: function(e) {
console.log("AI Response received:");
console.log("Output object:", e.output);
console.log("Generated content:", e.output.output);
console.log("Output ID:", e.outputId);
console.log("Original prompt:", e.prompt);
console.log("Is retry:", e.isRetry);
}
});
</script>
In this article