arioso.schema#
Machine-readable parameter schemas: what each platform accepts, as JSON Schema.
A front end, an agent or a form generator needs more than the parameter names: it
needs each parameter’s type, its bounds or choices, a display title and whether it
is shared across platforms. param_schema() assembles that from the two places
arioso already keeps it, so nothing is restated:
common parameters are the unified affordances (
arioso.base.AFFORDANCES) a platform lists insupported_affordances; their type, description and bounds come from the affordance, overridden by the platform’sparam_mapentry (title,description,minimum/min,maximum/max,choices,default,type).extra parameters are the platform’s own
adapter_params. A platform may declare them as a dict of name to spec (the same keys as aparam_mapentry,typebeing a Python type); a bare list of names is still accepted, and such extras are markeduntypedso a form can leave them out.
native_default is never used as a default: it is in the platform’s units
(milliseconds, a noise level), not the unified ones. A unified default is the
default key.
Example:
>>> schema = param_schema("sunoapi")
>>> schema["properties"]["weirdness"]["x-arioso"]["group"]
'extra'
>>> schema["properties"]["audio_input_strength"]["maximum"]
1
Module Attributes
Affordances whose value is audio (a file, bytes, a waveform), not a scalar. |
|
Affordances that steer the call rather than the music; left out of schemas. |
|
Operations a platform supports, from the affordance that enables each. |
|
Extras that steer the call (transport, process, device), not the music; left out of schemas. |
Functions
|
The unified parameters every one of |
|
What a platform can do, from its config: |
|
The JSON Schema (draft 2020-12) of the parameters |
|
The JSON Schema of a platform config (see |
- arioso.schema.AUDIO_AFFORDANCES = frozenset({'audio_input', 'melody', 'reference_audio'})#
Affordances whose value is audio (a file, bytes, a waveform), not a scalar.
- arioso.schema.MECHANICS_AFFORDANCES = frozenset({'wait_for_completion'})#
Affordances that steer the call rather than the music; left out of schemas.
- arioso.schema.MECHANICS_EXTRAS = frozenset({'device', 'fetch', 'runtime', 'timeout'})#
Extras that steer the call (transport, process, device), not the music; left out of schemas. A spec can also say
"mechanics": True.
- arioso.schema.OPERATION_AFFORDANCES = {'cover': 'audio_input', 'extend': 'continue_from', 'inpaint': 'mask_start', 'melody': 'melody', 'style_reference': 'reference_audio'}#
Operations a platform supports, from the affordance that enables each.
- arioso.schema.common_params(platforms)[source]#
The unified parameters every one of
platformssupports, in the first one’s order.Use it to lay out the part of a form that does not change when the user switches platform.
- arioso.schema.operations(config)[source]#
What a platform can do, from its config:
generateplus the operations its supported affordances enable (coverforaudio_input, …), or the config’s ownoperationslist when it declares one.>>> operations({"supported_affordances": ["prompt", "audio_input"]}) ['generate', 'cover']
- arioso.schema.param_schema(platform)[source]#
The JSON Schema (draft 2020-12) of the parameters
platformaccepts.Each property carries
x-arioso.group:"common"for a unified affordance (the same name on every platform that has it) or"extra"for a parameter only this platform has. The schema’s ownx-ariosolists both groups and the platform’soperations. Reads the config only, so no adapter or optional dependency is loaded.- Parameters:
platform (
str) – Platform identifier (seearioso.list_platforms()).- Return type:
- Returns:
A JSON-ready dict.
- arioso.schema.schema_from_config(config)[source]#
The JSON Schema of a platform config (see
param_schema()).- Return type: