Class: OpenAICompatibleErrors::StreamState
- Inherits:
-
Struct
- Object
- Struct
- OpenAICompatibleErrors::StreamState
- Defined in:
- lib/openai_compatible_errors/sse.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#events_seen ⇒ Object
Returns the value of attribute events_seen.
-
#has_output ⇒ Object
Returns the value of attribute has_output.
-
#malformed_events ⇒ Object
Returns the value of attribute malformed_events.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#termination ⇒ Object
Returns the value of attribute termination.
Instance Method Summary collapse
- #done? ⇒ Boolean
- #incomplete? ⇒ Boolean
-
#initialize(events_seen: 0, malformed_events: 0, has_output: false, protocol: :unknown, termination: :open, error: nil) ⇒ StreamState
constructor
A new instance of StreamState.
- #unexpected_eof? ⇒ Boolean
Constructor Details
#initialize(events_seen: 0, malformed_events: 0, has_output: false, protocol: :unknown, termination: :open, error: nil) ⇒ StreamState
Returns a new instance of StreamState.
8 9 10 11 12 |
# File 'lib/openai_compatible_errors/sse.rb', line 8 def initialize(events_seen: 0, malformed_events: 0, has_output: false, protocol: :unknown, termination: :open, error: nil) super freeze end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
6 7 8 |
# File 'lib/openai_compatible_errors/sse.rb', line 6 def error @error end |
#events_seen ⇒ Object
Returns the value of attribute events_seen
6 7 8 |
# File 'lib/openai_compatible_errors/sse.rb', line 6 def events_seen @events_seen end |
#has_output ⇒ Object
Returns the value of attribute has_output
6 7 8 |
# File 'lib/openai_compatible_errors/sse.rb', line 6 def has_output @has_output end |
#malformed_events ⇒ Object
Returns the value of attribute malformed_events
6 7 8 |
# File 'lib/openai_compatible_errors/sse.rb', line 6 def malformed_events @malformed_events end |
#protocol ⇒ Object
Returns the value of attribute protocol
6 7 8 |
# File 'lib/openai_compatible_errors/sse.rb', line 6 def protocol @protocol end |
#termination ⇒ Object
Returns the value of attribute termination
6 7 8 |
# File 'lib/openai_compatible_errors/sse.rb', line 6 def termination @termination end |
Instance Method Details
#done? ⇒ Boolean
14 15 16 |
# File 'lib/openai_compatible_errors/sse.rb', line 14 def done? termination == :done end |
#incomplete? ⇒ Boolean
18 19 20 |
# File 'lib/openai_compatible_errors/sse.rb', line 18 def incomplete? termination == :incomplete end |
#unexpected_eof? ⇒ Boolean
22 23 24 |
# File 'lib/openai_compatible_errors/sse.rb', line 22 def unexpected_eof? termination == :unexpected_eof end |