[docs]@set_service_action_metadata(endpoint=ModelIdRetrieveEndpoint)defretrieve(self,id:str,)->ModelIdRetrieveResponse:""" Raises: ValueError: If the id parameter is an empty string. ApiResponseException: In case of a known API error. ApiNetworkException: In case of unhandled network error. ValidationError: In case of provided parameters are invalid. """assert_is_not_empty_string(id)self._log_method_execution("Models Retrieve",id=id)withself._get_http_client()asclient:metadata=get_service_action_metadata(self.retrieve)response=client.get(url=self._get_endpoint(metadata.endpoint,id=id),params=_ModelIdRetrieveParametersQuery().model_dump(),)returnModelIdRetrieveResponse(**response.json())
[docs]@set_service_action_metadata(endpoint=ModelRetrieveEndpoint)deflist(self,*,type:Optional[EnumLike[ModelType]]=None,limit:Optional[int]=None,offset:Optional[int]=None)->ModelRetrieveResponse:""" Args: type: Specify concrete model type. Default is everything. limit: The maximum number of models to retrieve. offset: The number of models to skip before starting to retrieve. Raises: ApiResponseException: In case of a known API error. ApiNetworkException: In case of unhandled network error. ValidationError: In case of provided parameters are invalid. """request_parameters=_ModelRetrieveParametersQuery(limit=limit,offset=offset,type=to_enum_optional(type,ModelType)).model_dump()self._log_method_execution("Models List",**request_parameters)withself._get_http_client()asclient:metadata=get_service_action_metadata(self.list)response=client.get(url=self._get_endpoint(metadata.endpoint),params=request_parameters)returnModelRetrieveResponse(**response.json())