AI Experiences

AI Experiences API

API for creating, accessing and updating AI Experiences. AI Experiences are used to create interactive AI-powered learning scenarios within courses.

An AiExperience object looks like:

// An AI Experience for interactive learning
{
  // The ID of the AI experience
  "id": 234,
  // The title for the AI experience
  "title": "Customer Service Simulation",
  // The description of the AI experience
  "description": "Practice customer service skills in a simulated environment",
  // The AI facts for the experience (optional)
  "facts": "You are a customer service representative...",
  // The learning objectives for this experience
  "learning_objective": "Students will practice active listening and problem-solving",
  // The pedagogical guidance for the experience
  "pedagogical_guidance": "A customer is calling about a billing issue",
  // The current published state of the AI experience
  "workflow_state": "published",
  // The course this experience belongs to
  "course_id": 1578941
}

AiExperiencesController#index

GET /api/v1/courses/:course_id/ai_experiences

Scope: url:GET|/api/v1/courses/:course_id/ai_experiences

Retrieve the paginated list of AI experiences for a course

Request Parameters:

Parameter
Type
Description

workflow_state

string

Only return experiences with the specified workflow state. Allowed values: published, unpublished, deleted

Returns a list of AiExperience objects.

AiExperiencesController#show

GET /api/v1/courses/:course_id/ai_experiences/:id

Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/:id

Retrieve an AI experience by ID

Returns an AiExperience object.

AiExperiencesController#new

GET /api/v1/courses/:course_id/ai_experiences/new

Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/new

Display the form for creating a new AI experience

AiExperiencesController#edit

GET /api/v1/courses/:course_id/ai_experiences/:id/edit

Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/:id/edit

Display the form for editing an existing AI experience

AiExperiencesController#create

POST /api/v1/courses/:course_id/ai_experiences

Scope: url:POST|/api/v1/courses/:course_id/ai_experiences

Create a new AI experience for the specified course

Request Parameters:

Parameter
Type
Description

title

Required string

The title of the AI experience.

description

string

The description of the AI experience.

facts

string

The AI facts for the experience.

learning_objective

Required string

The learning objectives for this experience.

pedagogical_guidance

Required string

The pedagogical guidance for the experience.

workflow_state

string

The initial state of the experience. Defaults to ‘unpublished’. Allowed values: published, unpublished

Returns an AiExperience object.

AiExperiencesController#update

PUT /api/v1/courses/:course_id/ai_experiences/:id

Scope: url:PUT|/api/v1/courses/:course_id/ai_experiences/:id

Update an existing AI experience

Request Parameters:

Parameter
Type
Description

title

string

The title of the AI experience.

description

string

The description of the AI experience.

facts

string

The AI facts for the experience.

learning_objective

Required string

The learning objectives for this experience.

pedagogical_guidance

Required string

The pedagogical guidance for the experience.

workflow_state

string

The state of the experience. Allowed values: published, unpublished

Returns an AiExperience object.

AiExperiencesController#destroy

DELETE /api/v1/courses/:course_id/ai_experiences/:id

Scope: url:DELETE|/api/v1/courses/:course_id/ai_experiences/:id

Delete an AI experience (soft delete - marks as deleted)

Returns an AiExperience object.

AiExperiencesController#continue_conversation

POST /api/v1/courses/:course_id/ai_experiences/:id/continue_conversation

Scope: url:POST|/api/v1/courses/:course_id/ai_experiences/:id/continue_conversation

Initialize or continue a conversation with the AI experience

Request Parameters:

Parameter
Type
Description

messages

Array

The conversation history. If empty, will return starting messages.

conversation_id

string

The conversation ID from llm-conversation service. Required for continuing conversations.

restart

boolean

If true, marks existing conversation as completed and creates a new one.

AiExperiencesController#messages

GET /api/v1/courses/:course_id/ai_experiences/:id/messages

Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/:id/messages

Retrieve messages from an existing conversation in llm-conversation service

Request Parameters:

Parameter
Type
Description

conversation_id

Required string

The conversation ID from llm-conversation service


This documentation is generated directly from the Canvas LMS source code, available on Github.

Last updated

Was this helpful?