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

Function save_chart_answer

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

Source from the content-addressed store, hash-verified

1029
1030
1031def 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
1048def save_chart(session: SessionDep, record_id: int, chart: str) -> ChatRecord:

Callers 1

generate_chartMethod · 0.90

Calls 3

get_chat_record_by_idFunction · 0.85
updateFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected