Skip to main content
Session lifecycle hook payloads.

Classes

CLASS SessionPreInitPayload

Payload for session_pre_init — before backend initialization. Attributes:
  • backend_name: Name of the backend (e.g. "ollama", "openai").
  • model_id: Model identifier string (writable).
  • model_options: Optional dict of model options like temperature, max_tokens (writable).
  • context_type: Class name of the context being used (e.g. "SimpleContext").

CLASS SessionPostInitPayload

Payload for session_post_init — after session is fully initialized. Attributes:
  • session_id: UUID string identifying this session.
  • model_id: Model identifier used by the backend (e.g. "granite4\:micro").
  • context: The initial [Context](../../core/base#class-context) instance for this session.

CLASS SessionResetPayload

Payload for session_reset — when session context is reset. Attributes:
  • previous_context: The [Context](../../core/base#class-context) that is about to be discarded (observe-only).

CLASS SessionCleanupPayload

Payload for session_cleanup — before session cleanup/teardown. Attributes:
  • context: The [Context](../../core/base#class-context) at the time of cleanup (observe-only).
  • interaction_count: Number of items in the context at cleanup time.