Then bring over your OpenAI API key to the Secrets Manager as OPEN_API_KEY.
If you click Run, you’ve already got some interaction going right out of the box, but let’s make it more useful!
The new API uses a messages array to deal with nearly everything. You can set up your starting prompt using the new `system` role and give context and instructions to your bot.
Using a prompt borrowed from @emollick we can set GPT-3 up to think of itself as an adaptive tutor, one that will adjust its teaching style and complexity to our level of understanding - that and multiple choice quizzing too! We’ve just got to customise the prompt.
@emollick Let’s set this array up, use an f-string to replace the learning topic with something user generated. Getting the response from the AI is as simple as sending a one-line command to the API.
@emollick When we get back a message from the AI, we want to assign that to the `assistant` role and add it to the messages array. This means that we have a history of the conversation because…
@emollick Each time we go out to the API, we have to send it the full messages array, so it has all the instructions and the original context. If you don’t maintain your messages array no one else will! It’s not chat if it doesn’t remember what the user said.
@emollick The next step is to ask the user for their response and package this all back up for the API.
Nice and simple, we just need to append the dictionary containing the content back to the messages array before the end of the loop.
@emollick Hit run on your Repl and - boom - you’ve built a universal tutor bot, that can teach anyone about anything and adjust its language accordingly.
Can you imagine how much work this would have been six months ago? Now it’s a 3-minute job!
He needed a developer to build an AI shopping assistant for Onfolio portfolio company, Mighty Deals, a free website that lists daily deals for design tools and software.
We couldn’t host Replit Developer Day without having an opportunity for developers to build.
After our keynote event, we hosted builders in our SF office, and as always, the demos were incredible!
Here’s a sampling of what they built 👇
@itsandrewgao is known for his creative AI projects on Replit, like biblegpt.org, but his hack night project was some of his best work yet.
He digitally cloned David Attenborough’s voice, and created an app that makes a mockumentary with a single prompt.
Selali’s been working on @notionsmith, a UX persona generator for any product. He used @itsandrewgao’s project as an input and got some really interesting outputs.
You can even chat with the different personas to get deeper product insights.