Class: Legion::TTY::Background::LlmProbe
- Inherits:
-
Object
- Object
- Legion::TTY::Background::LlmProbe
- Includes:
- Logging::Helper
- Defined in:
- lib/legion/tty/background/llm_probe.rb
Instance Method Summary collapse
-
#initialize(logger: nil, wait_queue: nil) ⇒ LlmProbe
constructor
A new instance of LlmProbe.
- #run_async(queue) ⇒ Object
Constructor Details
#initialize(logger: nil, wait_queue: nil) ⇒ LlmProbe
Returns a new instance of LlmProbe.
11 12 13 14 |
# File 'lib/legion/tty/background/llm_probe.rb', line 11 def initialize(logger: nil, wait_queue: nil) @boot_log = logger @wait_queue = wait_queue end |
Instance Method Details
#run_async(queue) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/legion/tty/background/llm_probe.rb', line 16 def run_async(queue) Thread.new do wait_for_bootstrap if @wait_queue result = probe_providers queue.push({ data: result }) rescue StandardError => e @boot_log&.log('llm_probe', "error: #{e.}") queue.push({ data: { providers: [], error: e. } }) end end |