AI Conversations
API for managing conversations with AI Experiences.
Show conversation
AiConversationsController#show
GET /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id
Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id
Get a specific conversation by ID (for teachers viewing student conversations)
Get active conversation
AiConversationsController#active_conversation
GET /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations
Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations
Get the active conversation for the current user and AI experience
Create AI conversation
AiConversationsController#create
POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations
Scope: url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations
Initialize a new conversation with the AI experience
Post message to conversation
AiConversationsController#post_message
POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages
Scope: url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages
Send a message to an existing conversation and get the AI response
Request Parameters:
message
Required string
The user's message to send to the AI
Delete AI conversation
AiConversationsController#destroy
DELETE /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id
Scope: url:DELETE|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id
End the current conversation session
Get conversation evaluation
AiConversationsController#evaluation
GET /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/evaluation
Scope: url:GET|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/evaluation
Fetch the latest stored evaluation for a conversation from the llm-conversation service. Reads only — does not run the LLM and is not rate-limited. evaluation is null when none has been generated yet (llma returns 200 + null, never 404, so this is distinguishable from an outage). stale is true when the AI experience was edited after the stored evaluation was generated.
Generate conversation evaluation
AiConversationsController#create_evaluation
POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/evaluation
Scope: url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/evaluation
Run the LLM to (re)generate an evaluation for a conversation and persist it in the llm-conversation service. Rate-limited. Also the Reset path — a fresh run replaces any prior stored evaluation.
Create feedback on a conversation message
AiConversationsController#create_feedback
POST /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback
Scope: url:POST|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback
Submit a like or dislike vote on an AI-generated message.
Ownership: load_conversation gates this action — only the conversation owner or a course manager reaches here. Sub-resource (message_id within the conversation) scoping is delegated to llma.
Request Parameters:
vote
Required string
"liked" or "disliked"
message_id
Required string
llm-conversation message UUID
feedback_message
string
optional text for dislike
Delete feedback on a conversation message
AiConversationsController#delete_feedback
DELETE /api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback/:feedback_id
Scope: url:DELETE|/api/v1/courses/:course_id/ai_experiences/:ai_experience_id/conversations/:id/messages/:message_id/feedback/:feedback_id
Remove a previously submitted vote (toggling off like/dislike).
Ownership: load_conversation gates this action — only the conversation owner or a course manager reaches here. Sub-resource (message_id, feedback_id within the conversation) scoping is delegated to llma.
Last updated
Was this helpful?