Class: Legion::Extensions::Llm::Transport::Messages::FleetError
- Inherits:
-
Transport::Message
- Object
- Transport::Message
- Legion::Extensions::Llm::Transport::Messages::FleetError
- Defined in:
- lib/legion/extensions/llm/transport/messages/fleet_error.rb
Overview
Correlated protocol-v3 error envelope for fleet reply queues (E6). E5: no aliases — provider_instance only.
Constant Summary
Constants included from Fleet::DefaultExchangeReply
Fleet::DefaultExchangeReply::DEFAULT_REPLY_PUBLISH_OPTIONS
Instance Method Summary collapse
- #app_id ⇒ Object
- #correlation_id ⇒ Object
- #encrypt? ⇒ Boolean
- #message ⇒ Object
- #message_id ⇒ Object
- #reply_to ⇒ Object
- #routing_key ⇒ Object
- #type ⇒ Object
- #validate ⇒ Object
Methods included from Fleet::DefaultExchangeReply
Instance Method Details
#app_id ⇒ Object
22 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 22 def app_id = @options[:app_id] || 'lex-llm' |
#correlation_id ⇒ Object
24 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 24 def correlation_id = @options[:correlation_id] |
#encrypt? ⇒ Boolean
21 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 21 def encrypt? = Fleet::Settings.value(:fleet, :compliance, :encrypt_fleet, default: true) == true |
#message ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 41 def super.merge( protocol_version: @options[:protocol_version] || Fleet::Protocol::VERSION, request_id: @options[:request_id], correlation_id: correlation_id, idempotency_key: @options[:idempotency_key], operation: @options[:operation], provider: @options[:provider], provider_instance: @options[:provider_instance], model: @options[:model], reply_to: reply_to, message_context: @options[:message_context], trace_context: @options[:trace_context], code: @options[:code], message: @options[:message], error_class: @options[:error_class], retryable: @options[:retryable], metadata: @options[:metadata] || {}, execution_contract: @options[:execution_contract], offering_id: @options[:offering_id] ).compact end |
#message_id ⇒ Object
25 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 25 def = @options[:message_id] ||= "llm_fleet_err_#{SecureRandom.uuid}" |
#reply_to ⇒ Object
23 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 23 def reply_to = @options[:reply_to] |
#routing_key ⇒ Object
27 28 29 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 27 def routing_key @options[:reply_to] || raise(ArgumentError, 'reply_to is required') end |
#type ⇒ Object
20 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 20 def type = Fleet::Protocol::ERROR_TYPE |
#validate ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_error.rb', line 31 def validate require_option!(:request_id) require_option!(:correlation_id) require_option!(:reply_to) require_option!(:code) require_protocol_version! @valid = true end |