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

ux: Enhance next action display

Clémence Lesné0f9a7fb4c2d5
diff --git a/main.py b/main.py
index d0f4ad8..edf81a4 100644
--- a/main.py
+++ b/main.py
@@ -31,6 +31,7 @@ from helpers.config_models.database import Mode as DatabaseMode
from jinja2 import Environment, FileSystemLoader, select_autoescape
from models.action import ActionModel, Indent as IndentAction
from models.call import CallModel
+from models.next import Action as NextAction
from models.next import NextModel
from models.reminder import ReminderModel
from models.synthesis import SynthesisModel
@@ -179,6 +180,7 @@ async def report_call_get(phone_number: str, call_id: UUID) -> HTMLResponse:
bot_company=CONFIG.workflow.bot_company,
bot_name=CONFIG.workflow.bot_name,
call=call,
+ next_actions=[action for action in NextAction],
version=CONFIG.version,
)
return HTMLResponse(content=render)
diff --git a/models/next.py b/models/next.py
index e12e0f5..d305f1d 100644
--- a/models/next.py
+++ b/models/next.py
@@ -5,8 +5,10 @@ from pydantic import BaseModel
class Action(str, Enum):
CASE_CLOSED = "case_closed"
COMMERCIAL_OFFER = "commercial_offer"
- IN_DEPTH_STUDY = "in_depth_study"
+ CUSTOMER_WILL_SEND_INFO = "customer_will_send_info"
+ HIGH_PRIORITY = "high_priority"
PROPOSE_NEW_CONTRACT = "propose_new_contract"
+ REQUIRES_EXPERTISE = "requires_expertise"
class NextModel(BaseModel):
diff --git a/public_website/report.html.jinja b/public_website/report.html.jinja
index aebc5a9..3acf859 100644
--- a/public_website/report.html.jinja
+++ b/public_website/report.html.jinja
@@ -113,17 +113,30 @@ Déclaration de sinistre {{ call.claim.claim_id }}
{% endif %}
</div>
- <!-- Reminders -->
- <div class="rounded-md lg:ring-1 ring-neutral-200/60 dark:ring-neutral-700/60 p-4">
- <h2 class="text-lg pb-4">⏭️ Prochaine action</h2>
+ <!-- Next actions -->
+ <div class="rounded-md lg:ring-1 ring-neutral-200/60 dark:ring-neutral-700/60 p-4 space-y-4">
+ <h2 class="text-lg">📥 Prochaine action</h2>
{% if not call.next %}
<p class="text-neutral-600 dark:text-neutral-400">Aucune prochaine action pour l'instant.</p>
{% else %}
- <p>
- {{ call.next.action.value | replace("_", " " ) | capitalize }}.&nbsp;<span class="text-neutral-600 dark:text-neutral-400">{{ call.next.justification }}</span>
- </p>
+ <ul>
+ {% for action in next_actions | sort %}
+ {% if action.value == call.next.action.value %}
+ <li>
+ {{ action.value | replace("_", " " ) | capitalize }}
+ </li>
+ {% else %}
+ <li class="text-xs text-neutral-600 dark:text-neutral-400">
+ {{ action.value | replace("_", " " ) | capitalize }}
+ </li>
+ {% endif %}
+ {% endfor %}
+ </ul>
{% endif %}
+ <p class="text-neutral-600 dark:text-neutral-400">
+ {{ call.next.justification }}
+ </p>
</div>
<!-- Details -->