Class: OpenAI::Realtime::ConnectionResources::Response

Inherits:
Base
  • Object
show all
Defined in:
lib/openai/helpers/realtime/connection_resources.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenAI::Realtime::ConnectionResources::Base

Instance Method Details

#cancel(response_id: nil, event_id: nil) ⇒ Object



46
47
48
49
50
# File 'lib/openai/helpers/realtime/connection_resources.rb', line 46

def cancel(response_id: nil, event_id: nil)
  @connection.send_event(
    compact_event(type: :"response.cancel", response_id: response_id, event_id: event_id)
  )
end

#create(**params) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/openai/helpers/realtime/connection_resources.rb', line 35

def create(**params)
  response,  = event_payload(params, :event_id)
  @connection.send_event(
    compact_event(
      type: :"response.create",
      response: response.empty? ? nil : response,
      **
    )
  )
end