Skip to main content

CallbackPayloadStoreProtocol

Defined in the protocols module.
AI Agent Protocol for durable, reference-addressable interactive callback values. Some channels hard-cap inline callback payloads (e.g. Telegram’s 64-byte inline-callback limit). When an interactive reply/select value is too long to travel inline, the framework persists the canonical value under a short, collision-resistant reference and emits that reference in the callback instead. On click the registry resolves the reference back to the exact value — so long option values (URLs, file paths, free-text choices) round-trip losslessly on every channel. This mirrors :class:ApprovalStoreProtocol: the contract lives in core so any backend and any channel can interoperate; core ships a bounded in-memory default (:class:InMemoryCallbackPayloadStore) and heavier durable backends (e.g. SQLite) live in the praisonai-bot runtime. Behaviour is unchanged when no store is configured — values that fit inline are always sent inline, so this is additive and backward compatible.

Methods

put()

Persist value under ref until expires_at (epoch seconds).

get()

Return the value stored for ref, or None if unknown/expired.

Source

View on GitHub

praisonaiagents/bots/protocols.py at line 1381