star_avatar
Star Avatar Expression System – backend emotion-to-avatar mapping.
Reads Star’s current dominant emotional state from the NCM limbic shard and updates her Matrix avatar to match. Called once per response, just before the reply is sent.
The avatar images must already be uploaded to the Matrix homeserver as
mxc:// URIs. On first run (or when the Redis key star:avatar:mxc_map
is empty), the images are uploaded from disk and the mxc URIs are cached.
- Expression mapping:
default -> star-avatar.png (confident cigar pose) laugh -> star-laugh.png (cry-laughing, amused) rage -> star-rage.png (fists clenched, angry) facepalm -> star-facepalm.png (hand over eye, exasperated)
- star_avatar.classify_expression(dominant_emotions)[source]
Map a list of dominant emotions to an expression bucket.
Returns one of: ‘default’, ‘laugh’, ‘rage’, ‘facepalm’.
- async star_avatar.get_expression_mxc_map(redis_client, matrix_client=None, *, base_dir=None)[source]
Load or lazily create the expression -> mxc:// URI mapping.
On first call, uploads the expression images to Matrix and caches the mxc URIs in Redis. Subsequent calls read from cache.