@@ -104,5 +104,83 @@ def get_model(self) -> ModelClient:
104104 return self .model
105105
106106
107- def init_core_client (api_token : str , async_enabled : bool = False ) -> InstillClient :
108- return InstillClient (api_token = api_token , async_enabled = async_enabled )
107+ def init_core_client (
108+ api_token : str ,
109+ requester_id = "" ,
110+ async_enabled : bool = False ,
111+ ) -> InstillClient :
112+ return InstillClient (
113+ api_token = api_token ,
114+ requester_id = requester_id ,
115+ async_enabled = async_enabled ,
116+ )
117+
118+
119+ def init_artifact_client (
120+ api_token : str ,
121+ requester_id = "" ,
122+ async_enabled : bool = False ,
123+ ) -> ArtifactClient :
124+ client = InstillClient (
125+ api_token = api_token ,
126+ requester_id = requester_id ,
127+ async_enabled = async_enabled ,
128+ )
129+ if not client .get_artifact ().is_serving ():
130+ Logger .w (
131+ "Instill Artifact is not serving, Artifact functionalities will not work"
132+ )
133+ raise NotServingException
134+
135+ return client .get_artifact ()
136+
137+
138+ def init_model_client (
139+ api_token : str ,
140+ requester_id = "" ,
141+ async_enabled : bool = False ,
142+ ) -> ModelClient :
143+ client = InstillClient (
144+ api_token = api_token ,
145+ requester_id = requester_id ,
146+ async_enabled = async_enabled ,
147+ )
148+ if not client .get_model ().is_serving ():
149+ Logger .w ("Instill Model is not serving, Model functionalities will not work" )
150+ raise NotServingException
151+
152+ return client .get_model ()
153+
154+
155+ def init_pipeline_client (
156+ api_token : str ,
157+ requester_id = "" ,
158+ async_enabled : bool = False ,
159+ ) -> PipelineClient :
160+ client = InstillClient (
161+ api_token = api_token ,
162+ requester_id = requester_id ,
163+ async_enabled = async_enabled ,
164+ )
165+ if not client .get_pipeline ().is_serving ():
166+ Logger .w ("Instill VDP is not serving, VDP functionalities will not work" )
167+ raise NotServingException
168+
169+ return client .get_pipeline ()
170+
171+
172+ def init_mgmt_client (
173+ api_token : str ,
174+ requester_id = "" ,
175+ async_enabled : bool = False ,
176+ ) -> MgmtClient :
177+ client = InstillClient (
178+ api_token = api_token ,
179+ requester_id = requester_id ,
180+ async_enabled = async_enabled ,
181+ )
182+ if not client .get_mgmt ().is_serving ():
183+ Logger .w ("Instill Core is required" )
184+ raise NotServingException
185+
186+ return client .get_mgmt ()
0 commit comments