Mark OpenAI direct clients as deprecated in V2 SDK#845
Open
skottmckay wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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) soTreatWarningsAsErrorskeeps 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users should move to the new Session API for direct requests.
The web service OpenAI endpoints are unchanged.