WIP: fixed order of commands, still debugging

This commit is contained in:
2025-05-04 01:02:40 +01:00
parent afeaeba313
commit dcef90d11f

View File

@@ -90,12 +90,12 @@ async def main() -> None:
resp = await http.post(f"{AI_HANDLER_URL}/api/v1/message", json=payload, headers=headers)
resp.raise_for_status()
data = resp.json()
if data.get("reply"):
client.send_message(event["room_id"], data["reply"])
except httpx.HTTPStatusError as e:
logger.error(f"HTTP error: {e.response.status_code} - {e.response.text}")
except Exception:
logger.exception("Error while calling AI handler")
if data.get("reply"):
client.send_message(event["room_id"], data["reply"])
# --- Initialize the client ---
# Create the data directory if it doesn't exist