Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions getstream/video/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def _sync_from_response(self, data):
if hasattr(data, "call") and isinstance(data.call, CallResponse):
self.custom_data = data.call.custom

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

client = get_openai_realtime_client(openai_api_key, self.client.base_url)
Expand All @@ -27,7 +29,7 @@ def connect_openai(self, openai_api_key, agent_user_id):
"call_id": self.id,
"api_key": self.client.api_key,
},
model="gpt-4o-realtime-preview",
model=model,
extra_headers={
"Authorization": f"Bearer {openai_api_key}",
"OpenAI-Beta": "realtime=v1",
Expand Down
9 changes: 0 additions & 9 deletions tests/test_video_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,6 @@ async def test_connect_openai(client: Stream, capsys):

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

# Just test that we can get the client without errors
from getstream.video.openai import get_openai_realtime_client

openai_client = get_openai_realtime_client(openai_api_key, client.base_url)

# Verify that the client has been patched
assert hasattr(openai_client, "beta")
assert hasattr(openai_client.beta, "realtime")

# Skip the actual connection part which requires a real server, we leave this here just for manual testing
with capsys.disabled():
try:
Expand Down