shipany.bot.conversation
shipany.bot.conversation package
Subpackages
- shipany.bot.conversation.handlers package
- shipany.bot.conversation.models package
- Subpackages
- shipany.bot.conversation.models.activations package
- Submodules
- shipany.bot.conversation.models.activations.base module
- shipany.bot.conversation.models.activations.command module
- shipany.bot.conversation.models.activations.event module
- shipany.bot.conversation.models.activations.timeout module
- shipany.bot.conversation.models.activations.webhook module
- Module contents
- shipany.bot.conversation.models.activations package
- Submodules
- shipany.bot.conversation.models.action module
- shipany.bot.conversation.models.conversation module
- shipany.bot.conversation.models.flow module
- shipany.bot.conversation.models.steps module
- shipany.bot.conversation.models.validators module
- shipany.bot.conversation.models.webhooks module
- Module contents
- Subpackages
- shipany.bot.conversation.renders package
Submodules
shipany.bot.conversation.context module
shipany.bot.conversation.context.conversation_context(event=None)
Provide the conversation context as a context manager.
- Parameters:
event (
Any, default:None) — The event that triggered the conversation. - Yields: ConversationContext — The conversation context.
- Return type: AsyncIterator[ConversationContext]
pydantic model shipany.bot.conversation.context.ConversationContext
Bases: BaseModel
The context of the conversation.
- Config:
- extra: str = forbid
- frozen: bool = True
- arbitrary_types_allowed: bool = True
- Fields:
field runtime : RuntimeContext [Required]
The runtime context.
field captures : CapturesModifier [Required]
The captures modifier.
field event : t.Any [Required]
The event that triggered the conversation.
shipany.bot.conversation.errors module
exception shipany.bot.conversation.errors.ConversationRuntimeError
Bases: RuntimeError
Base class for all conversation runtime errors.
exception shipany.bot.conversation.errors.NoStepFoundError
Bases: ConversationRuntimeError
Raised when a step with a given ID is not found.
- Parameters:
step_id (
str) — The ID of the step that was not found.
__init__(step_id)
- Parameters:
- self (Self)
- step_id (str)
- Return type: None
exception shipany.bot.conversation.errors.ActionNotImplementedError
Bases: ConversationRuntimeError
Raised when an action is not implemented.
- Parameters:
- action_name (
str) — The name of the action that is not implemented. - details (
str) — Additional details about the action.
- action_name (
__init__(action_name, details)
- Parameters:
- self (Self)
- action_name (str)
- details (str)
- Return type: None
exception shipany.bot.conversation.errors.ActivationPreconditionNotMeetError
Bases: ConversationRuntimeError
Raised when the activation precondition does not meet expectations.
- Parameters:
- action_name — The name of the action that is not implemented.
- details — Additional details about the action
__init__()
- Parameters: self (Self)
- Return type: None
shipany.bot.conversation.loader module
shipany.bot.conversation.loader.load(json_data)
Load a conversation flow from a JSON string.
- Parameters:
json_data (
str|bytes|bytearray) — The JSON string to load. - Returns: The loaded conversation flow.
- Return type: Flow
- Raises: ValidationError — If the JSON data is invalid.