arina-hf-spaces-api / app /core /user_input_handling.py
adsurkasur's picture
clone from arina-hf-spaces
68964c2
raw
history blame contribute delete
496 Bytes
from datetime import datetime, timezone
from app.core.message_saving import save_message
from app.core.logging_setup import logger
def handle_user_input(conversation_id, role, message):
"""Handle user input and save messages."""
timestamp = datetime.now(timezone.utc)
try:
save_message(timestamp, conversation_id, role, message)
logger.info(f"User input handled and saved: {message}")
except Exception as e:
logger.error(f"Error handling user input: {e}")