Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
quality: Add comments and harmonize spaces between func groups
Clémence Lesné4298507527a4
diff --git a/helpers/llm_tools.py b/helpers/llm_tools.pyindex c6917e2..7e9beaa 100644--- a/helpers/llm_tools.py+++ b/helpers/llm_tools.py@@ -64,13 +64,12 @@ class LlmPlugins:Use this if the customer wants to create a new claim for a totally different subject. This will reset the claim and reminder data. Old is stored but not accessible anymore. Approval from the customer must be explicitely given. Example: 'I want to create a new claim'."""await self.user_callback(customer_response, self.style)-+ # Launch post-call intelligence for the current callself.post_call_intelligence(self.call)-+ # Store the last message and use it at first message of the new claimlast_message = self.call.messages[-1]call = CallModel(phone_number=self.call.phone_number)call.messages.append(last_message)-return "Claim, reminders and messages reset"async def new_or_updated_reminder(@@ -101,6 +100,7 @@ class LlmPlugins:"""await self.user_callback(customer_response, self.style)+ # Check if reminder already exists, if so update itfor reminder in self.call.reminders:if reminder.title == title:try:@@ -111,6 +111,7 @@ class LlmPlugins:except ValidationError as e: # Catch errorreturn f'Failed to edit reminder "{title}": {e.json()}'+ # Create new remindertry:reminder = ReminderModel(description=description,@@ -182,19 +183,16 @@ class LlmPlugins:Use this if the customer wants to search for a public specific information you don't have. Examples: contract, law, regulation, article."""await self.user_callback(customer_response, self.style)-# Execute in paralleltasks = await asyncio.gather(*[_search.training_asearch_all(query, self.call) for query in queries])# Flatten, remove duplicates, and sort by scoretrainings = sorted(set(training for task in tasks for training in task or []))-# Format resultsres = "# Search results"for training in trainings:res += f"\n- {training.title}: {training.content}"-return resasync def notify_emergencies(