This document provides step-by-step instructions on how to set up and run a Speaking Meeting Bot, which utilizes MeetingBaas's APIs and pipecat's WebsocketServerTransport
to participate in online meetings as a speaking bot. You can also set up multiple instances of the bot to join different meetings simultaneously.
- Python 3.x installed
grpc_tools
for handling gRPC protobuf files- Ngrok for exposing your local server to the internet
- Poetry for managing dependencies
To begin, you need to set up the Python environment using Poetry and install the required dependencies.
# Install Poetry if not already installed
# For Unix/macOS:
curl -sSL https://install.python-poetry.org | python3 -
# For Windows:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
# Install the required dependencies using Poetry
poetry install
# Activate the virtual environment
poetry shell
To enable communication with MeetingBaas's API, you need to compile the frames.proto
file with grpc_tools
.
# Compile the protobuf file
poetry run python -m grpc_tools.protoc --proto_path=./protobufs --python_out=./protobufs frames.proto
You need to provide the necessary credentials for MeetingBaas's API.
# Copy the example environment file
cp env.example .env
Open the .env
file and update it with your MeetingBaas credentials.
Once your setup is complete, follow these steps to run multiple instances of the bot and connect each to an online meeting.
To create two simultaneous bot instances, use the following command to run the parallel script:
poetry run python scripts/parallel.py -c 2
This will initiate two instances of the bot. In this setup, each bot instance will require a unique public URL from ngrok, which we will set up in the next steps.
To allow MeetingBaas to communicate with both bots, you need to expose two local servers on different ngrok URLs. Open terminal to run this command:
ngrok start --all --config ~/.config/ngrok/ngrok.yml,./config/ngrok/config.yml
Each of these URLs can now be used to communicate with the respective bot instance via MeetingBaas.
Now, you need to start meetingbaas
for each bot instance, pointing each one to its unique ngrok URL and meeting session URL. Open two additional terminals and run the following commands:
-
In Terminal 3:
poetry run meetingbaas --url <ngrok-url-instance-1> --meeting-url <meeting-url-1>
Replace
<ngrok-url-instance-1>
with the public URL from ngrok for the first bot and<meeting-url-1>
with the meeting URL for the first session. -
In Terminal 4:
poetry run meetingbaas --url <ngrok-url-instance-2> --meeting-url <meeting-url-2>
Replace
<ngrok-url-instance-2>
with the public URL for the second bot and<meeting-url-2>
with the meeting URL for the second session.
With these commands, each bot instance should now be connected to its respective meeting.
- Ensure that you have activated the Poetry environment before running any Python commands.
- If Ngrok is not running properly, check for any firewall issues that may be blocking its communication.
- Double-check the
.env
file to make sure all necessary credentials are correctly filled in. - Ensure each instance has a unique ngrok URL and meeting session to avoid conflicts.
- MeetingBaas allows integration with external bots using APIs that leverage
WebsocketServerTransport
for real-time communication. - For more details on the MeetingBaas APIs and functionalities, please refer to the official MeetingBaas documentation.
After setting up everything, the bot will actively join the meeting and communicate using the MeetingBaas WebSocket API. You can test different bot behaviors by modifying the meetingbaas.py
script to suit your meeting requirements.
Happy meeting automation!