Skip to content

feat(video): deprecate connect_openai in favour of Vision Agents - #312

Open
pojala wants to merge 1 commit into
mainfrom
pauliojala/vid-1674-deprecate-openai-realtime
Open

pojala wants to merge 1 commit into
mainfrom
pauliojala/vid-1674-deprecate-openai-realtime

Conversation

@pojala

@pojala pojala commented Oct 28, 2026 •

Copy link
Copy Markdown

Marks Call.connect_openai deprecated: a docstring note plus a DeprecationWarning (stacklevel=2, same pattern as the StreamAPIException alias in getstream/base.py). It talks to Stream's /video/connect_agent OpenAI Realtime proxy, which is being retired: Vision Agents is now the supported way to build voice and video AI agents on Stream Video, and the OpenAI Realtime docs page already redirects to Vision Agents.

  • No behaviour change beyond the warning; the method keeps working until a removal date is announced.
  • Adds test_connect_openai_emits_deprecation_warning to tests/test_video_openai.py (fails without the change).
  • Not in this PR: the default model="gpt-4o-realtime-preview" has been shut down by OpenAI; updating that default is tracked separately.
  • Matching changes: connectOpenAi in stream-node, and an npm deprecate of @stream-io/openai-realtime-api.

Checked: ruff check, ruff format --check, pytest tests/test_video_openai.py (12 passed, 1 skipped without OPENAI_API_KEY).

Linear: VID-1674


Note

Low Risk
Adds a deprecation warning and docs only; no change to connection logic or security-sensitive paths.

Overview
BaseCall.connect_openai is now officially deprecated: the docstring includes a Sphinx .. deprecated:: note, and callers get a DeprecationWarning (with stacklevel=2) pointing them to Vision Agents instead of Stream’s /video/connect_agent OpenAI Realtime proxy.

Runtime behavior is unchanged—the method still wires up the realtime client and proxy as before; only the warning is new.

A test test_connect_openai_emits_deprecation_warning asserts the warning text mentions Vision Agents, with OpenAI client setup mocked so the test stays isolated.

Reviewed by Cursor Bugbot for commit 70c0858. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Deprecations
    • connect_openai now emits a deprecation warning directing callers to Vision Agents. Its connection behavior remains unchanged.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc364ff6-9c3b-4ca2-be39-6f587aa51c84
Commits

Reviewing files that changed from the base of the PR and between 8d7c51f and 70c0858.

Files selected for processing: 2
  • getstream/video/__init__.py
  • tests/test_video_openai.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

BaseCall.connect_openai now documents and emits a DeprecationWarning that directs callers to Vision Agents. A test checks for the warning. The method signature and connection behavior remain unchanged.

Changes: OpenAI proxy deprecation

Layer / File(s) Summary
Add and verify deprecation warning
getstream/video/__init__.py, tests/test_video_openai.py
connect_openai documents and emits a DeprecationWarning that mentions Vision Agents. The test checks the warning while mocking the realtime-client factory.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Merge Risk: Minimal · up to 70c08

The deprecated API remains functional while directing callers to Vision Agents.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: deprecating connect_openai in favor of Vision Agents.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pojala
pojala requested review from itsmeadi and mogita October 28, 2026 09:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant