shipany.bot.runtime
shipany.bot.runtime package
Submodules
shipany.bot.runtime.context module
pydantic model shipany.bot.runtime.context.RuntimeContext
Bases: BaseModel
The runtime context to provide the runtime information.
- Config:
- extra: str = forbid
- frozen: bool = True
- Fields:
field secrets : Mapping[str, str] [Optional]
The secrets to provide to the runtime.
shipany.bot.runtime.context.runtime_context()
Provide the runtime context as a context manager.
- Yields: RuntimeContext — The runtime context.
- Return type: AsyncIterator[RuntimeContext]
shipany.bot.runtime.events_handler module
async shipany.bot.runtime.events_handler.handle(activation, steps, event)
Handle the activation. The handler is responsible for checking the preconditions and executing the steps.
- Parameters:
- activation (
CommandActivation|EventActivation|WebhookActivation|TimeoutActivation) — The activation to handle. - steps (
list[Step]) — The steps of the conversation. - event (
TelegramObject) — The event that triggered the activation.
- activation (
- Return type: None
shipany.bot.runtime.preconditions module
shipany.bot.runtime.preconditions.check_preconditions(context, condition)
Check the preconditions of event activation.
- Parameters:
- context (
ConversationContext) — The conversation context. - condition (
EqualsOperation|InOperation|AndOperation|OrOperation|NotOperation|VarOperation) — The condition to check.
- context (
- Return type: None
Raises:— : ActivationPreconditionNotMeetError: The condition is not met.