Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: fix missing id and message_id (#31008)

wangxiaolei1dd89a02ea54
diff --git a/api/fields/message_fields.py b/api/fields/message_fields.py
index 2bba198fa82..c81e482f731 100644
--- a/api/fields/message_fields.py
+++ b/api/fields/message_fields.py
@@ -2,6 +2,7 @@ from __future__ import annotations
from datetime import datetime
from typing import TypeAlias
+from uuid import uuid4
from pydantic import BaseModel, ConfigDict, Field, field_validator
@@ -20,8 +21,8 @@ class SimpleFeedback(ResponseModel):
class RetrieverResource(ResponseModel):
- id: str
- message_id: str
+ id: str = Field(default_factory=lambda: str(uuid4()))
+ message_id: str = Field(default_factory=lambda: str(uuid4()))
position: int
dataset_id: str | None = None
dataset_name: str | None = None