(query: string)
| 76 | return JSON.stringify({ type: 'ticker', data: ticker }); |
| 77 | } |
| 78 | export async function searchSong(query: string): Promise<string> { |
| 79 | const items = await api.search(query, ["track"]); |
| 80 | const track = items.tracks.items[0]; |
| 81 | if (track) { |
| 82 | const trackId = track.uri.replace('spotify:track:', ''); |
| 83 | return JSON.stringify({ trackId: trackId }); |
| 84 | } else { |
| 85 | return JSON.stringify({ error: "No matching song found." }); |
| 86 | } |
| 87 | } |
| 88 | export async function functionCalling(query: string) { |
| 89 | try { |
| 90 | const messages = [ |
nothing calls this directly
no outgoing calls
no test coverage detected