Make it so you can't delete the last prompt or scenario

No reason for an experiment to have 0 prompts or 0 scenarios and it makes the UI look bad.
This commit is contained in:
Kyle Corbitt
2023-07-14 15:49:42 -07:00
parent b98eb9b729
commit 26ee8698be
8 changed files with 77 additions and 40 deletions

View File

@@ -9,7 +9,7 @@ export async function constructPrompt(
scenario: TestScenario["variableValues"],
): Promise<JSONSerializable> {
const code = `
const scenario = ${JSON.stringify(scenario, null, 2)};
const scenario = ${JSON.stringify(scenario ?? {}, null, 2)};
let prompt
${variant.constructFn}