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
- #bot ⇒ Object
- #default ⇒ Object
- #files ⇒ Object
- #initialize(options, default) ⇒ LLM::Shell::Options constructor
- #llm ⇒ Object
- #prompt ⇒ Object
- #provider ⇒ Object
- #tools ⇒ Object
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
#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 |
#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 |
#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 |