Class: Legion::Extensions::Llm::Openai::Actor::DiscoveryRefresh

Inherits:
Actors::Every
  • Object
show all
Includes:
Helpers::Lex, DiscoveryDrafts, DiscoveryEvidenceBuilders, DiscoveryHealthDisplay, DiscoveryIdentity, DiscoveryProbeReporting, DiscoveryProbing, DiscoveryTransport, DiscoveryWeightPublication, Logging::Helper
Defined in:
lib/legion/extensions/llm/openai/actors/discovery_refresh.rb

Overview

SSOT v3 periodic discovery actor for OpenAI provider instances. Claims configured instances, discovers models via /v1/models, probes readiness via /v1/models, and publishes complete OfferingDraft snapshots through the Inventory::Publisher.

Instance identity is the operator's CONFIG NAME (InstanceKey.instance_id) — the key the router uses for instances. settings lookups and per-instance tuning. The derived host:port/credential-fingerprint is the secondary physical_id (dedup/diagnostics only); two config names at the same endpoint stay distinct instances.

Constant Summary

Constants included from DiscoveryHealthDisplay

DiscoveryHealthDisplay::LEGACY_CAPABILITY_NAMES

Constants included from DiscoveryDrafts

DiscoveryDrafts::EVIDENCE_MAP_FIELDS, DiscoveryDrafts::VALUE_EVIDENCE_FIELDS

Constants included from DiscoveryEvidenceBuilders

DiscoveryEvidenceBuilders::STANDARD_CAPABILITY_CHECKS

Instance Method Summary collapse

Instance Method Details

#check_subtask?Boolean

Returns:

  • (Boolean)


68
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 68

def check_subtask?  = false

#generate_task?Boolean

Returns:

  • (Boolean)


69
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 69

def generate_task?  = false

#manualObject



75
76
77
78
79
80
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 75

def manual
  initialize_weight_publication
  tick_refresh
rescue StandardError => e
  handle_exception(e, level: :warn, operation: 'openai.actor.discovery_refresh')
end

#run_now?Boolean

Returns:

  • (Boolean)


66
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 66

def run_now?        = true

#runner_classObject



64
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 64

def runner_class    = self.class

#runner_functionObject



65
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 65

def runner_function = 'manual'

#shutdownObject



82
83
84
85
86
87
88
89
90
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 82

def shutdown
  return unless @instance_states

  instance_states_snapshot.each_key { |instance_id| remove_instance_state(instance_id) }
  @instance_state_mutex.synchronize do
    @instance_states.clear
    @dormant_weight_tracker.clear!
  end
end

#timeObject



71
72
73
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 71

def time
  discovery_interval_seconds
end

#use_runner?Boolean

Returns:

  • (Boolean)


67
# File 'lib/legion/extensions/llm/openai/actors/discovery_refresh.rb', line 67

def use_runner?     = false