generateFeedback - Methods - Feedback Aide API

Feedback Aide API Methods

generateFeedback()

The method to use our Feedback API without our predefined UI (for clients who have already had their own UI and rubric).

You would want to use this to request our Feedback Aide server to generate feedback and score based on the current session's stimulus, response, and rubric.

This method will stream a fetch request and will update the UI (built by attach method above) progressively.

Note This process can only be run once. Any subsequent call will return the previously completed result.

Note This method is not available for feedbackSession state: review.

Examples

const { response, cancel } = feedbackSession.generateFeedback();
// Continue waiting for the promise to resolve
response.then((result) => {
    console.log(result);
});
// Or cancel the current process
cancel();

Arguments

  • modelConfiguration object

    The AI model configuration object.

    • model string

      The AI model to use for generating feedback.

      Accepts the followings:

      • standard-essay
      • standard-essay-2024-06-30
      • advanced-essay
      • advanced-essay-2024-06-30

  • options object

    • onProgress callback

      Callback function for progress updates.

    • onComplete callback

      Callback function for completion updates.

    • onError callback

      Callback function for error handling.

Return value

Type object

  • response Promise

    The current generating feedback promise.

  • cancel function

    Used to cancel the current process.

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.