class LittleGhost::Providers::OpenAICompatible::StreamError
Represents a structured error received inside an otherwise successful provider stream.
Attributes
Normalized provider error type and optional provider code.
Normalized provider error type and optional provider code.
Public Class Methods
# File lib/little_ghost/providers/openai_compatible.rb, line 48 def initialize(message, error_type: nil, code: nil) @error_type = error_type.to_s.strip.downcase @code = code super(message) end
Creates a structured stream error.
Calls superclass method
Public Instance Methods
Source
# File lib/little_ghost/providers/openai_compatible.rb, line 55 def retryable? return true if TRANSIENT_STREAM_ERROR_TYPES.include?(error_type) return true if code.to_s.strip.downcase == "server_error" status = Integer(code, exception: false) status == 408 || status == 429 || (status && status >= 500) end
Indicates whether LittleGhost may retry this provider error.