33from ai21 .clients .common .custom_model_base import CustomModel
44from ai21 .clients .studio .resources .studio_resource import StudioResource , AsyncStudioResource
55from ai21 .models import CustomBaseModelResponse
6+ from ai21 .version_utils import deprecated , V3_DEPRECATION_MESSAGE
67
78
89class StudioCustomModel (StudioResource , CustomModel ):
10+ @deprecated (V3_DEPRECATION_MESSAGE )
911 def create (
1012 self ,
1113 dataset_id : str ,
@@ -26,14 +28,17 @@ def create(
2628 )
2729 self ._post (path = f"/{ self ._module_name } " , body = body , response_cls = None )
2830
31+ @deprecated (V3_DEPRECATION_MESSAGE )
2932 def list (self ) -> List [CustomBaseModelResponse ]:
3033 return self ._get (path = f"/{ self ._module_name } " , response_cls = List [CustomBaseModelResponse ])
3134
35+ @deprecated (V3_DEPRECATION_MESSAGE )
3236 def get (self , resource_id : str ) -> CustomBaseModelResponse :
3337 return self ._get (path = f"/{ self ._module_name } /{ resource_id } " , response_cls = CustomBaseModelResponse )
3438
3539
3640class AsyncStudioCustomModel (AsyncStudioResource , CustomModel ):
41+ @deprecated (V3_DEPRECATION_MESSAGE )
3742 async def create (
3843 self ,
3944 dataset_id : str ,
@@ -54,8 +59,10 @@ async def create(
5459 )
5560 await self ._post (path = f"/{ self ._module_name } " , body = body , response_cls = None )
5661
62+ @deprecated (V3_DEPRECATION_MESSAGE )
5763 async def list (self ) -> List [CustomBaseModelResponse ]:
5864 return await self ._get (path = f"/{ self ._module_name } " , response_cls = List [CustomBaseModelResponse ])
5965
66+ @deprecated (V3_DEPRECATION_MESSAGE )
6067 async def get (self , resource_id : str ) -> CustomBaseModelResponse :
6168 return await self ._get (path = f"/{ self ._module_name } /{ resource_id } " , response_cls = CustomBaseModelResponse )
0 commit comments