Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
fix: Fine-tune prompts, using "customer" instead of "user"
Clémence Lesné2b8ba8031758
diff --git a/helpers/config_models/prompts.py b/helpers/config_models/prompts.pyindex d14330e..fb6ef6f 100644--- a/helpers/config_models/prompts.py+++ b/helpers/config_models/prompts.py@@ -102,26 +102,26 @@ class LlmModel(BaseModel):style=[style] [content]## Example 1- User: I live in Paris PARIS, I was driving a Ford Focus, I had an accident yesterday.- Acion: update indicent location, update vehicule reference, update incident date+ User: action=talk I live in Paris PARIS, I was driving a Ford Focus, I had an accident yesterday.+ Tools: update indicent location, update vehicule reference, update incident dateAssistant: style=sad I understand your car has been in an accident. style=none I have updated your file. Could I have the license plate number of your car? Also, were there any injuries?## Example 2- User: The roof has had holes since yesterday's big storm. They're about the size of golf balls. I'm worried about water damage.- Acion: update incident description, create a reminder for assistant to plan an appointment with a roofer+ User: action=talk The roof has had holes since yesterday's big storm. They're about the size of golf balls. I'm worried about water damage.+ Tools: update incident description, create a reminder for assistant to plan an appointment with a rooferAssistant: style=sad I understand your roof has holes since the big storm yesterday. style=none I have created a reminder to plan an appointment with a roofer. style=cheerful I hope you are safe and sound.## Example 3- User: Thank you verry much for your help. See you tomorrow for the appointment.- Action: end call+ User: action=talk Thank you verry much for your help. See you tomorrow for the appointment.+ Tools: end call## Example 4- User: The doctor who was supposed to come to the house didn't show up yesterday.- Action: create a reminder for assistant to call the doctor to reschedule the appointment, create a reminder for assistant to call the customer in two days to check if the doctor came+ User: action=talk The doctor who was supposed to come to the house didn't show up yesterday.+ Tools: create a reminder for assistant to call the doctor to reschedule the appointment, create a reminder for assistant to call the customer in two days to check if the doctor cameAssistant: style=sad I understand the doctor did not come to your home yesterday. style=none I have created a reminder to call the doctor to reschedule the appointment. I have created a reminder to call you in two days to check if the doctor came.## Example 5- User: call+ User: action=callAssistant: style=none Hello, we talked yesterday about the car accident you had in Paris. We planned an appointment with the garage for tomorrow. What can I do for you today?"""sms_summary_system_tpl: str = """diff --git a/helpers/llm_plugins.py b/helpers/llm_plugins.pyindex d7c0791..21092bc 100644--- a/helpers/llm_plugins.py+++ b/helpers/llm_plugins.py@@ -49,7 +49,7 @@ class LlmPlugins:async def end_call(self) -> str:"""- Use this if the user said they want to end the call. This will hang up the call. Example: 'I want to hang up', 'Goodbye, see you tomorrow'.+ Use this if the customer said they want to end the call. Requires an explicit verbal validation from the customer. This will hang up the call. Example: 'I want to hang up', 'Goodbye, see you tomorrow'."""await self.cancellation_callback()await handle_play(@@ -68,7 +68,7 @@ class LlmPlugins:],) -> str:"""- Use this if the user 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'.+ 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)@@ -85,7 +85,7 @@ class LlmPlugins:self,customer_response: Annotated[str,- "Contextual description of the reminder. Should be detailed enough to be understood by anyone. Example: 'Watch model is Rolex Submariner 116610LN', 'User said the witnesses car was red but the police report says it was blue. Double check with the involved parties'.",+ "Contextual description of the reminder. Should be detailed enough to be understood by anyone. Example: 'Watch model is Rolex Submariner 116610LN', 'Customer said the witnesses car was red but the police report says it was blue. Double check with the involved parties'.",],description: Annotated[str,@@ -146,7 +146,7 @@ class LlmPlugins:],) -> str:"""- Use this if the user wants to update a claim field with a new value. Example: 'Update claim explanation to: I was driving on the highway when a car hit me from behind', 'Update contact contact info to: 123 rue de la paix 75000 Paris, +33735119775, only call after 6pm'.+ Use this if the customer wants to update a claim field with a new value. Example: 'Update claim explanation to: I was driving on the highway when a car hit me from behind', 'Update contact contact info to: 123 rue de la paix 75000 Paris, +33735119775, only call after 6pm'."""await self.user_callback(customer_response, self.style)@@ -164,7 +164,7 @@ class LlmPlugins:async def talk_to_human(self) -> str:"""- Use this if the user wants to talk to a human and Assistant is unable to help. This will transfer the customer to an human agent. Approval from the customer must be explicitely given. Never use this action directly after a recall. Example: 'I want to talk to a human', 'I want to talk to a real person'.+ Use this if the customer wants to talk to a human and Assistant is unable to help. Requires an explicit verbal validation from the customer. This will transfer the customer to an human agent. Example: 'I want to talk to a human', 'I want to talk to a real person'."""await self.cancellation_callback()await handle_play(@@ -187,7 +187,7 @@ class LlmPlugins:],) -> str:"""- Use this if the user wants to search for a public specific information you don't have. Example: contract, law, regulation, article, etc.+ Use this if the customer wants to search for a public specific information you don't have. Example: contract, law, regulation, article, etc."""await self.user_callback(customer_response, self.style)