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

Co-authored-by: hobo.l <hobo.l@binance.com>
pull/15605/head
luckylhb90 1 year ago committed by GitHub
parent 947c9f70fb
commit 63ea6f1ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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")

Loading…
Cancel
Save