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.

Fixed: Run failed: Failed to invoke tool: File.__init__() got an unexpected keyword argument (#14073)

luckylhb9063ea6f1ecfb7
diff --git a/api/core/file/models.py b/api/core/file/models.py
index 7eef2d2b335..f5db6c2d74e 100644
--- a/api/core/file/models.py
+++ b/api/core/file/models.py
@@ -63,7 +63,9 @@ class File(BaseModel):
extension: Optional[str] = None,
mime_type: Optional[str] = None,
size: int = -1,
- storage_key: str,
+ storage_key: Optional[str] = None,
+ dify_model_identity: Optional[str] = FILE_MODEL_IDENTITY,
+ url: Optional[str] = None,
):
super().__init__(
id=id,
@@ -76,8 +78,10 @@ class File(BaseModel):
extension=extension,
mime_type=mime_type,
size=size,
+ dify_model_identity=dify_model_identity,
+ url=url,
)
- self._storage_key = storage_key
+ self._storage_key = str(storage_key)
def to_dict(self) -> Mapping[str, str | int | None]:
data = self.model_dump(mode="json")