Class: LittleGhost::Providers::OpenAICompatible::Normalizer
- Inherits:
-
Object
- Object
- LittleGhost::Providers::OpenAICompatible::Normalizer
- Defined in:
- lib/little_ghost/providers/openai_compatible.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(model:) ⇒ Normalizer
constructor
A new instance of Normalizer.
- #stream_done ⇒ Object
Constructor Details
#initialize(model:) ⇒ Normalizer
Returns a new instance of Normalizer.
439 440 441 442 443 444 445 446 447 448 |
# File 'lib/little_ghost/providers/openai_compatible.rb', line 439 def initialize(model:) @model = model @message_id = nil @text = +"" @reasoning = +"" @tool_calls = {} @usage = Usage.new @stop_reason = nil @finished = false end |
Instance Method Details
#finish ⇒ Object
450 451 452 453 454 455 |
# File 'lib/little_ghost/providers/openai_compatible.rb', line 450 def finish return [] if @finished raise ProtocolError, "Provider stream ended before its terminal event" unless @terminal [final_event] end |
#stream_done ⇒ Object
457 458 459 |
# File 'lib/little_ghost/providers/openai_compatible.rb', line 457 def stream_done @terminal = true end |