Create a Bass heavy playlist with at least 30 songs, 80% of which I like and haven't heard before.
{
"additionalProperties": false,
"properties": {
"constraints": {
"additionalProperties": false,
"properties": {
"allow_explicit": {
"default": true,
"type": "boolean"
},
"max_tracks_per_artist": {
"default": 2,
"minimum": 1,
"type": "integer"
},
"min_tracks": {
"default": 30,
"minimum": 30,
"type": "integer"
},
"percent_new_and_predicted_like": {
"default": 0.8,
"maximum": 1,
"minimum": 0.8,
"type": "number"
},
"predicted_like_threshold": {
"default": 0.7,
"maximum": 1,
"minimum": 0,
"type": "number"
},
"region": {
"type": "string"
}
},
"required": [
"min_tracks",
"percent_new_and_predicted_like"
],
"type": "object"
},
"explanations": {
"default": true,
"type": "boolean"
},
"seeds": {
"additionalProperties": false,
"properties": {
"artists": {
"items": {
"type": "string"
},
"type": "array"
},
"genres": {
"items": {
"type": "string"
},
"type": "array"
},
"tracks": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"sonic_profile": {
"additionalProperties": false,
"properties": {
"bass_heavy": {
"default": true,
"type": "boolean"
},
"min_bass_score": {
"default": 0.7,
"maximum": 1,
"minimum": 0,
"type": "number"
}
},
"required": [
"bass_heavy"
],
"type": "object"
},
"user_profile": {
"additionalProperties": false,
"properties": {
"heard_track_ids": {
"items": {
"type": "string"
},
"type": "array"
},
"liked_artists": {
"items": {
"type": "string"
},
"type": "array"
},
"liked_genres": {
"items": {
"type": "string"
},
"type": "array"
},
"liked_tracks": {
"items": {
"type": "string"
},
"type": "array"
},
"user_id": {
"type": "string"
}
},
"type": "object"
}
},
"required": [
"constraints"
],
"type": "object"
}
{
"additionalProperties": false,
"properties": {
"applied_constraints": {
"additionalProperties": false,
"properties": {
"max_tracks_per_artist": {
"minimum": 1,
"type": "integer"
},
"min_bass_score": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"min_tracks": {
"minimum": 30,
"type": "integer"
},
"percent_new_and_predicted_like": {
"maximum": 1,
"minimum": 0.8,
"type": "number"
},
"predicted_like_threshold": {
"maximum": 1,
"minimum": 0,
"type": "number"
}
},
"required": [
"min_tracks",
"percent_new_and_predicted_like",
"predicted_like_threshold",
"min_bass_score",
"max_tracks_per_artist"
],
"type": "object"
},
"created_at": {
"format": "date-time",
"type": "string"
},
"description": {
"type": "string"
},
"failed_constraints": {
"items": {
"type": "string"
},
"type": "array"
},
"metrics": {
"additionalProperties": false,
"properties": {
"avg_bass_score": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"constraints_satisfied": {
"type": "boolean"
},
"min_bass_score_met": {
"type": "boolean"
},
"notes": {
"type": "string"
},
"novel_like_count": {
"minimum": 0,
"type": "integer"
},
"novel_like_rate": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"playlist_length": {
"minimum": 30,
"type": "integer"
}
},
"required": [
"playlist_length",
"novel_like_count",
"novel_like_rate",
"avg_bass_score",
"min_bass_score_met",
"constraints_satisfied"
],
"type": "object"
},
"title": {
"type": "string"
},
"tracks": {
"items": {
"additionalProperties": false,
"properties": {
"album": {
"type": "string"
},
"artist": {
"type": "string"
},
"audio_preview_url": {
"format": "uri",
"type": "string"
},
"bass_score": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"duration_ms": {
"type": "integer"
},
"genre_tags": {
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"type": "string"
},
"is_new_to_user": {
"type": "boolean"
},
"predicted_like_score": {
"maximum": 1,
"minimum": 0,
"type": "number"
},
"reason": {
"type": "string"
},
"release_year": {
"type": "integer"
},
"source": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"id",
"title",
"artist",
"is_new_to_user",
"bass_score",
"predicted_like_score"
],
"type": "object"
},
"minItems": 30,
"type": "array"
}
},
"required": [
"title",
"tracks",
"metrics",
"applied_constraints"
],
"type": "object"
}
{
"assertions": [
{
"description": "At least the requested number of tracks",
"left": "$.metrics.playlist_length",
"op": "\u003e=",
"right": "$.applied_constraints.min_tracks"
},
{
"description": "\u2265 required share are BOTH new-to-user and predicted likes",
"left": "$.metrics.novel_like_rate",
"op": "\u003e=",
"right": "$.applied_constraints.percent_new_and_predicted_like"
},
{
"description": "Bass focus achieved",
"left": "$.metrics.avg_bass_score",
"op": "\u003e=",
"right": "$.applied_constraints.min_bass_score"
},
{
"args": [
"$.tracks[*].artist"
],
"description": "No artist exceeds the per-artist cap",
"fn": "max_group_count",
"op": "\u003c=",
"right": "$.applied_constraints.max_tracks_per_artist"
},
{
"args": [
"$.tracks[*]",
[
"id",
"title",
"artist",
"is_new_to_user",
"bass_score",
"predicted_like_score"
]
],
"description": "Each track includes mandatory fields",
"fn": "forall_has_keys",
"op": "==",
"right": true
}
],
"engine": "jsonpath-assertions",
"on_fail": "Set constraints_satisfied=false and list descriptions in failed_constraints"
}