Class: OpenAI::Realtime
- Inherits:
-
Object
- Object
- OpenAI::Realtime
- Defined in:
- lib/openai/realtime.rb
Instance Method Summary collapse
-
#create(parameters: {}) ⇒ Hash
Create a new real-time session with OpenAI.
-
#initialize(client:) ⇒ Realtime
constructor
A new instance of Realtime.
Constructor Details
#initialize(client:) ⇒ Realtime
Returns a new instance of Realtime.
3 4 5 |
# File 'lib/openai/realtime.rb', line 3 def initialize(client:) @client = client.beta(realtime: "v1") end |
Instance Method Details
#create(parameters: {}) ⇒ Hash
Create a new real-time session with OpenAI.
This method sets up a new session for real-time voice interaction with an OpenAI model. It returns session details that can be used to establish a WebRTC connection.
connection information
15 16 17 |
# File 'lib/openai/realtime.rb', line 15 def create(parameters: {}) @client.json_post(path: "/realtime/sessions", parameters: parameters) end |