(session: SessionDep, record_id: int, answer: str)
| 1029 | |
| 1030 | |
| 1031 | def save_chart_answer(session: SessionDep, record_id: int, answer: str) -> ChatRecord: |
| 1032 | if not record_id: |
| 1033 | raise Exception("Record id cannot be None") |
| 1034 | |
| 1035 | stmt = update(ChatRecord).where(and_(ChatRecord.id == record_id)).values( |
| 1036 | chart_answer=answer, |
| 1037 | ) |
| 1038 | |
| 1039 | session.execute(stmt) |
| 1040 | |
| 1041 | session.commit() |
| 1042 | |
| 1043 | record = get_chat_record_by_id(session, record_id) |
| 1044 | |
| 1045 | return record |
| 1046 | |
| 1047 | |
| 1048 | def save_chart(session: SessionDep, record_id: int, chart: str) -> ChatRecord: |
no test coverage detected