patchRealtimeSession
โธ patchRealtimeSession():Promise<boolean>
Manually patch the RealtimeSession class from @openai/agents-realtime so that
every new instance is automatically traced by Weave.
Note: You typically donโt need to call this function! @openai/agents-realtime is
automatically instrumented via module loader hooks when you import Weave. This function
is provided for edge cases where automatic instrumentation doesnโt work (e.g. dynamic
imports, bundlers that bypass hooks).
Call this once at app startup, before any RealtimeSession is constructed.
The function is idempotent โ safe to call multiple times.
Returns
Promise<boolean>
true if the patch was applied (or was already in place), false if
@openai/agents-realtime could not be loaded.
Example