Class: OpenAI::Models::Beta::BetaResponseTextDeltaEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/beta_response_text_delta_event.rb,
sig/openai/models/beta/beta_response_text_delta_event.rbs

Defined Under Namespace

Classes: Agent, Logprob

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(token: nil, logprob: nil) ⇒ Object

Parameters:

  • content_index —

    The index of the content part that the text delta was added to.

  • delta —

    The text delta that was added.

  • item_id —

    The ID of the output item that the text delta was added to.

  • logprobs —

    The log probabilities of the tokens in the delta.

  • output_index —

    The index of the output item that the text delta was added to.

  • sequence_number —

    The sequence number for this event.

  • agent —

    The agent that owns this multi-agent streaming event.

  • type —

    The type of the event. Always response.output_text.delta.



# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 132


Instance Attribute Details

#agent ⇒ OpenAI::Beta::BetaResponseTextDeltaEvent::Agent?

The agent that owns this multi-agent streaming event.

Returns:

  • (OpenAI::Beta::BetaResponseTextDeltaEvent::Agent, nil)


56
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 56

optional :agent, -> { OpenAI::Beta::BetaResponseTextDeltaEvent::Agent }, nil?: true

#content_index ⇒ Integer

The index of the content part that the text delta was added to.

Returns:

  • (Integer)


11
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 11

required :content_index, Integer

#delta ⇒ String

The text delta that was added.

Returns:

  • (String)


17
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 17

required :delta, String

#item_id ⇒ String

The ID of the output item that the text delta was added to.

Returns:

  • (String)


23
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 23

required :item_id, String

#logprobs ⇒ ::Array[OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob]

The log probabilities of the tokens in the delta.

Returns:

  • (::Array[OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob])


29
30
31
32
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 29

required(
  :logprobs,
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::BetaResponseTextDeltaEvent::Logprob] }
)

#output_index ⇒ Integer

The index of the output item that the text delta was added to.

Returns:

  • (Integer)


38
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 38

required :output_index, Integer

#sequence_number ⇒ Integer

The sequence number for this event.

Returns:

  • (Integer)


44
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 44

required :sequence_number, Integer

#type ⇒ :"response.output_text.delta"

The type of the event. Always response.output_text.delta.

Returns:

  • (:"response.output_text.delta")


50
# File 'lib/openai/models/beta/beta_response_text_delta_event.rb', line 50

required :type, const: :"response.output_text.delta"

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


70
# File 'sig/openai/models/beta/beta_response_text_delta_event.rbs', line 70

def to_hash: -> {