diff --git a/examples/twilio-chatbot/README.md b/examples/twilio-chatbot/README.md index d06fd7f85..9c7a4be95 100644 --- a/examples/twilio-chatbot/README.md +++ b/examples/twilio-chatbot/README.md @@ -110,31 +110,6 @@ To start a call, simply make a call to your configured Twilio phone number. The ## Testing -It is also possible to automatically test the server without making phone calls by using a software client. - -First, update `templates/streams.xml` to point to your server's websocket endpoint. For example: - -``` - - - - - - - -``` - -Then, start the server with `-t` to indicate we are testing: - -```sh -# Make sure you’re in the project directory and your virtual environment is activated -python server.py -t -``` - -Finally, just point the client to the server's URL: - -```sh -python client.py -u http://localhost:8765 -c 2 -``` - -where `-c` allows you to create multiple concurrent clients. +It is also possible to test the server without making phone calls by using one of these clients. +- [python](client/python/README.md): This Python client enables automated testing of the server via WebSocket without the need to make actual phone calls. +- [typescript](client/typescript/README.md): This typescript client enables manual testing of the server via WebSocket without the need to make actual phone calls. \ No newline at end of file diff --git a/examples/twilio-chatbot/client/python/README.md b/examples/twilio-chatbot/client/python/README.md new file mode 100644 index 000000000..18e695382 --- /dev/null +++ b/examples/twilio-chatbot/client/python/README.md @@ -0,0 +1,39 @@ +# Python Client for Server Testing + +This Python client enables automated testing of the server via WebSocket without the need to make actual phone calls. + +## Setup Instructions + +### 1. Configure the Stream Template + +Edit the `templates/streams.xml` file to point to your server’s WebSocket endpoint. For example: + +```xml + + + + + + + +``` + +### 2. Start the Server in Test Mode + +Run the server with the `-t` flag to indicate test mode: + +```sh +# Ensure you're in the project directory and your virtual environment is activated +python server.py -t +``` + +### 3. Run the Client + +Start the client and point it to the server URL: + +```sh +python client.py -u http://localhost:8765 -c 2 +``` + +- `-u`: Server URL (default is `http://localhost:8765`) +- `-c`: Number of concurrent client connections (e.g., 2) diff --git a/examples/twilio-chatbot/client.py b/examples/twilio-chatbot/client/python/client.py similarity index 100% rename from examples/twilio-chatbot/client.py rename to examples/twilio-chatbot/client/python/client.py diff --git a/examples/twilio-chatbot/client/typescript/README.md b/examples/twilio-chatbot/client/typescript/README.md new file mode 100644 index 000000000..a2dd7b05b --- /dev/null +++ b/examples/twilio-chatbot/client/typescript/README.md @@ -0,0 +1,27 @@ +# Typescript Client for Server Testing + +This typescript client enables manual testing of the server via WebSocket without the need to make actual phone calls. + +## Setup + +1. Run the bot server. See the [server README](../../README). + +2. Navigate to the `client/typescript` directory: + +```bash +cd client/typescript +``` + +3. Install dependencies: + +```bash +npm install +``` + +4. Run the client app: + +``` +npm run dev +``` + +5. Visit http://localhost:5173 in your browser. diff --git a/examples/twilio-chatbot/ws_test_client/index.html b/examples/twilio-chatbot/client/typescript/index.html similarity index 100% rename from examples/twilio-chatbot/ws_test_client/index.html rename to examples/twilio-chatbot/client/typescript/index.html diff --git a/examples/twilio-chatbot/ws_test_client/package-lock.json b/examples/twilio-chatbot/client/typescript/package-lock.json similarity index 100% rename from examples/twilio-chatbot/ws_test_client/package-lock.json rename to examples/twilio-chatbot/client/typescript/package-lock.json diff --git a/examples/twilio-chatbot/ws_test_client/package.json b/examples/twilio-chatbot/client/typescript/package.json similarity index 100% rename from examples/twilio-chatbot/ws_test_client/package.json rename to examples/twilio-chatbot/client/typescript/package.json diff --git a/examples/twilio-chatbot/ws_test_client/src/app.ts b/examples/twilio-chatbot/client/typescript/src/app.ts similarity index 100% rename from examples/twilio-chatbot/ws_test_client/src/app.ts rename to examples/twilio-chatbot/client/typescript/src/app.ts diff --git a/examples/twilio-chatbot/ws_test_client/src/style.css b/examples/twilio-chatbot/client/typescript/src/style.css similarity index 100% rename from examples/twilio-chatbot/ws_test_client/src/style.css rename to examples/twilio-chatbot/client/typescript/src/style.css diff --git a/examples/twilio-chatbot/ws_test_client/tsconfig.json b/examples/twilio-chatbot/client/typescript/tsconfig.json similarity index 100% rename from examples/twilio-chatbot/ws_test_client/tsconfig.json rename to examples/twilio-chatbot/client/typescript/tsconfig.json diff --git a/examples/twilio-chatbot/ws_test_client/vite.config.js b/examples/twilio-chatbot/client/typescript/vite.config.js similarity index 100% rename from examples/twilio-chatbot/ws_test_client/vite.config.js rename to examples/twilio-chatbot/client/typescript/vite.config.js diff --git a/examples/twilio-chatbot/ws_test_client/README.md b/examples/twilio-chatbot/ws_test_client/README.md deleted file mode 100644 index 753c6d563..000000000 --- a/examples/twilio-chatbot/ws_test_client/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# JavaScript Implementation - -Basic implementation using the [Pipecat JavaScript SDK](https://docs.pipecat.ai/client/js/introduction). - -## Setup - -1. Run the bot server. See the [server README](../README). - -2. Navigate to the `client/javascript` directory: - -```bash -cd client/javascript -``` - -3. Install dependencies: - -```bash -npm install -``` - -4. Run the client app: - -``` -npm run dev -``` - -5. Visit http://localhost:5173 in your browser.