game_assets

GameGirl Color – Per-game asset manager.

Stores labeled image URLs/references per game session in Redis. Assets are categorized (title_screen, enemy, character, item, background, ui, special) and can be referenced by the LLM during game narration. # 🎨💀 CORRUPTED ASSET REGISTRY

class game_assets.GameAsset(name, category, url, uploaded_by='', turn_added=0, created_at=<factory>)[source]

Bases: object

A labeled image asset for a game session.

Parameters:
name: str
category: str
url: str
uploaded_by: str = ''
turn_added: int = 0
created_at: float
to_dict()[source]
Return type:

dict[str, Any]

classmethod from_dict(d)[source]
Return type:

GameAsset

Parameters:

d (dict[str, Any])

async game_assets.upload_asset(game_id, name, category, url, user_id='', turn=0, redis=None)[source]

Upload/register a new asset for the game.

Returns dict with success status and asset info.

Return type:

dict[str, Any]

Parameters:
async game_assets.get_assets(game_id, category=None, redis=None)[source]

Get assets for a game, optionally filtered by category.

Return type:

list[GameAsset]

Parameters:
  • game_id (str)

  • category (str | None)

  • redis (Any)

async game_assets.get_asset_by_name(game_id, name, redis=None)[source]

Get a specific asset by name.

Return type:

GameAsset | None

Parameters:
async game_assets.delete_asset(game_id, name, redis=None)[source]

Delete an asset by name.

Return type:

bool

Parameters:
async game_assets.get_asset_summary(game_id, redis=None)[source]

Build a formatted summary of all game assets for the LLM context.

Return type:

str

Parameters: