Class: Ace::LLM::CLI::Commands::Query
- Inherits:
-
Support::Cli::Command
- Object
- Support::Cli::Command
- Ace::LLM::CLI::Commands::Query
- Includes:
- Support::Cli::Base
- Defined in:
- lib/ace/llm/cli/commands/query.rb
Overview
Query command for ace-llm
Instance Method Summary collapse
Instance Method Details
#call(provider_model: nil, prompt_text: nil, **options) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ace/llm/cli/commands/query.rb', line 40 def call(provider_model: nil, prompt_text: nil, **) if [:version] puts "ace-llm #{Ace::LLM::VERSION}" return end if [:list_providers] list_providers return end @provider_model = provider_model if @provider_model.nil? && [:model] @provider_model = [:model] @model_from_option = true end @prompt = [:prompt] || prompt_text return show_help if @provider_model.nil? && @prompt.nil? return show_provider_help if @prompt.nil? || @prompt.empty? return show_help if @provider_model.nil? || @provider_model.empty? display_config_summary() execute_query() rescue Ace::LLM::Error => e raise Ace::Support::Cli::Error.new(e.) rescue ArgumentError, EncodingError => e raise Ace::Support::Cli::Error.new(e.) end |