File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,12 @@ class File(BaseModel):
108108 filename : Optional [str ] = None # Original filename if available
109109 _tmp_path : Optional [str ] = PrivateAttr (default = None ) # Internal storage for temporary file path
110110
111- def __init__ (self , ** data ):
112- super ().__init__ (** data )
111+ model_config = ConfigDict (
112+ arbitrary_types_allowed = True ,
113+ populate_by_name = True
114+ )
115+
116+ def model_post_init (self , _ : Any ) -> None :
113117 if self ._is_url (self .uri ):
114118 self ._download_url ()
115119 elif not os .path .isabs (self .uri ):
@@ -203,8 +207,4 @@ def exists(self) -> bool:
203207
204208 def refresh_metadata (self ) -> None :
205209 """Refresh all metadata from the file."""
206- self ._populate_metadata ()
207-
208- class Config :
209- """Pydantic config"""
210- arbitrary_types_allowed = True
210+ self ._populate_metadata ()
You can’t perform that action at this time.
0 commit comments