File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ def make_call(
291
291
parameters_mllib ,
292
292
parameters_output ,
293
293
use_base64 = False ,
294
+ parent_id = "" ,
294
295
index_uris = [],
295
296
):
296
297
"""
@@ -299,6 +300,7 @@ def make_call(
299
300
a post_chain API call. This basically eases the making
300
301
of chain calls from Python.
301
302
Parameters are the same as for a post_predict call
303
+ parent_id -- parent action id, when branching execution
302
304
"""
303
305
304
306
if use_base64 :
@@ -314,19 +316,24 @@ def make_call(
314
316
}
315
317
if data :
316
318
call ["data" ] = data
319
+ if parent_id :
320
+ call ["parent_id" ] = parent_id
317
321
if index_uris :
318
322
call ["index_uris" ] = index_uris
319
323
320
324
return call
321
325
322
- def make_action (self , action_type , parameters = []):
326
+ def make_action (self , action_type , parameters = [], aid = "" ):
323
327
"""
324
328
Creates a dictionary that holds a JSON chain action.
325
329
Parameters:
326
330
action_type -- "crop" or "filter" for now
327
331
parameters -- action parameters
332
+ aid -- action id
328
333
"""
329
334
action = {"action" : {"type" : action_type }}
335
+ if aid :
336
+ action ["id" ] = aid
330
337
if parameters :
331
338
action ["action" ]["parameters" ] = parameters
332
339
return action
You can’t perform that action at this time.
0 commit comments