@@ -337,7 +337,11 @@ def delete_model(self, model_id: str) -> Dict[str, Any]:
337337 return self .delete (f"/api/aimodels/{ model_id } /" )
338338
339339 def call_model (
340- self , model_id : str , input_text : str , parameters : Optional [Dict [str , Any ]] = None
340+ self ,
341+ model_id : str ,
342+ input_text : str ,
343+ parameters : Optional [Dict [str , Any ]] = None ,
344+ version_id : Optional [int ] = None ,
341345 ) -> Dict [str , Any ]:
342346 """
343347 Call an AI model with input text using the appropriate client (API or HuggingFace).
@@ -346,6 +350,7 @@ def call_model(
346350 model_id: UUID of the AI model
347351 input_text: Input text to process
348352 parameters: Optional parameters for the model call (temperature, max_tokens, etc.)
353+ version_id: Optional specific version ID to call (defaults to primary/latest version)
349354
350355 Returns:
351356 Dictionary containing model response:
@@ -358,13 +363,24 @@ def call_model(
358363 ...
359364 }
360365 """
366+ payload : Dict [str , Any ] = {
367+ "input_text" : input_text ,
368+ "parameters" : parameters or {},
369+ }
370+ if version_id is not None :
371+ payload ["version_id" ] = version_id
372+
361373 return self .post (
362374 f"/api/aimodels/{ model_id } /call/" ,
363- json_data = { "input_text" : input_text , "parameters" : parameters or {}} ,
375+ json_data = payload ,
364376 )
365377
366378 def call_model_async (
367- self , model_id : str , input_text : str , parameters : Optional [Dict [str , Any ]] = None
379+ self ,
380+ model_id : str ,
381+ input_text : str ,
382+ parameters : Optional [Dict [str , Any ]] = None ,
383+ version_id : Optional [int ] = None ,
368384 ) -> Dict [str , Any ]:
369385 """
370386 Call an AI model asynchronously (returns task ID for long-running operations).
@@ -373,6 +389,7 @@ def call_model_async(
373389 model_id: UUID of the AI model
374390 input_text: Input text to process
375391 parameters: Optional parameters for the model call
392+ version_id: Optional specific version ID to call (defaults to primary/latest version)
376393
377394 Returns:
378395 Dictionary containing task information:
@@ -382,9 +399,16 @@ def call_model_async(
382399 "model_id": str
383400 }
384401 """
402+ payload : Dict [str , Any ] = {
403+ "input_text" : input_text ,
404+ "parameters" : parameters or {},
405+ }
406+ if version_id is not None :
407+ payload ["version_id" ] = version_id
408+
385409 return self .post (
386410 f"/api/aimodels/{ model_id } /call-async/" ,
387- json_data = { "input_text" : input_text , "parameters" : parameters or {}} ,
411+ json_data = payload ,
388412 )
389413
390414 # ==================== Version Management ====================
0 commit comments