mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
[bin] Ask people to rummage before ideas
This commit is contained in:
parent
92df1d9b01
commit
753f53f953
1 changed files with 16 additions and 10 deletions
|
|
@ -255,18 +255,24 @@ async function generateProjectIdea() {
|
|||
document.querySelector('#generate-project-idea').classList.add('disabled')
|
||||
document.querySelector('#project-idea').innerHTML = "<em>" + thinkingWords() + "..." + "</em>"
|
||||
document.querySelector('#generate-project-idea').src = "https://cloud-80eg2m8id-hack-club-bot.vercel.app/0thinking_rac.png"
|
||||
const res = await fetch('/api/bin/openai/', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ parts: selectedParts })
|
||||
})
|
||||
const json = await res.json()
|
||||
document.querySelector('#project-idea').innerHTML = json.recommendation
|
||||
let text = ""
|
||||
if (selectedParts.length == 0) {
|
||||
text = "You need to rummage for some parts first!"
|
||||
} else {
|
||||
const res = await fetch('/api/bin/openai/', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ parts: selectedParts })
|
||||
})
|
||||
const json = await res.json()
|
||||
text = json.recommendation
|
||||
}
|
||||
document.querySelector('#project-idea').innerHTML = text
|
||||
document.querySelector('#generate-project-idea').src = "https://cloud-cyo3pqn0f-hack-club-bot.vercel.app/0statement_rac.png"
|
||||
document.querySelector('#generate-project-idea').classList.remove('disabled')
|
||||
yap(json.recommendation)
|
||||
yap(text)
|
||||
}
|
||||
|
||||
function thinkingWords() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue