@@ -278,7 +278,7 @@ class ModelClient{
278
278
279
279
/**
280
280
*
281
- * Call the Modzy API Service that return a version list related to a model identifier
281
+ * Call the Modzy API Service that return a model version
282
282
*
283
283
* @param {string } modelId - Identifier of the model
284
284
* @param {string } versionId - Identifier of the version
@@ -305,6 +305,64 @@ class ModelClient{
305
305
) ;
306
306
}
307
307
308
+ /**
309
+ *
310
+ * Call the Modzy API Service that return the model version input sample
311
+ *
312
+ * @param {string } modelId - Identifier of the model
313
+ * @param {string } versionId - Identifier of the version
314
+ * @return {String } A json string with the input sample
315
+ * @throws {ApiError } Error if there is something wrong with the service or the call
316
+ */
317
+ getModelVersionInputSample ( modelId , versionId ) {
318
+ const requestURL = `${ this . baseURL } /${ modelId } /versions/${ versionId } /sample-input` ;
319
+ logger . debug ( `getModelVersionInputSample(${ modelId } , ${ versionId } ) GET ${ requestURL } ` ) ;
320
+ return axios . get (
321
+ requestURL ,
322
+ { headers : { 'Authorization' :`ApiKey ${ this . apiKey } ` } }
323
+ )
324
+ . then (
325
+ ( response ) => {
326
+ logger . info ( `getModelVersionInputSample(${ modelId } , ${ versionId } ) :: ${ response . status } ${ response . statusText } ` ) ;
327
+ return response . data ;
328
+ }
329
+ )
330
+ . catch (
331
+ ( error ) => {
332
+ throw ( new ApiError ( error ) ) ;
333
+ }
334
+ ) ;
335
+ }
336
+
337
+ /**
338
+ *
339
+ * Call the Modzy API Service that return the model version output sample
340
+ *
341
+ * @param {string } modelId - Identifier of the model
342
+ * @param {string } versionId - Identifier of the version
343
+ * @return {String } A json string with the output sample
344
+ * @throws {ApiError } Error if there is something wrong with the service or the call
345
+ */
346
+ getModelVersionInputSample ( modelId , versionId ) {
347
+ const requestURL = `${ this . baseURL } /${ modelId } /versions/${ versionId } /sample-output` ;
348
+ logger . debug ( `getModelVersionOutputSample(${ modelId } , ${ versionId } ) GET ${ requestURL } ` ) ;
349
+ return axios . get (
350
+ requestURL ,
351
+ { headers : { 'Authorization' :`ApiKey ${ this . apiKey } ` } }
352
+ )
353
+ . then (
354
+ ( response ) => {
355
+ logger . info ( `getModelVersionOutputSample(${ modelId } , ${ versionId } ) :: ${ response . status } ${ response . statusText } ` ) ;
356
+ return response . data ;
357
+ }
358
+ )
359
+ . catch (
360
+ ( error ) => {
361
+ throw ( new ApiError ( error ) ) ;
362
+ }
363
+ ) ;
364
+ }
365
+
308
366
}
309
367
310
368
module . exports = ModelClient ;
0 commit comments