Skip to content

Commit

Permalink
update settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tommylees112 committed Sep 13, 2024
1 parent 2964dc9 commit aed2262
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This project is a WhatsApp chatbot that uses the Cohere Command R+ model to summ
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
COHERE_API_KEY=your_cohere_api_key
```

4. Run the FastAPI server locally:
Expand Down Expand Up @@ -74,6 +74,14 @@ gh secret set TWILIO_AUTH_TOKEN --body "KEY_GOES_HERE"
gh secret set TWILIO_PHONE_NUMBER --body "KEY_GOES_HERE"
```

Add secret variables to the [google Secret Manager](https://console.cloud.google.com/security/secret-manager?referrer=search&hl=en&project=whatsappllm) and read from [`deploy.yml`](https://stackoverflow.com/questions/65857870/how-to-use-a-google-secret-in-a-deployed-cloud-run-service-managed).
```bash
gcloud secrets create COHERE_API_KEY --data-file=.env
gcloud secrets create TWILIO_ACCOUNT_SID --data-file=.env
gcloud secrets create TWILIO_AUTH_TOKEN --data-file=.env
gcloud secrets create TWILIO_PHONE_NUMBER --data-file=.env
```

# See all info about the app
```bash
gcloud run services describe $APP --region $REGION
Expand All @@ -87,7 +95,6 @@ gcloud run services update my-service \
--update-env-vars=MY_VAR=my_value,ANOTHER_VAR=another_value
```


## Monitoring

- [Twilio Whatsapp Senders](https://console.twilio.com/us1/develop/sms/senders/whatsapp-senders/XE2357b321ff41b31f05ca6b44fd626c5d)
Expand Down
2 changes: 2 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@


class Settings:
DEBUG: Optional[bool] = os.getenv("DEBUG", "False").lower() == "true"
TWILIO_ACCOUNT_SID: Optional[str] = os.environ.get("TWILIO_ACCOUNT_SID")
TWILIO_AUTH_TOKEN: Optional[str] = os.environ.get("TWILIO_AUTH_TOKEN")
TWILIO_PHONE_NUMBER: Optional[str] = os.environ.get("TWILIO_PHONE_NUMBER")
COHERE_API_KEY: Optional[str] = os.environ.get("COHERE_API_KEY")

def model_dump(self):
return {
"DEBUG": self.DEBUG,
"TWILIO_ACCOUNT_SID": self.TWILIO_ACCOUNT_SID,
"TWILIO_AUTH_TOKEN": self.TWILIO_AUTH_TOKEN,
"TWILIO_PHONE_NUMBER": self.TWILIO_PHONE_NUMBER,
Expand Down

0 comments on commit aed2262

Please sign in to comment.