You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chatbot-integration/openai-chatgpt/README.md
+23-6Lines changed: 23 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,7 @@ This is an example project for TalkJS's tutorial on [How to integrate a chatbot
4
4
5
5
The project uses TalkJS webhooks to listen for new message events from the TalkJS server, calls the OpenAI API to generate a message reply, and then adds the reply to the conversation with the TalkJS API.
6
6
7
-
> [!TIP]
8
-
> [Download this example project as a zip file](https://github.com/talkjs/talkjs-examples/releases/latest/download/chatbot-integration.openai-chatgpt.zip)
7
+
> [!TIP] > [Download this example project as a zip file](https://github.com/talkjs/talkjs-examples/releases/latest/download/chatbot-integration.openai-chatgpt.zip)
9
8
10
9
## Prerequisites
11
10
@@ -23,7 +22,25 @@ To run this tutorial, you will need:
23
22
2. Replace `<APP_ID>` and `<TALKJS_SECRET_KEY>` in `index.html` and `server.js` with the values found in your [TalkJS dashboard](https://talkjs.com/dashboard/login).
24
23
3. Replace `<OPENAI_SECRET_KEY>` with your OpenAI API key
25
24
4. Enable the `message.sent` option in the **Webhooks** section of the TalkJS dashboard.
26
-
5. Start ngrok with `ngrok http 3000`.
27
-
6. Add the ngrok URL to **Webhook URLs** in the TalkJS dashboard.
28
-
7. Run `npm install` to install dependencies.
29
-
8. Run `npm start` to start the webhooks server.
25
+
5. Update the theme to show a typing indicator when the bot is generating a response. In the **Themes** tab, select to **Edit** the `default` theme. Select the `UserMessage` component from the list of **Built-in components** and replace the existing `MessageBody` component with the following:
7. Add the ngrok URL to **Webhook URLs** in the TalkJS dashboard, along with the `/onMessageSent` path: `https://<YOUR_SITE>.ngrok-free.app/onMessageSent`.
0 commit comments