Overview
The Scenarios component creates interactive learning experiences through case studies, role-playing exercises, and problem-solving scenarios. These immersive experiences help students apply theoretical knowledge in practical contexts. You can create scenarios components through the API. Optionally passcriteria to define how student performance is graded; if you omit it or send an empty list, the AI generates criteria at create time.
Validation on create and update. When you provide
characters, tools, or criteria, every entry must include its required fields:- Character —
id,name,role - Tool —
id,name,description,type - Evaluation criterion —
id,description,weight(number, 1–10)
PUT/PATCH to a scenarios component, the server merges your changes with the existing scenario and then requires the merged result to keep these non-empty:context,goal,greetingMessagefinalAnswerPrompt— only whenrequiresFinalAnsweristrue
format is optional — leave it empty and the runtime falls back to a generic conversational interaction.Partial updates (sending just criteria, just tools, etc.) are fine — the existing values fill in. The call only fails (400 Bad Request) if your update would clear one of the required fields above.Creating a Scenarios Component
Configuration Parameters
Name of the scenarios component
Must be
"scenarios"Scenarios configuration object
Response
Embedding This Component
Once you’ve created a Scenarios component, you can embed it on your website using the embedding API.Generate Embed URL
Scenarios-Specific Embedding Features
Save scenario progress and allow users to resume where they left off