mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-25 03:23:01 +00:00
WEB API independent
This commit is contained in:
parent
381ba6662a
commit
3ce9d2faf2
@ -8,6 +8,7 @@ duckdb_path = os.getenv("DB_DUCKDB_PATH", default_db_path + "/chat_history.db")
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if os.path.isfile(duckdb_path):
|
if os.path.isfile(duckdb_path):
|
||||||
cursor = duckdb.connect(duckdb_path).cursor()
|
cursor = duckdb.connect(duckdb_path).cursor()
|
||||||
|
# cursor.execute("SELECT * FROM chat_history limit 20")
|
||||||
cursor.execute("SELECT * FROM chat_history limit 20")
|
cursor.execute("SELECT * FROM chat_history limit 20")
|
||||||
data = cursor.fetchall()
|
data = cursor.fetchall()
|
||||||
print(data)
|
print(data)
|
||||||
|
@ -74,15 +74,15 @@ async def dialogue_list(response: Response, user_id: str = None):
|
|||||||
)
|
)
|
||||||
dialogues.append(conv_vo)
|
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]])
|
@router.post("/v1/chat/dialogue/scenes", response_model=Result[List[ChatSceneVo]])
|
||||||
async def dialogue_scenes():
|
async def dialogue_scenes():
|
||||||
scene_vos: List[ChatSceneVo] = []
|
scene_vos: List[ChatSceneVo] = []
|
||||||
new_modes: List[ChatScene] = [
|
new_modes: List[ChatScene] = [
|
||||||
ChatScene.ChatDb,
|
ChatScene.ChatWithDbExecute,
|
||||||
ChatScene.ChatData,
|
ChatScene.ChatWithDbQA,
|
||||||
ChatScene.ChatDashboard,
|
ChatScene.ChatDashboard,
|
||||||
ChatScene.ChatKnowledge,
|
ChatScene.ChatKnowledge,
|
||||||
ChatScene.ChatExecution,
|
ChatScene.ChatExecution,
|
||||||
|
Loading…
Reference in New Issue
Block a user