Class: LLM::Shell::Options
- Inherits:
-
Object
- Object
- LLM::Shell::Options
- Defined in:
- lib/llm/shell/options.rb
Overview
The LLM::Shell::Options class represents the options provided to the shell at the command line, and the configuration file (if any). The command-line options take precedence over the configuration file.
Instance Method Summary collapse
-
#prompt ⇒ Object
-
#provider ⇒ Object
-
#tools ⇒ Object
-
#files ⇒ Object
-
#llm ⇒ Object
-
#bot ⇒ Object
-
#default ⇒ Object
-
#initialize(options, default) ⇒ LLM::Shell::Options
constructor
Constructor Details
#initialize(options, default) ⇒ LLM::Shell::Options
14 15 16 17 18 19 20 21 22 |
# File 'lib/llm/shell/options.rb', line 14 def initialize(, default) @options = .transform_keys(&:to_sym) @provider = @options.delete(:provider) @tools = @options.delete(:tools) @prompt = @options[:prompt] ? custom_prompt : default.prompt @files = Dir[*@options.delete(:files) || []].reject { File.directory?(_1) } @bot_options = {model: @options.delete(:model)}.compact @default = default end |
Instance Method Details
#prompt ⇒ Object
30 |
# File 'lib/llm/shell/options.rb', line 30 def prompt = File.read(@prompt) |
#provider ⇒ Object
24 |
# File 'lib/llm/shell/options.rb', line 24 def provider = @provider |
#tools ⇒ Object
25 |
# File 'lib/llm/shell/options.rb', line 25 def tools = @tools |
#files ⇒ Object
26 |
# File 'lib/llm/shell/options.rb', line 26 def files = @files |
#llm ⇒ Object
27 |
# File 'lib/llm/shell/options.rb', line 27 def llm = @options |
#bot ⇒ Object
28 |
# File 'lib/llm/shell/options.rb', line 28 def bot = @bot_options |
#default ⇒ Object
29 |
# File 'lib/llm/shell/options.rb', line 29 def default = @default |