fix: #1880 fix a bug where OpenAI Realtime API tracing does not work for realtime agents#1940
fix: #1880 fix a bug where OpenAI Realtime API tracing does not work for realtime agents#1940
Conversation
seratch
left a comment
There was a problem hiding this comment.
comments for reviewers
|
|
||
| headers: dict[str, str] = {} | ||
| if options.get("headers") is not None: | ||
| subprotocols: list[Subprotocol] = [ |
There was a problem hiding this comment.
This is not a fundamental change for the issue, but having these is generally recommended and aligning with TS SDK.
| if api_key.startswith("ek_"): | ||
| ephemeral_key = api_key | ||
| else: | ||
| ephemeral_key = await self._maybe_create_client_secret(api_key, self.model) |
There was a problem hiding this comment.
creating an ephemeral key for establishing a WS connection is the recommended way while both still work in terms of realtime capabilities. Going with an ephemeral key resolves the tracing feature issue.
There was a problem hiding this comment.
using an ephemeral key for server <-> server communication seems like unnecessary overhead to me.
…for realtime agents
9040bf9 to
6f74eae
Compare
| if api_key.startswith("ek_"): | ||
| ephemeral_key = api_key | ||
| else: | ||
| ephemeral_key = await self._maybe_create_client_secret(api_key, self.model) |
There was a problem hiding this comment.
using an ephemeral key for server <-> server communication seems like unnecessary overhead to me.
|
Update: this PR applies a workaround on the client SDK side, but the realtime API server team is going to resolve this issue soon. This means this PR's changes won't be necessary. |
This pull request resolves #1880; Realtime API accepts sk-proj-... token for starting a WebSocket connection, but with this way, the Realtime API's server side tracing no longer works. This pattern may be supported again, but as a quick fix for affected users, this SDK migrates to the new way to establish a WebSocket connection.