Class: Legion::Extensions::Llm::Transport::Messages::FleetResponse
- Inherits:
-
Transport::Message
- Object
- Transport::Message
- Legion::Extensions::Llm::Transport::Messages::FleetResponse
- Defined in:
- lib/legion/extensions/llm/transport/messages/fleet_response.rb
Overview
Correlated protocol-v3 response envelope for fleet reply queues. E3: carries the serialized Canonical::Response under :response. E4: thinking exclusion happens exactly once at the responder (ProviderResponder#publish_response); this envelope is a pass-through. 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
25 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 25 def app_id = @options[:app_id] || 'lex-llm' |
#correlation_id ⇒ Object
27 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 27 def correlation_id = @options[:correlation_id] |
#encrypt? ⇒ Boolean
24 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 24 def encrypt? = Fleet::Settings.value(:fleet, :compliance, :encrypt_fleet, default: true) == true |
#message ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 44 def super.merge( protocol_version: @options[: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], response: @options[:response], execution_contract: @options[:execution_contract], offering_id: @options[:offering_id] ).compact end |
#message_id ⇒ Object
28 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 28 def = @options[:message_id] ||= "llm_fleet_res_#{SecureRandom.uuid}" |
#reply_to ⇒ Object
26 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 26 def reply_to = @options[:reply_to] |
#routing_key ⇒ Object
30 31 32 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 30 def routing_key @options[:reply_to] || raise(ArgumentError, 'reply_to is required') end |
#type ⇒ Object
23 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 23 def type = Fleet::Protocol::RESPONSE_TYPE |
#validate ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/legion/extensions/llm/transport/messages/fleet_response.rb', line 34 def validate require_option!(:request_id) require_option!(:correlation_id) require_option!(:reply_to) require_option!(:response) require_protocol_version! @valid = true end |