diff --git a/getstream/video/call.py b/getstream/video/call.py index 2566fa59..451524ed 100644 --- a/getstream/video/call.py +++ b/getstream/video/call.py @@ -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) @@ -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", diff --git a/tests/test_video_examples.py b/tests/test_video_examples.py index 473e29fa..c93a052e 100644 --- a/tests/test_video_examples.py +++ b/tests/test_video_examples.py @@ -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: