<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PP7S83N" height="0" width="0" style="display:none;visibility:hidden">
Tutorial

Add a ChatGPT prompt clone for your Superblocks app

This tutorial will show how to create a ChatGPT prompt clone that you can add to your Superblocks app. Have Superblocks ready, a developer account with OpenAI, and let's get started.

1. Weavy API key and backend

First we need an API key to communicate with the Weavy backend.

2. OpenAI API Key

To connect the bot to OpenAI, we need an OpenAI API key. Log in to your OpenAI account and find or create an API key. 

3. Name the bot

The bot needs a display name (what the end user sees) and a unique identifier required when rendering our messenger in bot mode.

The unique identifier (uid) is also used to update the bot through the Web API, etc.

4. Create the bot

Now it's time to create the bot in Weavy through the API using CURL with your provided information.
Copy and paste this into a terminal window and run it
curl WY_BACKEND_URL/api/users -H "Authorization: Bearer WY_API_*****************" --json "{ 'uid': 'BOT_UID', 'name': 'BOT_NAME', is_bot: true, 'metadata': {'family': 'OpenAI', 'model' : 'gpt-4o', 'api_key' : 'OPENAI_API_*****************'} }"
This will create a bot user in Weavy using OpenAI with the gpt-4o model.

5. Add a Weavy Messenger component

Open the Add components panel in the Superblocks app editor and locate the Weavy Messenger component.

Drag the Weavy Messenger component onto your page canvas.

superblocks-components-smaller-2x

6. Add AI prompt

Select the Weavy Messenger component and find the property Bot mode in the side panel;  copy and paste the value below.

BOT_UID
superblocks-messenger-bot-openai

7. Done!

The Weavy Messengerwith bot mode enabled should load instantly.

Note that this is fully working now and available for all your users if you want - AI prompting added, just like that.

Ask AI
Support

To access live chat with our developer success team you need a Weavy account.

Sign in or create a Weavy account