mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix: fixed empty body response issue
This commit is contained in:
parent
c4d3c09b86
commit
c14c1fac75
@ -97,20 +97,17 @@ class KnowledgeForm(BaseModel):
|
|||||||
description: str
|
description: str
|
||||||
data: Optional[dict] = None
|
data: Optional[dict] = None
|
||||||
access_control: Optional[dict] = None
|
access_control: Optional[dict] = None
|
||||||
|
|
||||||
|
|
||||||
class RAGConfigForm(BaseModel):
|
|
||||||
rag_config: Optional[dict] = None
|
rag_config: Optional[dict] = None
|
||||||
|
|
||||||
|
|
||||||
class KnowledgeTable:
|
class KnowledgeTable:
|
||||||
def insert_new_knowledge(
|
def insert_new_knowledge(
|
||||||
self, user_id: str, form_data: KnowledgeForm, rag_data: RAGConfigForm
|
self, user_id: str, form_data: KnowledgeForm
|
||||||
) -> Optional[KnowledgeModel]:
|
) -> Optional[KnowledgeModel]:
|
||||||
with get_db() as db:
|
with get_db() as db:
|
||||||
knowledge_data = {
|
knowledge_data = {
|
||||||
**form_data.model_dump(),
|
**form_data.model_dump(),
|
||||||
"data": {"rag_config": rag_data.rag_config},
|
"data": {"rag_config": form_data.rag_config},
|
||||||
"id": str(uuid.uuid4()),
|
"id": str(uuid.uuid4()),
|
||||||
"user_id": user_id,
|
"user_id": user_id,
|
||||||
"created_at": int(time.time()),
|
"created_at": int(time.time()),
|
||||||
|
Loading…
Reference in New Issue
Block a user