Skip to content

Commit 66931cb

Browse files
committed
Remove default model to prevent necessitating a breaking change when the model is deprecated
1 parent 3ba2dbb commit 66931cb

File tree

3 files changed

+0
-127
lines changed

3 files changed

+0
-127
lines changed

lib/openai/realtime.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module OpenAI
22
class Realtime
3-
DEFAULT_REALTIME_MODEL = "gpt-4o-realtime-preview-2024-12-17".freeze
4-
53
def initialize(client:)
64
@client = client.beta(realtime: "v1")
75
end
@@ -11,15 +9,11 @@ def initialize(client:)
119
# This method sets up a new session for real-time voice interaction with an OpenAI model.
1210
# It returns session details that can be used to establish a WebRTC connection.
1311
#
14-
# By default, this method uses the 'gpt-4o-realtime-preview-2024-12-17' model
15-
# unless specified otherwise.
1612
#
1713
# @param parameters [Hash] parameters for the session (see: https://platform.openai.com/docs/api-reference/realtime-sessions/create)
1814
# @return [Hash] Session details including session ID, ICE servers, and other
1915
# connection information
2016
def create(parameters: {})
21-
parameters = parameters.merge(model: DEFAULT_REALTIME_MODEL) unless parameters[:model]
22-
2317
@client.json_post(path: "/realtime/sessions", parameters: parameters)
2418
end
2519
end

spec/fixtures/cassettes/realtime_session_create_default.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

spec/openai/client/realtime_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
let(:realtime) { client.realtime }
44

55
describe "#create" do
6-
context "when no model is specified" do
7-
it "uses the default model" do
8-
VCR.use_cassette("realtime_session_create_default") do
9-
response = realtime.create
10-
expect(response["model"]).to eq(OpenAI::Realtime::DEFAULT_REALTIME_MODEL)
11-
end
12-
end
13-
end
14-
156
context "when a model is specified" do
167
it "uses the specified model" do
178
custom_model = "gpt-4o-realtime-preview-2024-12-18"

0 commit comments

Comments
 (0)