Class: Langfuse::CLI::Commands::Scores

Inherits:
Thor
  • Object
show all
Defined in:
lib/langfuse/cli/commands/scores.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/langfuse/cli/commands/scores.rb', line 9

def self.exit_on_failure?
  true
end

Instance Method Details

#get(score_id) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/langfuse/cli/commands/scores.rb', line 32

def get(score_id)
  score = client.get_score(score_id)
  output_result(score)
rescue Client::NotFoundError => e
  puts "Error: Score not found - #{score_id}"
  exit 1
rescue Client::APIError => e
  puts "Error: #{e.message}"
  exit 1
end

#listObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/langfuse/cli/commands/scores.rb', line 19

def list
  filters = build_filters(options)
  scores = client.list_scores(filters)
  output_result(scores)
rescue Client::AuthenticationError => e
  puts "Authentication Error: #{e.message}"
  exit 1
rescue Client::APIError => e
  puts "Error: #{e.message}"
  exit 1
end