Class: Aircana::LLM::ClaudeClient

Inherits:
Object
  • Object
show all
Defined in:
lib/aircana/llm/claude_client.rb

Instance Method Summary collapse

Constructor Details

#initializeClaudeClient

Returns a new instance of ClaudeClient.



9
10
11
# File 'lib/aircana/llm/claude_client.rb', line 9

def initialize
  @spinner = nil
end

Instance Method Details

#prompt(text) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/aircana/llm/claude_client.rb', line 13

def prompt(text)
  start_spinner("Generating response with Claude...")

  begin
    result = execute_claude_command(text)
    success_spinner("Generated response with Claude")
    result.strip
  rescue StandardError => e
    error_spinner("Failed to generate response: #{e.message}")
    raise Error, "Claude request failed: #{e.message}"
  end
end