mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
refac: prompts
This commit is contained in:
parent
41bad9abcb
commit
b81cd15ced
1 changed files with 2 additions and 4 deletions
|
|
@ -71,16 +71,14 @@ class PromptsTable:
|
||||||
prompt = PromptModel(
|
prompt = PromptModel(
|
||||||
**{
|
**{
|
||||||
"user_id": user_id,
|
"user_id": user_id,
|
||||||
"command": form_data.command,
|
**form_data.model_dump(),
|
||||||
"title": form_data.title,
|
|
||||||
"content": form_data.content,
|
|
||||||
"timestamp": int(time.time()),
|
"timestamp": int(time.time()),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with get_db() as db:
|
with get_db() as db:
|
||||||
result = Prompt(**prompt.dict())
|
result = Prompt(**prompt.model_dump())
|
||||||
db.add(result)
|
db.add(result)
|
||||||
db.commit()
|
db.commit()
|
||||||
db.refresh(result)
|
db.refresh(result)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue