Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
perf: Limit cache for phone number, ease RAM
Clémence Lesnéa54f031459b8
diff --git a/helpers/pydantic_types/phone_numbers.py b/helpers/pydantic_types/phone_numbers.pyindex fb2508c..5d7cb3b 100644--- a/helpers/pydantic_types/phone_numbers.py+++ b/helpers/pydantic_types/phone_numbers.py@@ -1,5 +1,5 @@from datetime import tzinfo-from functools import cache+from functools import lru_cachefrom pydantic_extra_types.phone_numbers import PhoneNumber as PydanticPhoneNumberfrom pytz import country_timezones, timezone, utcimport phonenumbers@@ -8,7 +8,7 @@ import phonenumbersclass PhoneNumber(PydanticPhoneNumber):phone_format = "E164" # E164 is standard accross all Microsoft services- @cache # TODO: Is it necessary to cache this?+ @lru_cache # Cache results in memory as func is executed many times on the same contentdef tz(self: PydanticPhoneNumber) -> tzinfo:"""Return timezone of a phone number.