Class: OpenAI::Resources::Live

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/live.rb,
lib/openai/resources/live/forks.rb,
lib/openai/resources/live/sessions.rb,
lib/openai/resources/live/sideband.rb,
sig/openai/resources/live.rbs,
sig/openai/resources/live/forks.rbs,
sig/openai/resources/live/sessions.rbs,
sig/openai/resources/live/sideband.rbs

Defined Under Namespace

Classes: Forks, Sessions, Sideband

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Live

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Live.

Parameters:



46
47
48
49
50
51
# File 'lib/openai/resources/live.rb', line 46

def initialize(client:)
  @client = client
  @sideband = OpenAI::Resources::Live::Sideband.new(client: client)
  @forks = OpenAI::Resources::Live::Forks.new(client: client)
  @sessions = OpenAI::Resources::Live::Sessions.new(client: client)
end

Instance Attribute Details

#forksOpenAI::Resources::Live::Forks (readonly)



10
11
12
# File 'lib/openai/resources/live.rb', line 10

def forks
  @forks
end

#sessionsOpenAI::Resources::Live::Sessions (readonly)



13
14
15
# File 'lib/openai/resources/live.rb', line 13

def sessions
  @sessions
end

#sidebandOpenAI::Resources::Live::Sideband (readonly)



7
8
9
# File 'lib/openai/resources/live.rb', line 7

def sideband
  @sideband
end

Instance Method Details

#create(session:, transport:, request_options: {}) ⇒ OpenAI::Models::Live::LiveCreateResponse

Create a Live WebRTC session. Start with the Live prompting guide.

Parameters:

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/openai/resources/live.rb', line 31

def create(params)
  parsed, options = OpenAI::Live::LiveCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "live/sessions",
    body: parsed,
    model: OpenAI::Models::Live::LiveCreateResponse,
    security: {bearer_auth: true},
    options: options
  )
end