clarkkent
12/04/2024, 5:04 AMresponse_payload = {
"results": [{"toolCallId": tool_call_id, "result": plain_text_names}]
}
logger.info(
f"Prepared response payload for Vapi: {json.dumps(response_payload, indent=2)}"
)
logger.info("Sending response to Vapi server.")
async with httpx.AsyncClient() as client:
# Include `x-vapi-secret` header for secure communication
response = await client.post(
server_url,
# json={"Status": 200, "Body": response_payload},
headers={"Content-Type": "application/json"},
data=response_payload,
)