classVectorField(Resource):"""Vector field for use in Argilla `Dataset` `Settings`"""_model:VectorFieldModel_api:VectorsAPI_dataset:"Dataset"def__init__(self,name:str,dimensions:int,title:Optional[str]=None,_client:Optional["Argilla"]=None,)->None:"""Vector field for use in Argilla `Dataset` `Settings` Parameters: name (str): The name of the field dimensions (int): The number of dimensions in the vector title (Optional[str], optional): The title of the field. Defaults to None. """client=_clientorArgilla._get_default()super().__init__(api=client.api.vectors,client=client)self._model=VectorFieldModel(name=name,title=title,dimensions=dimensions)self._dataset=None@propertydefname(self)->str:returnself._model.name@name.setterdefname(self,value:str)->None:self._model.name=value@propertydeftitle(self)->Optional[str]:returnself._model.title@title.setterdeftitle(self,value:Optional[str])->None:self._model.title=value@propertydefdimensions(self)->int:returnself._model.dimensions@dimensions.setterdefdimensions(self,value:int)->None:self._model.dimensions=value@propertydefdataset(self)->"Dataset":returnself._dataset@dataset.setterdefdataset(self,value:"Dataset")->None:self._dataset=valueself._model.dataset_id=self._dataset.iddef__repr__(self)->str:returnf"{self.__class__.__name__}(name={self.name}, title={self.title}, dimensions={self.dimensions})"@classmethoddeffrom_model(cls,model:VectorFieldModel)->"VectorField":instance=cls(name=model.name,dimensions=model.dimensions)instance._model=modelreturninstance@classmethoddeffrom_dict(cls,data:dict)->"VectorField":model=VectorFieldModel(**data)returncls.from_model(model=model)
def__init__(self,name:str,dimensions:int,title:Optional[str]=None,_client:Optional["Argilla"]=None,)->None:"""Vector field for use in Argilla `Dataset` `Settings` Parameters: name (str): The name of the field dimensions (int): The number of dimensions in the vector title (Optional[str], optional): The title of the field. Defaults to None. """client=_clientorArgilla._get_default()super().__init__(api=client.api.vectors,client=client)self._model=VectorFieldModel(name=name,title=title,dimensions=dimensions)self._dataset=None