com.openai.unity 8.8.0#391
Merged
StephenHodgson merged 1 commit intomainfrom Jul 2, 2025
Merged
Conversation
Member
StephenHodgson
commented
Jul 2, 2025
- Improved RealtimeSession websocket support for proxies
- Proxy no longer handles the websocket connection directly, but instead initiates the connection to the OpenAI api directly using the ephemeral api key
- Improved RealtimeSession websocket support for proxies - Proxy no longer handles the websocket connection directly, but instead initiates the connection to the OpenAI api directly using the ephemeral api key
Contributor
There was a problem hiding this comment.
Pull Request Overview
Updates the Unity OpenAI package to v8.8.0 by enhancing RealtimeSession proxy support—sessions now use ephemeral API keys for direct WebSocket connections and URL utilities are refactored.
- Bumped package version to 8.8.0
- Added
ClientSecret/ExpiresAftersupport and JSON constructors in Realtime models - Refactored endpoint URL construction and replaced proxy WebSocket initialization
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Version bumped to 8.8.0 |
| Runtime/Realtime/SessionConfiguration.cs | Added expiresAfter, ClientSecret, JSON ctor and Ignore defaults |
| Runtime/Realtime/ServerVAD.cs | Made Type setter-private and added JSON ctor |
| Runtime/Realtime/SemanticVAD.cs | Made Type setter-private and added JSON ctor |
| Runtime/Realtime/RealtimeEndpoint.cs | Replaced CreateWebSocket usage with Rest POST + direct WebSocket init |
| Runtime/Realtime/ExpiresAfter.cs | New class for JSON expires_after and implicit int conversion |
| Runtime/Realtime/ClientSecret.cs | New class for handling ephemeral API keys |
| Runtime/OpenAIClient.cs | Removed old CreateWebSocket method |
| Runtime/Extensions/VoiceActivityDetectionSettingsConverter.cs | Added null-check in converter |
| Runtime/Common/OpenAIBaseEndpoint.cs | Removed IsWebSocketEndpoint; introduced GetWebsocketUri |
| Runtime/Authentication/OpenAISettingsInfo.cs | Simplified WebSocket URL format to always use WSS |
Comments suppressed due to low confidence (3)
OpenAI/Packages/com.openai.unity/Runtime/Realtime/RealtimeEndpoint.cs:79
- The call to send the initial configuration (
UpdateSessionRequest) after establishing the WebSocket connection was removed, which may prevent the session from being initialized correctly. Consider reinstating thisSendAsynccall to ensure the server receives the session parameters.
session.Configuration = sessionResponse.SessionConfiguration;
OpenAI/Packages/com.openai.unity/Runtime/Authentication/OpenAISettingsInfo.cs:74
- Hardcoding the WebSocket URL to use the default OpenAI domain (
OpenAIDomain) removes support for custom or self-hosted domains. To maintain flexibility, consider constructingBaseWebSocketUrlFormatfrom the provideddomainparameter similar toBaseRequestUrlFormat.
BaseWebSocketUrlFormat = $"{WSS}{OpenAIDomain}{BaseRequest}{{0}}";
OpenAI/Packages/com.openai.unity/Runtime/Realtime/RealtimeEndpoint.cs:44
- The new direct REST POST and WebSocket initialization flow isn't covered by existing tests. Adding unit or integration tests for the
/sessionsPOST path and WebSocket connection logic will help prevent regressions.
var payload = JsonConvert.SerializeObject(configuration, OpenAIClient.JsonSerializationOptions);
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 2, 2025
- Improved RealtimeSession websocket support for proxies - Proxy no longer handles the websocket connection directly, but instead initiates the connection to the OpenAI api directly using the ephemeral api key
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.