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.
516 517 518 519 520 521 522 523 524 525 |
# File 'lib/little_ghost/providers/openai_compatible.rb', line 516 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
527 528 529 530 531 532 |
# File 'lib/little_ghost/providers/openai_compatible.rb', line 527 def finish return [] if @finished raise ProtocolError, "Provider stream ended before its terminal event" unless @terminal [final_event] end |
#stream_done ⇒ Object
534 535 536 |
# File 'lib/little_ghost/providers/openai_compatible.rb', line 534 def stream_done @terminal = true end |