diff --git a/pilot/connections/rdbms/py_study/test_duckdb.py b/pilot/connections/rdbms/py_study/test_duckdb.py index dbcf2ecb7..dc3f926ac 100644 --- a/pilot/connections/rdbms/py_study/test_duckdb.py +++ b/pilot/connections/rdbms/py_study/test_duckdb.py @@ -8,6 +8,7 @@ duckdb_path = os.getenv("DB_DUCKDB_PATH", default_db_path + "/chat_history.db") if __name__ == "__main__": if os.path.isfile(duckdb_path): cursor = duckdb.connect(duckdb_path).cursor() + # cursor.execute("SELECT * FROM chat_history limit 20") cursor.execute("SELECT * FROM chat_history limit 20") data = cursor.fetchall() print(data) diff --git a/pilot/openapi/api_v1/api_v1.py b/pilot/openapi/api_v1/api_v1.py index 8d71ebdea..4f2e23946 100644 --- a/pilot/openapi/api_v1/api_v1.py +++ b/pilot/openapi/api_v1/api_v1.py @@ -74,15 +74,15 @@ async def dialogue_list(response: Response, user_id: str = None): ) dialogues.append(conv_vo) - return Result[ConversationVo].succ(dialogues) + return Result[ConversationVo].succ(dialogues[-10:][::-1]) @router.post("/v1/chat/dialogue/scenes", response_model=Result[List[ChatSceneVo]]) async def dialogue_scenes(): scene_vos: List[ChatSceneVo] = [] new_modes: List[ChatScene] = [ - ChatScene.ChatDb, - ChatScene.ChatData, + ChatScene.ChatWithDbExecute, + ChatScene.ChatWithDbQA, ChatScene.ChatDashboard, ChatScene.ChatKnowledge, ChatScene.ChatExecution,