From 395b224530488c6efc0d17a66f639669ad801e2a Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 16 Aug 2024 17:37:51 +0000 Subject: [PATCH] updated test --- .../sample/genaisrc/style/runprompt.genai.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/sample/genaisrc/style/runprompt.genai.js b/packages/sample/genaisrc/style/runprompt.genai.js index 08147258a4..eae4dc17fa 100644 --- a/packages/sample/genaisrc/style/runprompt.genai.js +++ b/packages/sample/genaisrc/style/runprompt.genai.js @@ -3,15 +3,25 @@ script({ tests: {} }) -const res = await runPrompt(_ => { +const resPoem = await runPrompt(_ => { + _.$`write haiku poem` +}, { + model: "openai:gpt-3.5-turbo", + label: "generate poem", + system: ["system"] +}) + +const resJSON = await runPrompt(_ => { _.$`generate 3 random numbers between 1 and 10 and respond in JSON` }, { model: "openai:gpt-3.5-turbo", - label: "Is this JSON?", + label: "generate json", responseType: "json_object", - system: ["system", "system.zero_shot_cot"] }) -$`Is this JSON? +$`Is this poetry? Respond yes or no.` +fence(resPoem.text) + +$`Is this JSON? Respond yes or no.` +fence(resJSON.text) -${res.text}` \ No newline at end of file