arioso.named_prompts#
Named prompts: a ledger of (name, prompt_text) pairs organized by category.
Provides a system for looking up sonic descriptions by name (artist, mood, genre, instrument, etc.) to help users craft prompts for AI music generation without using restricted names.
The system has two layers:
Starter data: ships with arioso in
arioso/data/named_prompts/*.yamlUser data: stored in
~/.local/share/arioso/named_prompts/*.yaml
User data overlays starter data, so users can extend or override entries.
Usage:
>>> from arioso.named_prompts import named_prompts, search
>>> named_prompts.artists['billie_eilish'] # attribute access by category
'...'
>>> named_prompts['artists', 'billie_eilish'] # flat key access
'...'
>>> results = search('jazz') # search across all categories
Functions
|
Add or update a prompt in the user's data. |
Return a module-level singleton |
|
|
Remove a prompt from the user's data. |
|
Search for prompts matching a query string. |
Classes
|
Two-level mapping of |
- class arioso.named_prompts.NamedPrompts(*, include_user_data=True)[source]#
Bases:
MappingTwo-level mapping of
(category, name) -> prompt_text.Supports both hierarchical and flat access:
np = NamedPrompts() np.artists['billie_eilish'] # attribute access to a category np['artists']['billie_eilish'] # dict-style np['artists', 'billie_eilish'] # flat tuple key
Categories are auto-discovered from YAML files in the starter and user dirs.
- Parameters:
include_user_data (
bool) – Whether to layer user data on top of starter data. Defaults toTrue.
- arioso.named_prompts.add_prompt(category, name, prompt_text, *, confirm_override=True)[source]#
Add or update a prompt in the user’s data.
If the name already exists in either user or starter data and
confirm_overrideis True, a confirmation prompt is printed on the first collision.
- arioso.named_prompts.get_named_prompts()[source]#
Return a module-level singleton
NamedPromptsinstance.- Return type:
- arioso.named_prompts.remove_prompt(category, name)[source]#
Remove a prompt from the user’s data.
This only removes from user data. Starter data entries cannot be removed (but can be overridden via
add_prompt).- Return type: