Class: RubyCode::Views::WebSearchApproval

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycode/views/web_search_approval.rb

Overview

Builds web search approval prompt display

Class Method Summary collapse

Class Method Details

.build(query:, max_results:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rubycode/views/web_search_approval.rb', line 9

def self.build(query:, max_results:)
  pastel = Pastel.new

  [
    "",
    pastel.cyan("━" * 80),
    pastel.bold.cyan("🔍 Web Search Request"),
    "#{pastel.cyan("Query:")} #{query}",
    "#{pastel.cyan("Max results:")} #{max_results}",
    pastel.cyan("─" * 80),
    pastel.yellow("This will make HTTP requests to:"),
    pastel.dim("  • DuckDuckGo Instant Answer API (free)"),
    pastel.dim("  • Brave Search API (if BRAVE_API_KEY is set)"),
    pastel.dim("  • Each result URL (HEAD request to verify)"),
    "",
    pastel.cyan("━" * 80)
  ].join("\n")
end