Class: Relay::Tools::JukeBox

Inherits:
LLM::Tool
  • Object
show all
Includes:
Relay::Tool
Defined in:
app/tools/juke_box.rb

Overview

Returns the built-in jukebox playlist and embeddable iframe HTML for each track. The playlist is stored in the songs table.

Instance Method Summary collapse

Methods included from Relay::Tool

#root

Instance Method Details

#callArray<Hash>

Returns:

  • (Array<Hash>)


15
16
17
18
19
20
21
22
23
24
25
# File 'app/tools/juke_box.rb', line 15

def call
  jukebox.load.map do |entry|
    {
      name: entry["name"],
      title: entry["title"],
      track: entry["track"],
      html: Relay.erb("fragments/_iframe.erb", {entry:}),
      directions:,
    }
  end
end