Class: Legion::Extensions::Llm::Ollama::Actor::DiscoveryRefresh
- Inherits:
-
Actors::Every
- Object
- Actors::Every
- Legion::Extensions::Llm::Ollama::Actor::DiscoveryRefresh
- Includes:
- Logging::Helper
- Defined in:
- lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb
Constant Summary collapse
- REFRESH_INTERVAL =
1800
Instance Method Summary collapse
- #check_subtask? ⇒ Boolean
- #generate_task? ⇒ Boolean
- #manual ⇒ Object
- #run_now? ⇒ Boolean
- #runner_class ⇒ Object
- #runner_function ⇒ Object
- #time ⇒ Object
- #use_runner? ⇒ Boolean
Instance Method Details
#check_subtask? ⇒ Boolean
25 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 25 def check_subtask? = false |
#generate_task? ⇒ Boolean
26 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 26 def generate_task? = false |
#manual ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 34 def manual log.debug('[ollama][discovery_refresh] refreshing model list') return unless defined?(Legion::LLM::Discovery) Legion::LLM::Discovery.run if defined?(Legion::LLM::Router) && Legion::LLM::Router.respond_to?(:populate_auto_rules) Legion::LLM::Router.populate_auto_rules(Legion::LLM::Discovery.discovered_instances) end if defined?(Legion::LLM::Inventory) && Legion::LLM::Inventory.respond_to?(:invalidate_offerings_cache!) Legion::LLM::Inventory.invalidate_offerings_cache! end rescue StandardError => e handle_exception(e, level: :warn, handled: true, operation: 'ollama.actor.discovery_refresh') end |
#run_now? ⇒ Boolean
23 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 23 def run_now? = true |
#runner_class ⇒ Object
21 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 21 def runner_class = self.class |
#runner_function ⇒ Object
22 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 22 def runner_function = 'manual' |
#time ⇒ Object
28 29 30 31 32 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 28 def time return REFRESH_INTERVAL unless defined?(Legion::Settings) Legion::Settings.dig(:extensions, :llm, :ollama, :discovery_interval) || REFRESH_INTERVAL end |
#use_runner? ⇒ Boolean
24 |
# File 'lib/legion/extensions/llm/ollama/actors/discovery_refresh.rb', line 24 def use_runner? = false |