Class: Langfuse::CLI::Commands::Metrics
- Inherits:
-
Thor
- Object
- Thor
- Langfuse::CLI::Commands::Metrics
- Extended by:
- T::Sig
- Defined in:
- lib/langfuse/cli/commands/metrics.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
13 14 15 |
# File 'lib/langfuse/cli/commands/metrics.rb', line 13 def self.exit_on_failure? true end |
Instance Method Details
#query ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/langfuse/cli/commands/metrics.rb', line 74 def query query_params = build_query() result = client.query_metrics(query_params) # Extract data from result if it's wrapped in a data key output_data = result.is_a?(Hash) && result['data'] ? result['data'] : result output_result(output_data) rescue Client::AuthenticationError => e puts "Authentication Error: #{e.}" exit 1 rescue Client::APIError => e puts "Error: #{e.}" exit 1 end |