https://discord.gg/botpress logo
#🤝help
Can't get AI to generate code
# 🤝help
b

best-van-29764

07/21/2023, 3:52 PM
I've entered my prompt but it's telling me that I need to create the variable (workflow.perksList). I set the variable already on the right side under main workflow properties. Am I supposed to add my OPENAI api key somewhere for the AI to work?

https://cdn.discordapp.com/attachments/1131976959560269824/1131976959761592330/image.png

My prompt:
Copy code
make a GET request to https://example.com/v1/perks with the following URL parameters: key:env.wellzy. If the response.status is 200, save the response.data.results to workflow.perksList
my env variable is set
@bumpy-butcher-41910 wondering if you can help a fella out
b

bumpy-butcher-41910

07/21/2023, 6:02 PM
did you create the variable? 🙂
b

best-van-29764

07/21/2023, 6:02 PM
yessir

https://cdn.discordapp.com/attachments/1131976959560269824/1132009781939404850/image.png

that's why I'm stumped
b

bumpy-butcher-41910

07/21/2023, 6:03 PM
can you show me the error you're running into?
b

best-van-29764

07/21/2023, 6:04 PM

https://cdn.discordapp.com/attachments/1131976959560269824/1132010185704091648/image.png

b

bumpy-butcher-41910

07/21/2023, 6:04 PM
ah so that's the error
lemme try to recreate it
are you generating your code?
I was able to generate code from your prompt
b

best-van-29764

07/21/2023, 6:05 PM
When I enter the prompt into the field, then hit tab - it throws the error instead of generate the code
b

bumpy-butcher-41910

07/21/2023, 6:05 PM
try enter, not tab 😛
b

best-van-29764

07/21/2023, 6:08 PM
nothing happens
literally, which is why I thought I should use tab
I thoughtit was bcz I was in incognito (Chrome), so switched. Then disabled uBlock Origins.
still nothing
no console errors
b

bumpy-butcher-41910

07/21/2023, 6:09 PM
try adding a period to the end of your prompt
then hit enter again
or refresh and paste the prompt into a new card, and try again
b

best-van-29764

07/21/2023, 6:10 PM
holy shit
adding a period
wtf?
that's so weird! Maybe it needs to know it's a complete sentence lol
b

bumpy-butcher-41910

07/21/2023, 6:10 PM
did it work?!
b

best-van-29764

07/21/2023, 6:10 PM
lol yes
b

bumpy-butcher-41910

07/21/2023, 6:10 PM
it's not that it's a sentence - but Botpress is watching to see if you've made any changes to the prompt
and will throw a new request to OpenAI each time you do, to generate a new prompt
so that's a little hacky way of testing this out
b

best-van-29764

07/21/2023, 6:11 PM
ohhh
like a cache buster
b

bumpy-butcher-41910

07/21/2023, 6:11 PM
sorta yeah!
it's also a good way to see if the same prompt will generate the same code multiple times
b

best-van-29764

07/21/2023, 6:11 PM
good to know - learned a little idiosyncrocy
b

bumpy-butcher-41910

07/21/2023, 6:11 PM
that's how i use it
"the period trick"
b

best-van-29764

07/21/2023, 6:11 PM
while I have you -
is it possible to update a knowledgebase from another node?
b

bumpy-butcher-41910

07/21/2023, 6:12 PM
whatcha mean?
b

best-van-29764

07/21/2023, 6:12 PM
like use external API, process data, pass to knowledgebase as JSON (or text or w/e)
in my case I'm using a WordPress endpoint and pulling post info
would love to localize in a knowledgebase - but I'm not sure what the limits are on those
b

bumpy-butcher-41910

07/21/2023, 6:13 PM
ah I understand your question
but I don't think I have an answer for you at the moment
b

best-van-29764

07/21/2023, 6:14 PM
np I know you are busy
thanks again
b

bumpy-butcher-41910

07/21/2023, 6:14 PM
it's an interesting question, let me know if you figure this one out!
b

best-van-29764

07/21/2023, 6:15 PM
well, I'm gonna read up on your knowledgebase stuff. I assume it's vectorizing the document