mirror of
https://github.com/katanemo/plano.git
synced 2026-06-23 15:38:07 +02:00
updated the search API for spotify in the demo
This commit is contained in:
parent
8f29210688
commit
e9d69e4f7b
1 changed files with 85 additions and 15 deletions
|
|
@ -10,13 +10,72 @@ endpoints:
|
||||||
protocol: https
|
protocol: https
|
||||||
|
|
||||||
system_prompt: |
|
system_prompt: |
|
||||||
You are a music assistant. Your job is to extract critical details from a Spotify's API response and generate Markdown that I can easily display in a gradio chat bot.
|
I have the following JSON data representing a list of albums from Spotify:
|
||||||
For each item in the JSON response, I want the following in Markdown in separate lines
|
|
||||||
- album art scaled to 25% of original size. Use an <img> tag
|
|
||||||
- The title of the item and its release date (release dates only for albums)
|
|
||||||
- A hyperlink to spotify displayed as "Listen on Spotify"
|
|
||||||
|
|
||||||
Make sure each item is separated by <hr>, and there are no markdown bullet points and remove any descriptive labels from data.
|
{
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"album_type": "album",
|
||||||
|
"artists": [
|
||||||
|
{
|
||||||
|
"external_urls": {
|
||||||
|
"spotify": "https://open.spotify.com/artist/06HL4z0CvFAxyc27GXpf02"
|
||||||
|
},
|
||||||
|
"href": "https://api.spotify.com/v1/artists/06HL4z0CvFAxyc27GXpf02",
|
||||||
|
"id": "06HL4z0CvFAxyc27GXpf02",
|
||||||
|
"name": "Taylor Swift",
|
||||||
|
"type": "artist",
|
||||||
|
"uri": "spotify:artist:06HL4z0CvFAxyc27GXpf02"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"available_markets": [ /* ... markets omitted for brevity ... */ ],
|
||||||
|
"external_urls": {
|
||||||
|
"spotify": "https://open.spotify.com/album/1Mo4aZ8pdj6L1jx8zSwJnt"
|
||||||
|
},
|
||||||
|
"href": "https://api.spotify.com/v1/albums/1Mo4aZ8pdj6L1jx8zSwJnt",
|
||||||
|
"id": "1Mo4aZ8pdj6L1jx8zSwJnt",
|
||||||
|
"images": [
|
||||||
|
{
|
||||||
|
"height": 300,
|
||||||
|
"url": "https://i.scdn.co/image/ab67616d00001e025076e4160d018e378f488c33",
|
||||||
|
"width": 300
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"height": 64,
|
||||||
|
"url": "https://i.scdn.co/image/ab67616d000048515076e4160d018e378f488c33",
|
||||||
|
"width": 64
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"height": 640,
|
||||||
|
"url": "https://i.scdn.co/image/ab67616d0000b2735076e4160d018e378f488c33",
|
||||||
|
"width": 640
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "THE TORTURED POETS DEPARTMENT",
|
||||||
|
"release_date": "2024-04-18",
|
||||||
|
"release_date_precision": "day",
|
||||||
|
"total_tracks": 16,
|
||||||
|
"type": "album",
|
||||||
|
"uri": "spotify:album:1Mo4aZ8pdj6L1jx8zSwJnt"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
Please convert this JSON into Markdown with the following layout for each album:
|
||||||
|
|
||||||
|
- Display the album image (using Markdown image syntax) first.
|
||||||
|
- On the next line immediately after the image, display the album title, artist name (use the first artist listed), and the release date, all separated by a hyphen or another clear delimiter.
|
||||||
|
- On the next line, provide the Spotify link (using Markdown link syntax).
|
||||||
|
|
||||||
|
For example, the output should look similar to this (using the data above):
|
||||||
|
|
||||||
|

|
||||||
|
**THE TORTURED POETS DEPARTMENT**
|
||||||
|
Taylor Swift - 2024-04-18
|
||||||
|
[Listen on Spotify](https://open.spotify.com/album/1Mo4aZ8pdj6L1jx8zSwJnt)
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
Make sure your output is valid Markdown. And don't say "formatted in Markdown". Thanks!
|
||||||
|
|
||||||
llm_providers:
|
llm_providers:
|
||||||
- name: OpenAI
|
- name: OpenAI
|
||||||
|
|
@ -26,10 +85,10 @@ llm_providers:
|
||||||
default: true
|
default: true
|
||||||
|
|
||||||
prompt_targets:
|
prompt_targets:
|
||||||
- name: browse_new_releases
|
- name: get_new_releases
|
||||||
parameters:
|
parameters:
|
||||||
- name: country
|
- name: country
|
||||||
description: the country to select
|
description: the country where the album is released
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
in_path: true
|
in_path: true
|
||||||
|
|
@ -38,18 +97,29 @@ prompt_targets:
|
||||||
path: /v1/browse/new-releases?country={country}&limit=5
|
path: /v1/browse/new-releases?country={country}&limit=5
|
||||||
http_headers:
|
http_headers:
|
||||||
Authorization: "Bearer $SPOTIFY_CLIENT_KEY"
|
Authorization: "Bearer $SPOTIFY_CLIENT_KEY"
|
||||||
description: browse new releases
|
description: Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).
|
||||||
|
|
||||||
- name: search_podcasts
|
- name: search_for_shows_and_podcasts
|
||||||
parameters:
|
parameters:
|
||||||
- name: type
|
- name: q
|
||||||
description: the type of search podcasts
|
description: The search filter to narrow down results
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
in_path: true
|
- name: type
|
||||||
|
type: str
|
||||||
|
description: The type of catalog item
|
||||||
|
default: show
|
||||||
|
- name: market
|
||||||
|
type: str
|
||||||
|
description: A country code
|
||||||
|
default: US
|
||||||
|
- name: limit
|
||||||
|
type: integer
|
||||||
|
description: The maximum number of results to return
|
||||||
|
default: "5"
|
||||||
endpoint:
|
endpoint:
|
||||||
name: spotify
|
name: spotify
|
||||||
path: /v1/search?q={type}&type=show&limit=5&market=US
|
path: /v1/search
|
||||||
http_headers:
|
http_headers:
|
||||||
Authorization: "Bearer $SPOTIFY_CLIENT_KEY"
|
Authorization: "Bearer $SPOTIFY_CLIENT_KEY"
|
||||||
description: search podcasts
|
description: get Spotify catalog information about shows and podcasts that match the keyword filter.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue