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

Function list_generate_chart_logs

backend/apps/chat/curd/chat.py:688–698  ·  view source on GitHub ↗
(session: SessionDep, chart_id: int)

Source from the content-addressed store, hash-verified

686
687
688def list_generate_chart_logs(session: SessionDep, chart_id: int) -> List[ChatLog]:
689 stmt = select(ChatLog).where(
690 and_(ChatLog.pid.in_(select(ChatRecord.id).where(and_(ChatRecord.chat_id == chart_id))),
691 ChatLog.type == TypeEnum.CHAT, ChatLog.operate == OperationEnum.GENERATE_CHART)).order_by(
692 ChatLog.start_time)
693 result = session.execute(stmt).all()
694 _list = []
695 for row in result:
696 for r in row:
697 _list.append(ChatLog(**r.model_dump()))
698 return _list
699
700
701def create_chat(session: SessionDep, current_user: CurrentUser, create_chat_obj: CreateChat,

Callers 1

__init__Method · 0.90

Calls 2

ChatLogClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected