Class: Legion::Extensions::Llm::RegistryEventBuilder
- Inherits:
-
Object
- Object
- Legion::Extensions::Llm::RegistryEventBuilder
- Includes:
- Logging::Helper
- Defined in:
- lib/legion/extensions/llm/registry_event_builder.rb
Overview
Builds sanitized lex-llm registry envelopes for provider state. Parameterized by ‘provider_family` so each lex-llm-* gem can reuse this class without defining its own copy.
Instance Attribute Summary collapse
-
#provider_family ⇒ Object
readonly
Returns the value of attribute provider_family.
Instance Method Summary collapse
-
#initialize(provider_family:) ⇒ RegistryEventBuilder
constructor
A new instance of RegistryEventBuilder.
- #model_available(model, readiness:) ⇒ Object
- #readiness(readiness) ⇒ Object
Constructor Details
#initialize(provider_family:) ⇒ RegistryEventBuilder
Returns a new instance of RegistryEventBuilder.
14 15 16 |
# File 'lib/legion/extensions/llm/registry_event_builder.rb', line 14 def initialize(provider_family:) @provider_family = provider_family.to_s.downcase.to_sym end |
Instance Attribute Details
#provider_family ⇒ Object (readonly)
Returns the value of attribute provider_family.
12 13 14 |
# File 'lib/legion/extensions/llm/registry_event_builder.rb', line 12 def provider_family @provider_family end |
Instance Method Details
#model_available(model, readiness:) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/legion/extensions/llm/registry_event_builder.rb', line 28 def model_available(model, readiness:) registry_event_class.available( model_offering(model), runtime: , health: model_health(readiness), metadata: (model) ) end |
#readiness(readiness) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/legion/extensions/llm/registry_event_builder.rb', line 18 def readiness(readiness) registry_event_class.public_send( readiness[:ready] ? :available : :unavailable, provider_offering(readiness), runtime: , health: readiness_health(readiness), metadata: (readiness) ) end |