Class: Legion::Extensions::Llm::Transport::Messages::RegistryEvent
- Inherits:
-
Transport::Message
- Object
- Transport::Message
- Legion::Extensions::Llm::Transport::Messages::RegistryEvent
- Defined in:
- lib/legion/extensions/llm/transport/messages/registry_event.rb
Overview
Publishes lex-llm RegistryEvent envelopes to the shared llm.registry exchange. Accepts a ‘provider_family` for constructing the app_id and routing key.
Instance Method Summary collapse
- #app_id ⇒ Object
- #exchange ⇒ Object
-
#initialize(event:, provider_family: nil, **options) ⇒ RegistryEvent
constructor
A new instance of RegistryEvent.
-
#persistent ⇒ Object
rubocop:disable Naming/PredicateMethod.
- #routing_key ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(event:, provider_family: nil, **options) ⇒ RegistryEvent
Returns a new instance of RegistryEvent.
15 16 17 18 |
# File 'lib/legion/extensions/llm/transport/messages/registry_event.rb', line 15 def initialize(event:, provider_family: nil, **) @provider_family = provider_family super(**event.to_h.merge()) end |
Instance Method Details
#app_id ⇒ Object
32 33 34 |
# File 'lib/legion/extensions/llm/transport/messages/registry_event.rb', line 32 def app_id @options[:app_id] || "lex-llm-#{@provider_family || 'unknown'}" end |
#exchange ⇒ Object
20 21 22 |
# File 'lib/legion/extensions/llm/transport/messages/registry_event.rb', line 20 def exchange Exchanges::LlmRegistry end |
#persistent ⇒ Object
rubocop:disable Naming/PredicateMethod
36 37 38 |
# File 'lib/legion/extensions/llm/transport/messages/registry_event.rb', line 36 def persistent # rubocop:disable Naming/PredicateMethod false end |
#routing_key ⇒ Object
24 25 26 |
# File 'lib/legion/extensions/llm/transport/messages/registry_event.rb', line 24 def routing_key @options[:routing_key] || "llm.registry.#{@options.fetch(:event_type)}" end |
#type ⇒ Object
28 29 30 |
# File 'lib/legion/extensions/llm/transport/messages/registry_event.rb', line 28 def type 'llm.registry.event' end |