Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

refacto: Simplify code

Clémence Lesné68a723bfc2a1
diff --git a/Makefile b/Makefile
index 1a6dea3..bf718af 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,6 @@ post-deploy:
$(MAKE) eventgrid-register \
endpoint=$(app_url) \
- name=$(name) \
source=$(communication_id)
@echo "🚀 Claim AI is running on $(app_url)"
diff --git a/persistence/communication_services.py b/persistence/communication_services.py
index 1cd584f..8cf0388 100644
--- a/persistence/communication_services.py
+++ b/persistence/communication_services.py
@@ -36,7 +36,7 @@ class CommunicationServicesSms(ISms):
responses: list[SmsSendResult] = await client.send(
from_=str(self._config.phone_number),
message=content,
- to=str(phone_number),
+ to=phone_number,
)
response = responses[0]
if response.successful:
@@ -62,7 +62,6 @@ class CommunicationServicesSms(ISms):
credential=self._config.access_key.get_secret_value(),
endpoint=self._config.endpoint,
)
-
try:
yield client
finally:
diff --git a/persistence/twilio.py b/persistence/twilio.py
index aa79132..adbed80 100644
--- a/persistence/twilio.py
+++ b/persistence/twilio.py
@@ -46,7 +46,7 @@ class TwilioSms(ISms):
res = self._client.messages.create(
body=content,
from_=str(self._config.phone_number),
- to=str(phone_number),
+ to=phone_number,
)
# TODO: How to check the delivery status? Seems present in "res.status" but not documented
if res.error_message: