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

Function find_base_question

backend/apps/chat/api/chat.py:257–267  ·  view source on GitHub ↗
(record_id: int, session: SessionDep)

Source from the content-addressed store, hash-verified

255
256
257def find_base_question(record_id: int, session: SessionDep):
258 stmt = select(ChatRecord.question, ChatRecord.regenerate_record_id).where(
259 and_(ChatRecord.id == record_id))
260 _record = session.execute(stmt).fetchone()
261 if not _record:
262 raise Exception(f'Cannot find base chat record')
263 rec_question, rec_regenerate_record_id = _record
264 if rec_regenerate_record_id:
265 return find_base_question(rec_regenerate_record_id, session)
266 else:
267 return rec_question
268
269
270@router.post("/question", summary=f"{PLACEHOLDER_PREFIX}ask_question")

Callers 1

question_answer_innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected