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

dev: Enhance chat logging

Clémence Lesnée8c9866efc7c
diff --git a/app/helpers/call_llm.py b/app/helpers/call_llm.py
index 856a4d7..2598cc6 100644
--- a/app/helpers/call_llm.py
+++ b/app/helpers/call_llm.py
@@ -510,8 +510,8 @@ async def _execute_llm_chat( # noqa: PLR0913, PLR0911, PLR0912, PLR0915
remove_message_action(content_full)
)
- logger.debug("Chat response: %s", content_full)
- logger.debug("Tool calls: %s", tool_calls)
+ logger.debug("Completion response: %s", content_full)
+ logger.debug("Completion tools: %s", tool_calls)
# OpenAI GPT-4 Turbo sometimes return wrong tools schema, in that case, retry within limits
# TODO: Tries to detect this error earlier
diff --git a/app/helpers/call_utils.py b/app/helpers/call_utils.py
index 26dc4e3..1bb8511 100644
--- a/app/helpers/call_utils.py
+++ b/app/helpers/call_utils.py
@@ -259,6 +259,7 @@ async def handle_realtime_tts( # noqa: PLR0913
# Play each chunk
chunks = _chunk_for_tts(text)
for chunk in chunks:
+ logger.info("Playing TTS: %s", text)
tts_client.speak_ssml_async(
_ssml_from_text(
call=call,