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

security: Translate "state" to "get" model Thus excluding, as intended, the properties not expected to be public.

Clémence Lesnébffa93e43d80
diff --git a/function_app.py b/function_app.py
index da340ba..15d31b4 100644
--- a/function_app.py
+++ b/function_app.py
@@ -350,7 +350,7 @@ async def call_phone_number_get(req: func.HttpRequest) -> func.HttpResponse:
status_code=HTTPStatus.NOT_FOUND,
)
return func.HttpResponse(
- body=CallGetModel.model_validate(call).model_dump_json(exclude_none=True),
+ body=TypeAdapter(CallGetModel).dump_json(call),
mimetype="application/json",
status_code=HTTPStatus.OK,
)
@@ -382,7 +382,7 @@ async def call_id_get(req: func.HttpRequest) -> func.HttpResponse:
status_code=HTTPStatus.NOT_FOUND,
)
return func.HttpResponse(
- body=CallGetModel.model_validate(call).model_dump_json(exclude_none=True),
+ body=TypeAdapter(CallGetModel).dump_json(call),
mimetype="application/json",
status_code=HTTPStatus.OK,
)
@@ -424,7 +424,7 @@ async def call_post(req: func.HttpRequest) -> func.HttpResponse:
call_connection_properties.call_connection_id,
)
return func.HttpResponse(
- body=CallGetModel.model_validate(call).model_dump_json(exclude_none=True),
+ body=TypeAdapter(CallGetModel).dump_json(call),
mimetype="application/json",
status_code=HTTPStatus.CREATED,
)