Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
dev: Add a step to watch claim update in real time
Clémence Lesné664e6c3f9b09
diff --git a/Makefile b/Makefileindex 4345533..009733d 100644--- a/Makefile+++ b/Makefile@@ -129,3 +129,11 @@ eventgrid-register:--max-delivery-attempts 8 \--name $(name) \--source-resource-id $(source)++watch-call:+ @echo "👀 Watching status of $(phone_number)..."+ while true; do \+ clear; \+ curl -s "$(endpoint)/call?phone_number=%2B$(phone_number)" | yq --prettyPrint '.[0] | {"phone_number": .phone_number, "claim": .claim, "reminders": .reminders}'; \+ sleep 3; \+ donediff --git a/main.py b/main.pyindex ddd6c74..dd7ed95 100644--- a/main.py+++ b/main.py@@ -426,12 +426,16 @@ async def intelligence(call: CallModel, client: CallConnectionClient) -> None:IndentAction.UPDATED_CLAIM,IndentAction.NEW_OR_UPDATED_REMINDER,):+ # Save in DB allowing demos to be more "real-time"+ await save_call(call)+ # Answer with intermediate responseawait handle_play(call=call,client=client,store=False,text=chat_res.content,)+ # Recursively call intelligence to continue the conversationawait intelligence(call, client)else: