TL;DR
- Add
guava-sdkto your Heroku app. - Create an API Key on the Guava Dashboard.
- Use the Heroku dashboard or CLI to add the key to your environment.
- Add the following to your Procfile:
guava-worker: python agent.py(or whichever file is your agent’s entrypoint). - Push your code and scale the new worker type.
Add guava-sdk as a dependency
Add the Python package guava-sdk as a dependency using the package manager of your choice.
Add a Guava API Key to the Heroku Environment
Open the API Keys page in the Guava dashboard and click Create API Key. The key should be of the formgva-....
Next, add this key to your Heroku environment, either using the CLI or the Heroku dashboard.
Define your agent
Define your agent. In this example we’ll create it in a fileagent.py, but you can use anything. Note the entrypoint agent.listen_phone(...) at the bottom - this method attaches your agent to the phone number and does not exit.
agent.py
Add the worker to your Procfile
Add the following section to your Procfile. This will create a new dyno type called “guava-worker”.Push to Heroku
Commit and push your code to Heroku to trigger a deploy.Scale the Guava worker up
Scale the newly added worker dyno.Call your agent
Now, you should be able to call your agent. You can useheroku logs to check logs for your dynos.