sarahciston commited on
Commit
227827f
1 Parent(s): 83049d3

try stringify first

Browse files
Files changed (1) hide show
  1. index.js +12 -9
index.js CHANGED
@@ -52,7 +52,7 @@ new p5(function (p5){
52
  p5.setup = function(){
53
  p5.noCanvas()
54
  console.log('p5 instance loaded')
55
- makeDisplayText()
56
  makeFields()
57
  makeButtons()
58
  }
@@ -61,7 +61,7 @@ new p5(function (p5){
61
  //
62
  }
63
 
64
- function makeDisplayText(){
65
  let title = p5.createElement('h1','p5.js Critical AI Prompt Battle')
66
  let intro = p5.createP(`This tool lets you run several AI chat prompts at once and compare their results. Use it to explore what models 'know' about various concepts, communities, and cultures. For more information on prompt programming and critical AI, see [Tutorial & extra info][TO-DO][XXX]`)
67
  }
@@ -78,18 +78,21 @@ new p5(function (p5){
78
  let submitButton = p5.createButton("SUBMIT")
79
  submitButton.size(170)
80
  submitButton.class('submit')
81
- submitButton.mousePressed(makeResultsText)
82
  }
83
 
84
- async function makeResultsText(){
85
  console.log('button pressed')
86
- let resultsText = p5.createElement('h4',"Results:")
87
 
88
- // let out = await fillInTask() //just model no parsing
89
- let out = await getOutputs(fillInTask()) // model and parsing
90
- console.log(out)
91
 
92
- await resultsText.html(out)
 
 
 
 
93
  }
94
 
95
  });
 
52
  p5.setup = function(){
53
  p5.noCanvas()
54
  console.log('p5 instance loaded')
55
+ makeTextDisplay()
56
  makeFields()
57
  makeButtons()
58
  }
 
61
  //
62
  }
63
 
64
+ function makeTextDisplay(){
65
  let title = p5.createElement('h1','p5.js Critical AI Prompt Battle')
66
  let intro = p5.createP(`This tool lets you run several AI chat prompts at once and compare their results. Use it to explore what models 'know' about various concepts, communities, and cultures. For more information on prompt programming and critical AI, see [Tutorial & extra info][TO-DO][XXX]`)
67
  }
 
78
  let submitButton = p5.createButton("SUBMIT")
79
  submitButton.size(170)
80
  submitButton.class('submit')
81
+ submitButton.mousePressed(makeOutputDisplay)
82
  }
83
 
84
+ async function makeOutputDisplay(){
85
  console.log('button pressed')
86
+ let outHead = p5.createElement('h4',"Results:")
87
 
88
+ let out = await fillInTask() //just model no parsing
89
+ // let out = await getOutputs(fillInTask()) // model and parsing
 
90
 
91
+ out = str(await out)
92
+ console.log(out)
93
+
94
+ let outText = p5.createP('')
95
+ await outText.html(out)
96
  }
97
 
98
  });