You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
[FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
Please do not modify this template :) and fill in all the required fields.
Dify version
0.10.2
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
the _extra_config field can not be rightly initialized with pydantic.
so some extra_config like the image detail will lose in the file_factory.py. below here:
add a constructor for File class may solve this problem
To ensure the _extra_config field in the File class is correctly initialized using Pydantic, you can use Field(default_factory=...) to provide a default value. This approach ensures that _extra_config is initialized with a default FileExtraConfig instance if no value is provided during the creation of a File object. Here's how you can modify the File class:
classFile(BaseModel):
dify_model_identity: str=FILE_MODEL_IDENTITYid: Optional[str] =None# message file idtenant_id: strtype: FileTypetransfer_method: FileTransferMethodremote_url: Optional[str] =None# remote urlrelated_id: Optional[str] =Nonefilename: Optional[str] =Noneextension: Optional[str] =Field(default=None, description="File extension, should contains dot")
mime_type: Optional[str] =Nonesize: int=-1_extra_config: FileExtraConfig|None=Field(default_factory=FileExtraConfig)
# rest of the class remains unchanged
This change should resolve the issue of _extra_config not being initialized properly [1].
Self Checks
Dify version
0.10.2
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
the _extra_config field can not be rightly initialized with pydantic.
so some extra_config like the image detail will lose in the file_factory.py. below here:
add a constructor for File class may solve this problem
✔️ Expected Behavior
rightly initialized
❌ Actual Behavior
_extra_config is missing
The text was updated successfully, but these errors were encountered: