soulfire.behaviors¶
Attributes¶
Exceptions¶
Base error for bot behavior operations. |
|
A bot behavior exceeded its allowed duration. |
Classes¶
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents¶
- soulfire.behaviors.A¶
- soulfire.behaviors.E¶
- soulfire.behaviors.R¶
- soulfire.behaviors.define_behavior[A2, E2, R2](function: collections.abc.Callable[[soulfire.bot.SoulFireBot], effect_py.Effect[A2, E2, R2]]) FunctionBehavior[A2, E2, R2][source]¶
- soulfire.behaviors.run_behaviors[E2, R2](bot: soulfire.bot.SoulFireBot, behaviors: collections.abc.Iterable[BotBehavior[object, E2, R2]]) effect_py.Effect[None, E2, R2][source]¶
- soulfire.behaviors.sequence[E2, R2](*behaviors: BotBehavior[object, E2, R2]) BotBehavior[tuple[object, ...], E2, R2][source]¶
- soulfire.behaviors.parallel[E2, R2](*behaviors: BotBehavior[object, E2, R2]) BotBehavior[tuple[object, ...], E2, R2][source]¶
- soulfire.behaviors.race[A2, E2, R2](first: BotBehavior[A2, E2, R2], *others: BotBehavior[A2, E2, R2]) BotBehavior[A2, E2, R2][source]¶
- soulfire.behaviors.repeat[A2, E2, R2](behavior: BotBehavior[A2, E2, R2], *, times: int) BotBehavior[tuple[A2, ...], E2 | soulfire.errors.SoulFireOperationError, R2][source]¶
- soulfire.behaviors.retry[A2, E2, R2](behavior: BotBehavior[A2, E2, R2], *, attempts: int = 3, delay: float = 0, backoff: float = 1, maximum_delay: float | None = None, while_: collections.abc.Callable[[E2], bool] = lambda _: ...) BotBehavior[A2, E2 | soulfire.errors.SoulFireOperationError, R2][source]¶
- soulfire.behaviors.timeout[A2, E2, R2](behavior: BotBehavior[A2, E2, R2], seconds: float) BotBehavior[A2, E2 | soulfire.errors.SoulFireOperationError | SoulFireBehaviorTimeoutError, R2][source]¶
- soulfire.behaviors.until[A2, E2, R2, EP, RP](behavior: BotBehavior[A2, E2, R2], predicate: collections.abc.Callable[[A2], bool | effect_py.Effect[bool, EP, RP]], *, maximum_iterations: int | None = None) BotBehavior[A2, E2 | EP | soulfire.errors.SoulFireOperationError | SoulFireBehaviorError, R2 | RP][source]¶
- soulfire.behaviors.conditional[A2, E2, R2, EP, RP](predicate: collections.abc.Callable[[soulfire.bot.SoulFireBot], bool | effect_py.Effect[bool, EP, RP]], when_true: BotBehavior[A2, E2, R2], when_false: BotBehavior[A2, E2, R2] | None = None) BotBehavior[A2 | None, E2 | EP, R2 | RP][source]¶
- soulfire.behaviors.fallback[A2, E2, R2](primary: BotBehavior[A2, E2, R2], *alternatives: BotBehavior[A2, E2, R2]) BotBehavior[A2, E2, R2][source]¶
- soulfire.behaviors.cleanup[A2, E2, R2](behavior: BotBehavior[A2, E2, R2], finalizer: BotBehavior[object, object]) BotBehavior[A2, E2, R2][source]¶
- soulfire.behaviors.scoped_lease[A2, E2, R2](behavior: BotBehavior[A2, E2, R2], *, ttl_seconds: int = 30) BotBehavior[A2, E2 | soulfire.errors.SoulFireOperationError, R2][source]¶