chatflock.sequencial_process.sequential_process¶
Module Contents¶
- chatflock.sequencial_process.sequential_process.T¶
- class chatflock.sequencial_process.sequential_process.Step(name, func, on_step_start=None, on_step_completed=None, on_step_failed=None)¶
Bases:
Generic[T]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- Parameters:
name (str)
func (Callable[[T, Any], Optional[Generator[T, None, None]]])
on_step_start (Optional[Callable[[T], None]])
on_step_completed (Optional[Callable[[T], None]])
on_step_failed (Optional[Callable[[T], None]])
- name¶
- func¶
- on_step_start¶
- on_step_completed¶
- on_step_failed¶
- run(state, **kwargs)¶
- Parameters:
state (T)
kwargs (Any)
- Return type:
Generator[T, None, None]
- class chatflock.sequencial_process.sequential_process.SequentialProcess(steps, initial_state, save_state)¶
Bases:
Generic[T]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- Parameters:
steps (Sequence[Step[T]])
initial_state (T)
save_state (Callable[[T], None])
- steps¶
- state¶
- save_state_func¶
- save_state(state)¶
- Parameters:
state (T)
- Return type:
None
- run()¶
- Return type:
T