Update utils/helper.py
Browse files- utils/helper.py +18 -0
utils/helper.py
CHANGED
|
@@ -22,3 +22,21 @@ class ChatBot:
|
|
| 22 |
|
| 23 |
def get_history(self) -> list:
|
| 24 |
return self.history
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
def get_history(self) -> list:
|
| 24 |
return self.history
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
from twilio.rest import Client
|
| 28 |
+
|
| 29 |
+
# Your Twilio account SID and auth token
|
| 30 |
+
account_sid = os.environ["YOUR_TWILIO_ACCOUNT_SID"]
|
| 31 |
+
auth_token = os.environ["YOUR_TWILIO_AUTH_TOKEN"]
|
| 32 |
+
|
| 33 |
+
twilio_client = Client(account_sid, auth_token)
|
| 34 |
+
|
| 35 |
+
def invoke_twilio_api(prompt: str):
|
| 36 |
+
message = twilio_client.messages.create(
|
| 37 |
+
body = prompt,
|
| 38 |
+
from_ = "+18552060350", # From
|
| 39 |
+
to = '+15859538396' # To
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
return message.sid
|