(session: SessionDep, log: ChatLog)
| 873 | |
| 874 | |
| 875 | def trigger_log_error(session: SessionDep, log: ChatLog) -> ChatLog: |
| 876 | log.error = True |
| 877 | stmt = update(ChatLog).where(and_(ChatLog.id == log.id)).values( |
| 878 | error=True |
| 879 | ) |
| 880 | session.execute(stmt) |
| 881 | session.commit() |
| 882 | |
| 883 | return log |
| 884 | |
| 885 | |
| 886 | def save_sql_answer(session: SessionDep, record_id: int, answer: str) -> ChatRecord: |