소스 검색

refac: prompts

Timothy Jaeryang Baek 5 달 전
부모
커밋
b81cd15ced
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      backend/open_webui/apps/webui/models/prompts.py

+ 2 - 4
backend/open_webui/apps/webui/models/prompts.py

@@ -71,16 +71,14 @@ class PromptsTable:
         prompt = PromptModel(
             **{
                 "user_id": user_id,
-                "command": form_data.command,
-                "title": form_data.title,
-                "content": form_data.content,
+                **form_data.model_dump(),
                 "timestamp": int(time.time()),
             }
         )
 
         try:
             with get_db() as db:
-                result = Prompt(**prompt.dict())
+                result = Prompt(**prompt.model_dump())
                 db.add(result)
                 db.commit()
                 db.refresh(result)