Skip to content

Commit

Permalink
move docs to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
ajar98 committed Aug 5, 2023
1 parent be2a19a commit c41c39d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
15 changes: 5 additions & 10 deletions docs/langchain-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ appropriate call.

1. Install [Ngrok](https://ngrok.com/)
2. Install [Redis](https://redis.com/)
3. Install [Poetry](https://python-poetry.org/)

## Run the example

Expand Down Expand Up @@ -100,7 +101,7 @@ source venv/bin/activate
2. Install requirements

```bash
pip install -r requirements.txt
poetry install
```

3. Run an instance of Redis at http://localhost:6379. With Docker, this can be done with:
Expand All @@ -125,17 +126,11 @@ With the self-hosted telephony server running:
CONTACTS = [{"name": "Kian", "phone": "+123456789"}]
```

2. Install `python-dotenv` to use the environment variables we set up earlier.

```
pip3 install python-dotenv
```

3. Run `main.py`
2. Run `main.py`

```bash
pip3 install -r requirements.txt
python3 main.py
poetry install
poetry run python main.py
```

# Code explanation
Expand Down
17 changes: 5 additions & 12 deletions docs/telephony.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ docker-compose up

Run the following steps from the `telephony_app` directory.

1. Create a Python environment (we recommend using `virtualenv` by running `python3 -m venv venv`) and install dependencies via `pip`
1. Install [Poetry](https://python-poetry.org/) and install dependencies.

```
pip install -r requirements.txt
poetry install
```

2. Run Redis with the default port of 6379.
Expand All @@ -102,7 +102,7 @@ docker run -dp 6379:6379 -it redis/redis-stack:latest
3. Run the server with `uvicorn` (should be already installed in step 1).

```
uvicorn main:app --port 3000
poetry run uvicorn main:app --port 3000
```

### Setting up an inbound number
Expand All @@ -120,18 +120,11 @@ uvicorn main:app --port 3000

Make sure the server we just set up is already running. Then, in `outbound_call.py`

1. Replace the `to_phone` with the number you want to call and the `from_phone` with the number you want to call from.
In order to make a call from the `from_phone`, you must have access to it via Twilio (either a number purchased via Twilio or verify the caller ID).
Replace the `to_phone` with the number you want to call and the `from_phone` with the number you want to call from. In order to make a call from the `from_phone`, you must have access to it via Twilio (either a number purchased via Twilio or verify the caller ID).

> Note: To ensure legal compliance with robocall regulations in California, the following code snippet from the [Vocode library](https://github.com/vocodedev/vocode-python/blob/main/vocode/streaming/telephony/conversation/outbound_call.py#L83-L96) utilizes Twilio Line Intelligence to check if calls are made to mobile phones: For Canadian phone numbers, the Twilio Lookup API may not return carrier data due to the Canadian Local Number Portability Consortium (CLNPC) requirements. More information on this issue can be found in the [Twilio Support Article](https://support.twilio.com/hc/en-us/articles/360004563433-Twilio-Lookup-API-is-Not-Returning-Carrier-Data-for-Canadian-Phone-Numbers).
2. Install `python-dotenv` to use the environment variables we set up earlier.

```
pip3 install python-dotenv
```

Run the script with `python3 outbound_call.py`.
Run the script with `poetry run python outbound_call.py`.

### Configuration

Expand Down

0 comments on commit c41c39d

Please sign in to comment.