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 service
  • prompt - The original prompt text that was sent to the AI service
  • id - The unique identifier for the output
  • isRetry - Whether this is a retry operation
  • activeView - The index of the view to activate after adding the output
  • isLoading - Whether the output is in loading state
  • isStreaming - 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
promptResponse
Not finding the help you need?
Contact Support