Class: Legion::LLM::Fleet::Error
- Inherits:
-
Transport::Message
- Object
- Transport::Message
- Transport::Message
- Legion::LLM::Fleet::Error
- Defined in:
- lib/legion/llm/fleet/error.rb
Constant Summary collapse
- ERROR_CODES =
%w[ model_not_loaded ollama_unavailable inference_failed inference_timeout invalid_token token_expired payload_too_large unsupported_type unsupported_streaming no_fleet_queue fleet_backpressure fleet_timeout ].freeze
Constants inherited from Transport::Message
Transport::Message::LLM_ENVELOPE_KEYS
Instance Method Summary collapse
- #encrypt? ⇒ Boolean
- #expiration ⇒ Object
- #headers ⇒ Object
- #priority ⇒ Object
-
#publish(options = @options) ⇒ Object
Same default-exchange override as Fleet::Response.
- #routing_key ⇒ Object
- #type ⇒ Object
Methods inherited from Transport::Message
#app_id, #correlation_id, #message, #message_context, #message_id, #tracing_headers
Instance Method Details
#encrypt? ⇒ Boolean
19 |
# File 'lib/legion/llm/fleet/error.rb', line 19 def encrypt? = false |
#expiration ⇒ Object
18 |
# File 'lib/legion/llm/fleet/error.rb', line 18 def expiration = nil |
#headers ⇒ Object
21 22 23 |
# File 'lib/legion/llm/fleet/error.rb', line 21 def headers super.merge(error_headers).merge(tracing_headers) end |
#priority ⇒ Object
17 |
# File 'lib/legion/llm/fleet/error.rb', line 17 def priority = 0 |
#publish(options = @options) ⇒ Object
Same default-exchange override as Fleet::Response.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/legion/llm/fleet/error.rb', line 26 def publish( = @options) raise unless @valid validate_payload_size channel.default_exchange.publish( , routing_key: routing_key, content_type: [:content_type] || content_type, content_encoding: [:content_encoding] || content_encoding, headers: headers, type: type, priority: priority, message_id: , correlation_id: correlation_id, app_id: app_id, timestamp: ) rescue Bunny::ConnectionClosedError, Bunny::ChannelAlreadyClosed, Bunny::NetworkErrorWrapper, IOError, Timeout::Error => e (e) end |
#routing_key ⇒ Object
16 |
# File 'lib/legion/llm/fleet/error.rb', line 16 def routing_key = @options[:reply_to] |
#type ⇒ Object
15 |
# File 'lib/legion/llm/fleet/error.rb', line 15 def type = 'llm.fleet.error' |