MCPcopy Create free account
hub / github.com/dataease/SQLBot / get_old_questions

Function get_old_questions

backend/apps/chat/curd/chat.py:1162–1173  ·  view source on GitHub ↗
(session: SessionDep, datasource: int)

Source from the content-addressed store, hash-verified

1160
1161
1162def get_old_questions(session: SessionDep, datasource: int):
1163 records = []
1164 if not datasource:
1165 return records
1166 stmt = select(ChatRecord.question).where(
1167 and_(ChatRecord.datasource == datasource, ChatRecord.question.isnot(None),
1168 ChatRecord.error.is_(None))).order_by(
1169 ChatRecord.create_time.desc()).limit(20)
1170 result = session.execute(stmt)
1171 for r in result:
1172 records.append(r.question)
1173 return records

Callers 1

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected