From 69cae3ac571f816a3711bf1016b359b578c78251 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Thu, 14 Dec 2023 20:47:37 +0000 Subject: [PATCH] feat: add finalized prompt (#2119) --- examples/sample-p5-app/src/llm.js | 37 ++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/examples/sample-p5-app/src/llm.js b/examples/sample-p5-app/src/llm.js index 1e597cb863..88e1e6f189 100644 --- a/examples/sample-p5-app/src/llm.js +++ b/examples/sample-p5-app/src/llm.js @@ -44,5 +44,40 @@ export async function getSummary(block) { function createPrompt(block) { const blockString = blocksToString(block); - return `Create a one sentence summary of the following code ${blockString}`; + return `"Program #1: + +\`\`\` +draw set fill colour to #090 draw rectangle x 190 y 190 width 20 height 200 set fill colour to #963draw ellipse x 200 y 200 width 100 height 100 set fill colour to #fc0 set radius to (200 ÷ 3) set angleStep to (360 ÷ 20) count with angle from 0 to 360 by angleStep do set x to (((cos angle) × radius) + 200) set y to (((sin angle) × radius) + 200) draw ellipse x x y y width (radius ÷ 2) height (radius ÷ 2) +\`\`\` + +Summary #1: Draws a sunflower. + +Program #2: + +\`\`\` +draw + set stroke colour to #000 + set fill colour to #000 + draw ellipse x 200 y 200 width 30 height 80 + set stroke colour to #000 + draw line x1 200 y1 160 x2 180 y2 140 + draw line x1 200 y1 160 x2 220 y2 140 + set stroke colour to #c3c + set fill colour to #c3c + draw ellipse x 160 y 180 width 50 height 50 + draw ellipse x 165 y 220 width 40 height 30 + draw ellipse x 240 y 180 width 50 height 50 + draw ellipse x 235 y 220 width 40 height 30 +\`\`\` + +Summary #2: Draws a butterfly. + + +Program #3: +\`\`\` +${blockString} +\`\`\` + +Summary #3: +` }