ProcessStepBuilder Class
A builder for a process step.
Note: This class is marked as 'experimental' and may change in the future.
Initialize the ProcessStepBuilder with a step class type and name.
Constructor
ProcessStepBuilder()
Methods
| build_step |
Builds the process step. |
| get_function_metadata_map |
Returns a mapping of function names to their metadata. |
| get_scoped_event_id |
Returns the scoped event ID. |
| get_subtype_of_stateful_step |
Check if the provided type is a subclass of a generic KernelProcessStep and return its generic type if so. |
| link_to |
Links an event ID to a ProcessStepEdgeBuilder. |
| on_event |
Creates a new ProcessStepEdgeBuilder for the event. |
| on_function_result |
Creates a new ProcessStepEdgeBuilder for the function result. |
| on_input_event |
Creates a new ProcessStepEdgeBuilder for the input event. |
| resolve_function_target |
Resolves the function target for the given function name and parameter name. |
build_step
Builds the process step.
build_step() -> KernelProcessStepInfo
get_function_metadata_map
Returns a mapping of function names to their metadata.
get_function_metadata_map(plugin_type, name: str | None = None, kernel: Kernel | None = None) -> dict[str, KernelFunctionMetadata]
Parameters
| Name | Description |
|---|---|
|
plugin_type
Required
|
|
|
name
|
Default value: None
|
|
kernel
|
Default value: None
|
get_scoped_event_id
Returns the scoped event ID.
get_scoped_event_id(event_id: str) -> str
Parameters
| Name | Description |
|---|---|
|
event_id
Required
|
|
get_subtype_of_stateful_step
Check if the provided type is a subclass of a generic KernelProcessStep and return its generic type if so.
get_subtype_of_stateful_step(type_to_check)
Parameters
| Name | Description |
|---|---|
|
type_to_check
Required
|
|
link_to
Links an event ID to a ProcessStepEdgeBuilder.
link_to(event_id: str, edge_builder: ProcessStepEdgeBuilder) -> None
Parameters
| Name | Description |
|---|---|
|
event_id
Required
|
|
|
edge_builder
Required
|
|
on_event
Creates a new ProcessStepEdgeBuilder for the event.
on_event(event_id: str | Enum) -> ProcessStepEdgeBuilder
Parameters
| Name | Description |
|---|---|
|
event_id
Required
|
|
on_function_result
Creates a new ProcessStepEdgeBuilder for the function result.
on_function_result(function_name: str | Enum) -> ProcessStepEdgeBuilder
Parameters
| Name | Description |
|---|---|
|
function_name
Required
|
The function name as a string or Enum. |
Returns
| Type | Description |
|---|---|
|
The ProcessStepEdgeBuilder instance. |
on_input_event
Creates a new ProcessStepEdgeBuilder for the input event.
on_input_event(event_id: str | Enum) -> ProcessStepEdgeBuilder
Parameters
| Name | Description |
|---|---|
|
event_id
Required
|
|
resolve_function_target
Resolves the function target for the given function name and parameter name.
resolve_function_target(function_name: str | None, parameter_name: str | None) -> KernelProcessFunctionTarget
Parameters
| Name | Description |
|---|---|
|
function_name
Required
|
|
|
parameter_name
Required
|
|
Attributes
edges
edges: dict[str, list[Any]]
event_namespace
event_namespace: str
function_type
function_type: type[TStep] | None
functions_dict
functions_dict: dict[str, KernelFunctionMetadata]
id
id: str | None
initial_state
initial_state: TState | None
is_experimental
is_experimental = True
name
name: str
stage_status
stage_status = 'experimental'