From b81cd15cedbe76c6ffc0b83ca1ebfb3fe3a64e14 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 16 Nov 2024 20:52:57 -0800 Subject: [PATCH] refac: prompts --- backend/open_webui/apps/webui/models/prompts.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/apps/webui/models/prompts.py b/backend/open_webui/apps/webui/models/prompts.py index 248f6a09f..ea4a229f7 100644 --- a/backend/open_webui/apps/webui/models/prompts.py +++ b/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)