Skip to content

Commit 0c6acef

Browse files
authored
Merge pull request #72 from GetStream/model-param
Expose model param on openai connect method
2 parents 432fed4 + 9c0d312 commit 0c6acef

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

getstream/video/call.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def _sync_from_response(self, data):
1616
if hasattr(data, "call") and isinstance(data.call, CallResponse):
1717
self.custom_data = data.call.custom
1818

19-
def connect_openai(self, openai_api_key, agent_user_id):
19+
def connect_openai(
20+
self, openai_api_key, agent_user_id, model="gpt-4o-realtime-preview"
21+
):
2022
from .openai import get_openai_realtime_client, ConnectionManagerWrapper
2123

2224
client = get_openai_realtime_client(openai_api_key, self.client.base_url)
@@ -27,7 +29,7 @@ def connect_openai(self, openai_api_key, agent_user_id):
2729
"call_id": self.id,
2830
"api_key": self.client.api_key,
2931
},
30-
model="gpt-4o-realtime-preview",
32+
model=model,
3133
extra_headers={
3234
"Authorization": f"Bearer {openai_api_key}",
3335
"OpenAI-Beta": "realtime=v1",

tests/test_video_examples.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,6 @@ async def test_connect_openai(client: Stream, capsys):
383383

384384
call = client.video.call("default", "example-ai-recorder")
385385

386-
# Just test that we can get the client without errors
387-
from getstream.video.openai import get_openai_realtime_client
388-
389-
openai_client = get_openai_realtime_client(openai_api_key, client.base_url)
390-
391-
# Verify that the client has been patched
392-
assert hasattr(openai_client, "beta")
393-
assert hasattr(openai_client.beta, "realtime")
394-
395386
# Skip the actual connection part which requires a real server, we leave this here just for manual testing
396387
with capsys.disabled():
397388
try:

0 commit comments

Comments
 (0)