Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
feat: add live-chat for the new chat package (COR-0000) (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
gillyb authored Sep 25, 2024
1 parent a0168f8 commit ed3c0a9
Show file tree
Hide file tree
Showing 19 changed files with 1,905 additions and 2 deletions.
5 changes: 5 additions & 0 deletions examples/live-chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

61 changes: 61 additions & 0 deletions examples/live-chat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Live Chat Example

## 🚧 WIP 🚧

This is an example showing the new `chat` package.
It is under construction, not nearly stable and shouldn't be used in any context.

In order to run this example, from the project root directory, run:

```
yarn run dev:chat
```

## Install Dependencies

```sh
yarn install
```

## Import Example Project

Import this [project with custom actions](example_project.vf) into your Voiceflow workspace.
It includes custom `account_info`, `calendar` and `video` actions.

## Configure Environment

Follow [these instructions](https://docs.voiceflow.com/docs/publishing-environments-backups) to publish your Voiceflow Assistant.

Copy the project ID from the Assistant Settings and write it to a `.env.local` file.

```sh
# replace `XXX` with your project ID key
echo 'VF_PROJECT_ID=XXX` > .env.local
```
## Run Dev Server
The demo app will be available locally at <http://127.0.0.1:3006>.
This will also start the WebSocket server located in `server/` to interact with Intercom's APIs.
See the [README](server/README.md) for more information.

For convenience you can run both the chat widget and the WebSocket server at the same time with this command.

```sh
yarn dev
```

<img width="405" alt="Screenshot 2024-04-03 at 12 32 06" src="https://github.com/voiceflow/react-chat/assets/3784470/0674b429-fe12-4e73-8e65-a0d40200ee3a">

## Invoke Custom Actions

### `talk_to_agent`

- "I want to talk to a human"
- "Please connect me to a human"

This will switch the conversation into a mode that emulates talking with a live agent.
New messages will skip the Voiceflow logic and be sent directly to the agent.
You can also end the live conversation and return to talking with the Voiceflow bot.
Make sure to run the server in `./server` with the command `yarn dev`.
Loading

0 comments on commit ed3c0a9

Please sign in to comment.