Can't get AI to generate code
# 🤝help
b
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
did you create the variable? 🙂
b
yessir

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

that's why I'm stumped
b
can you show me the error you're running into?
b

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

b
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
When I enter the prompt into the field, then hit tab - it throws the error instead of generate the code
b
try enter, not tab 😛
b
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
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
holy shit
adding a period
wtf?
that's so weird! Maybe it needs to know it's a complete sentence lol
b
did it work?!
b
lol yes
b
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
ohhh
like a cache buster
b
sorta yeah!
it's also a good way to see if the same prompt will generate the same code multiple times
b
good to know - learned a little idiosyncrocy
b
that's how i use it
"the period trick"
b
while I have you -
is it possible to update a knowledgebase from another node?
b
whatcha mean?
b
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
ah I understand your question
but I don't think I have an answer for you at the moment
b
np I know you are busy
thanks again
b
it's an interesting question, let me know if you figure this one out!
b
well, I'm gonna read up on your knowledgebase stuff. I assume it's vectorizing the document