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(
291291 parameters_mllib ,
292292 parameters_output ,
293293 use_base64 = False ,
294+ parent_id = "" ,
294295 index_uris = [],
295296 ):
296297 """
@@ -299,6 +300,7 @@ def make_call(
299300 a post_chain API call. This basically eases the making
300301 of chain calls from Python.
301302 Parameters are the same as for a post_predict call
303+ parent_id -- parent action id, when branching execution
302304 """
303305
304306 if use_base64 :
@@ -314,19 +316,24 @@ def make_call(
314316 }
315317 if data :
316318 call ["data" ] = data
319+ if parent_id :
320+ call ["parent_id" ] = parent_id
317321 if index_uris :
318322 call ["index_uris" ] = index_uris
319323
320324 return call
321325
322- def make_action (self , action_type , parameters = []):
326+ def make_action (self , action_type , parameters = [], aid = "" ):
323327 """
324328 Creates a dictionary that holds a JSON chain action.
325329 Parameters:
326330 action_type -- "crop" or "filter" for now
327331 parameters -- action parameters
332+ aid -- action id
328333 """
329334 action = {"action" : {"type" : action_type }}
335+ if aid :
336+ action ["id" ] = aid
330337 if parameters :
331338 action ["action" ]["parameters" ] = parameters
332339 return action
You can’t perform that action at this time.
0 commit comments