Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram Bot and Coqui Improvments #144

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/telegram_bot/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENAI_API_KEY=
TELEGRAM_BOT_KEY=
COQUI_API_KEY=
18 changes: 18 additions & 0 deletions apps/telegram_bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.11

# get portaudio and ffmpeg
RUN apt-get update \
&& apt-get install libportaudio2 libportaudiocpp0 portaudio19-dev libasound-dev libsndfile1-dev -y
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y ffmpeg

WORKDIR /code
COPY ./pyproject.toml /code/pyproject.toml
COPY ./poetry.lock /code/poetry.lock
RUN pip install --no-cache-dir --upgrade poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-dev --no-interaction --no-ansi
COPY main.py /code/main.py

CMD ["python", "main.py"]
36 changes: 36 additions & 0 deletions apps/telegram_bot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# client_backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, there are some references to client backend/vocode react sdk

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


## Docker

1. Set up the configuration for your telegram bot in `main.py`.
2. Set up an .env file using the template
3. Create a Telegram Bot token and link using The Bot Father: https://t.me/botfather

```
cp .env.template .env
```

Fill in your API keys into .env

3. Build the Docker image

```bash
docker build -t vocode-telegram-bot .
```

4. Run the image and forward the port.

```bash
docker run --env-file=.env -p 3000:3000 -t vocode-telegram-bot
```

Now you have a telegram bot running. Visit the link you chose during the Telegram bot creation process
.
## Non-docker setup

`main.py` is just a simple python script, so you can run it with:

```
poetry install
poetry run python main.py
```
Loading