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