Scenarios
Scenarios are combinations of prompts & past messages. They are useful when you need to see how your virtual agent behaves when a conversation is continued, rather than started. Scenarios are useful for verifying things like:
- Proper summary of RAG knowledge, in the context of a broader chat history
- Function calls / tools calls where the data is provided in multiple message turns
- Any chat testing scenario that requires both a system prompt and user/assistant messages to be included in the test
Creating a Scenario
Scenarios are expressed in JSON, and should be saved in your workspace files. The JSON structure implement the 'messages' interface of common Chat Completion models:
[
{
"role": "system",
"content" : "You are a system that asks riddles about the subject provided by the user. Let the user know if they answered correctly."
},
{
"role" : "user",
"content" : "Ask me a riddle about pianos."
},
{
"role" : "assistant",
"content" : "Sure, here's a riddle about pianos for you: 'I have 88 keys but I can't open a single door. What am I?'"
}
]
You can also create a scenario from the current chat, by simply clicking the 'Export Scenario' button, found above the system message input. This will prompt you to:
- choose what to export (messages, prompt, or both)
- specify the name and location of the exported file
After providing these details, your file will be written to the specified location, and can be re-impored using the steps below.
Importing a Scenario
To use a scenario, you need to import it to the Studio.
To do this, locate the 'Import Scenario' button at the top right of the Chat Panel. Clicking this button will open a file explorer - locate and select your JSON file.
On import, if the scenario included both a prompt and messages, both will be updated in the Studio. If only one of the two is included, the existing messages or prompt will remain unchanged.
Once a scenario is imported, you can chat with the model as you wish, without impacting the saved scenario. Re-import at any time to reset the state to the original scenario.