Class: Protege::InferenceChunkEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/protege/events/inference_chunk_event.rb

Overview

Fired for each token chunk during streaming inference.

Instance Attribute Summary

Attributes inherited from Event

#payload

Instance Method Summary collapse

Methods inherited from Event

#[], all, channel, #correlation_id, emit, #initialize, subscribe

Constructor Details

This class inherits a constructor from Protege::Event

Instance Method Details

#chunkObject



10
# File 'lib/protege/events/inference_chunk_event.rb', line 10

def chunk   = self[:chunk]

#chunk_contentString?

The decoded text of the streamed chunk, if any.

Returns:

  • (String, nil)

    the chunk's :content as a string, or nil when there is no chunk



15
# File 'lib/protege/events/inference_chunk_event.rb', line 15

def chunk_content = chunk && chunk[:content].to_s

#personaObject



8
# File 'lib/protege/events/inference_chunk_event.rb', line 8

def persona = self[:persona]

#threadObject



9
# File 'lib/protege/events/inference_chunk_event.rb', line 9

def thread  = self[:thread]