tools.user_variables module

Per-user per-channel variables (v3)

Variables are stored as Redis hashes and auto-injected into context for recent active users.

async tools.user_variables.get_user_variables_for_context(channel_id, user_id, *, redis_client=None)[source]

Return {name: value} for a user in a channel.

Return type:

Dict[str, Any]

Parameters:
  • channel_id (str)

  • user_id (str)

async tools.user_variables.get_recent_active_users(channel_id, *, redis_client=None, limit=5)[source]

Return recent unique users in a channel.

Return type:

List[Dict[str, str]]

Parameters:
  • channel_id (str)

  • limit (int)

async tools.user_variables.get_all_active_user_variables(channel_id, *, redis_client=None, limit=5)[source]

Variables for the most recent active users.

Return type:

List[Dict[str, Any]]

Parameters:
  • channel_id (str)

  • limit (int)