MCPcopy Index your code
hub / github.com/dataease/SQLBot / save_predict_answer

Function save_predict_answer

backend/apps/chat/curd/chat.py:920–934  ·  view source on GitHub ↗
(session: SessionDep, record_id: int, answer: str)

Source from the content-addressed store, hash-verified

918
919
920def save_predict_answer(session: SessionDep, record_id: int, answer: str) -> ChatRecord:
921 if not record_id:
922 raise Exception("Record id cannot be None")
923
924 stmt = update(ChatRecord).where(and_(ChatRecord.id == record_id)).values(
925 predict=answer,
926 )
927
928 session.execute(stmt)
929
930 session.commit()
931
932 record = get_chat_record_by_id(session, record_id)
933
934 return record
935
936
937def save_select_datasource_answer(session: SessionDep, record_id: int, answer: str,

Callers 1

generate_predictMethod · 0.90

Calls 3

get_chat_record_by_idFunction · 0.85
updateFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected