Class: OmniAI::Google::StreamError
- Inherits:
-
Error
- Object
- Error
- OmniAI::Google::StreamError
- Defined in:
- lib/omniai/google/stream_error.rb
Overview
Raised when a streamed generation does not complete.
Deliberately has no #response: the request returned 200 and the failure arrived inside
the stream. Consumers branch on that to decide whether to retry.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#provider_message ⇒ String?
readonly
Google's own explanation of the failure, verbatim.
Instance Method Summary collapse
-
#initialize(message = nil, provider_message: nil) ⇒ StreamError
constructor
A new instance of StreamError.
Constructor Details
#initialize(message = nil, provider_message: nil) ⇒ StreamError
Returns a new instance of StreamError.
22 23 24 25 |
# File 'lib/omniai/google/stream_error.rb', line 22 def initialize( = nil, provider_message: nil) @provider_message = super() end |
Instance Attribute Details
#provider_message ⇒ String? (readonly)
Google's own explanation of the failure, verbatim.
Named for what it holds rather than borrowing value from FinishReason, which is a
provider enum rather than prose. Kept off #message because consumers log that and
this text can echo request content -- a deliberate departure from HTTPError, which puts
the whole response body into its message.
18 19 20 |
# File 'lib/omniai/google/stream_error.rb', line 18 def @provider_message end |