Skip to content

Mark OpenAI direct clients as deprecated in V2 SDK#845

Open
skottmckay wants to merge 1 commit into
mainfrom
skottmckay/MarkOAIClientsAsDeprecated
Open

Mark OpenAI direct clients as deprecated in V2 SDK#845
skottmckay wants to merge 1 commit into
mainfrom
skottmckay/MarkOAIClientsAsDeprecated

Conversation

@skottmckay

Copy link
Copy Markdown
Collaborator

Users should move to the new Session API for direct requests.
The web service OpenAI endpoints are unchanged.

Copilot AI review requested due to automatic review settings June 29, 2026 08:19
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Jun 29, 2026 8:19am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Marks the OpenAI-compatible "direct client" classes (chat, audio, embedding, live transcription) as deprecated across the C#, JavaScript, and Python V2 SDKs, steering users toward the new Session API. The web-server OpenAI endpoints are unchanged; only the in-process direct clients are deprecated, with internal SDK self-references silenced so the build stays warning-clean.

Changes:

  • Adds language-native deprecation markers ([Obsolete], @deprecated, typing_extensions.deprecated + DeprecationWarning) to the OpenAI client classes and the model factory accessors.
  • Suppresses the resulting warnings at internal self-use sites (C# #pragma warning disable CS0618) so TreatWarningsAsErrors keeps passing.
  • Updates docstrings/JSDoc to recommend ChatSession/AudioSession/EmbeddingsSession.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk_v2/python/.../openai/live_audio_session.py @deprecated class + warnings.warn in ctor + docstring
sdk_v2/python/.../openai/embedding_client.py @deprecated class + ctor warning
sdk_v2/python/.../openai/chat_client.py @deprecated class + ctor warning
sdk_v2/python/.../openai/audio_client.py @deprecated class + ctor warning
sdk_v2/python/.../imodel.py Deprecated factory accessors + docstrings
sdk_v2/js/src/openai/*.ts @deprecated JSDoc on client classes
sdk_v2/js/src/model.ts @deprecated on create*Client factories
sdk_v2/js/src/index.ts @deprecated re-exports
sdk_v2/cs/src/OpenAI/*.cs [Obsolete] on clients + pragma at self-use
sdk_v2/cs/src/IModel.cs, Detail/Model.cs [Obsolete] factory methods + pragmas

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.

2 participants