Action
Base action class
Last updated
Base action class
Last updated
Main methods and properties
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
default_key (str, optional): Default key used for results that is not of type Dict. Defaults to "output".
replace (, optional): Replacing strategy. Defaults to ..
Component Call
ActionError: Raised if action was executed unsuccessfully
If result of Action.execute is None, will return input_data.
If result of Action.execute is not of type Dict, result will be seted to default_key (By default equals to "output").
Main logic of action
Creates ActionExecutor which manages context
get_key (Optional[str], optional): Which key value of input_data will be used. If value equal to None, root dict will be used. Defaults to None.
set_key (Optional[str], optional): Which key will be used to set result value. If set_key value equal to None: - if result of type Dict[str, Any], update root dict; - else, set result to default_key. Defaults to None.
default_key (str, optional): Default key used for results that is not of type Dict. Defaults to "output".
ActionExecutor: Wrapper of Action
Component Call
ActionError: Raised if action was executed unsuccessfully
If result of Action.execute is None, will return input_data.
If result of Action.execute is not of type Dict and set_key is not specified, result will be seted to default_key (By default equals to "output").
input_data (): Data for processing
evaluator (Optional[], optional): Evaluator in context of which component executed. If equals to None, default evaluator will be created. Defaults to None.
: Result of executed component.
input_data (): Data for processing.
: Result of execution.
replace (, optional): Replacing strategy for executor. If equals to None, this action strategy will be used. Defaults to None.
Subclass of . Wrapper of.
input_data (): Data for processing
evaluator (Optional[], optional): Evaluator in context of which component executed. If equals to None, default evaluator will be created. Defaults to None.
: Result of executed component.