Actor#
Actor is a component of Pipeline
, that processes the Script
.
It is responsible for determining the next node and getting response from it.
The actor acts as a bridge between the user’s input and the dialog graph, making sure that the conversation follows the expected flow.
More details on the processing can be found in the documentation for
Actor.run_component()
.
- class Actor(**data)[source]#
Bases:
PipelineComponent
The class which is used to process
Context
according to theScript
.- property computed_name: str#
“actor”
- async run_component(ctx)[source]#
Process the context in the following way: :rtype:
None
Run pre-transition of the
Context.current_node
.Determine and save the next node based on
transitions
of theContext.current_node
.Run pre-response of the
Context.current_node
.Determine and save the response of the
Context.current_node
- async static _run_processing_parallel(processing, ctx)[source]#
Execute
BaseProcessing
functions simultaneously, independent of the order.Picked depending on the value of the
Pipeline
’s parallelize_processing flag.- Return type:
None
- async static _run_processing_sequential(processing, ctx)[source]#
Execute
BaseProcessing
functions in-order.Picked depending on the value of the
Pipeline
’s parallelize_processing flag.- Return type:
None
- async static _run_processing(processing, ctx)[source]#
Run
BaseProcessing
functions.The execution order depends on the value of the
Pipeline
’s parallelize_processing flag.- Return type:
None
- before_handler: BeforeHandler#
BeforeHandler
, associated with this component.
- after_handler: AfterHandler#
AfterHandler
, associated with this component.
- timeout: Optional[float]#
Maximum component execution time (in seconds), if it exceeds this time, it is interrupted.
- concurrent: bool#
Optional flag that indicates whether this component should be executed concurrently with adjacent concurrent components.
- start_condition: AnyCondition#
AnyCondition
that is invoked before each component execution; component is executed only if it returnsTrue
.
- name: Optional[str]#
Name of the component. Defaults to
computed_name
potentially modified byrename_component_incrementing()
.See
validate_name()
for rules.
- path: Optional[str]#
Separated by dots path to component, is universally unique.