feat: 增加了用户音频的增删查改

This commit is contained in:
killua committed 2024-05-16 13:28:47 +08:00
1 parent 4322b03418
commit 4a256fa506
6 files changed
+132 -184

No files matched your search

-2
View File
@@ -106,7 +106,6 @@ async def create_chat_handler(chat: ChatCreateRequest, db, redis):
try:
db.add(new_chat)
db.commit()
db.refresh(new_chat)
except Exception as e:
db.rollback()
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
@@ -154,7 +153,6 @@ async def create_chat_handler(chat: ChatCreateRequest, db, redis):
# 将Session记录存入
db.add(new_session)
db.commit()
db.refresh(new_session)
redis.set(session_id, json.dumps(content, ensure_ascii=False))
chat_create_data = ChatCreateData(user_character_id=new_chat.id, session_id=session_id, createdAt=datetime.now().isoformat())