浏览代码

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)