|
|
6 months ago | |
|---|---|---|
| .. | ||
| default | 6 months ago | |
| README.md | 6 months ago | |
This directory contains all assets used by the Trixy voice assistant application, organized using a profile-based system for different deployment environments and use cases.
assets/
├── README.md # This file
├── default/ # Default asset profile (fallback)
│ ├── audio/ # Audio assets
│ │ ├── success.wav # Success notification sound
│ │ ├── error.wav # Error notification sound
│ │ ├── notification.wav # General notification sound
│ │ └── wakeword_detected.wav # Wakeword confirmation sound
│ ├── images/ # Image assets
│ │ ├── icon_connected.png # Connected status icon
│ │ ├── icon_disconnected.png # Disconnected status icon
│ │ ├── icon_listening.png # Listening status icon
│ │ └── icon_processing.png # Processing status icon
│ ├── text/ # Text assets
│ │ ├── welcome_message.txt # Welcome message template
│ │ ├── error_messages.json # Error message templates
│ │ └── response_templates.yaml # Response templates
│ └── config/ # Configuration assets
│ ├── asset_profiles.json # Asset profile configurations
│ └── validation_rules.yaml # Validation rules
└── [other_profiles]/ # Additional profiles (production, development, etc.)
The Trixy asset management system uses profile-based resolution with fallback:
./assets/{profile}/path/to/asset./assets/default/path/to/assetFalse if asset not found in either locationIf the current profile is "production" and you request audio/success.wav:
./assets/production/audio/success.wav./assets/default/audio/success.wavFalse./assets/production/./assets/development/./assets/testing/from trixy_core.assets import AssetManager
# Get asset manager from application container
asset_manager = application.get_asset_manager()
# Get asset path (main API method)
success_sound = asset_manager.get_path("audio/success.wav")
if success_sound:
# Use the asset file
play_sound(success_sound)
else:
# Asset not found, handle gracefully
log_warning("Success sound not found")
# Get other assets
error_icon = asset_manager.get_path("images/icon_error.png")
welcome_text = asset_manager.get_path("text/welcome_message.txt")
# Set profile for the session
asset_manager.set_profile("production")
# Assets will now be loaded from production profile first,
# with fallback to default profile
optimized_sound = asset_manager.get_path("audio/notification.wav")
To create a new asset profile:
mkdir assets/my_profileconfig/asset_profiles.json if neededasset_manager.set_profile("my_profile") in codeExample profile structure:
assets/my_profile/
├── audio/
│ └── custom_notification.wav
├── images/
│ └── custom_icon.png
└── text/
└── custom_messages.json
success.wav - Success confirmation sounderror.wav - Error notification soundnotification.wav - General notificationwakeword_detected.wav - Wakeword confirmation{action}_{result}.wav - Action-specific soundsicon_{status}.png - Status indicator iconsbutton_{action}.png - UI button iconslogo_{variant}.png - Logo variationsbg_{context}.png - Background images{purpose}_message.txt - Simple text messages{category}_templates.json - Structured templates{type}_responses.yaml - Response templates/).gitignore rulesWhen adding new assets:
default/ profile firstFor questions or issues with the asset management system, refer to the main Trixy documentation or contact the development team.