Skip to content

Commit 793274b

Browse files
committed
make sure streams aren't instrumented
1 parent 6e3f55c commit 793274b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/instrumentation/openai.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ module.exports = function initialize(agent, openai, moduleName, shim) {
386386
if (semver.gte(shim.pkgVersion, '5.0.0')) {
387387
shim.record(openaiClient.Responses.prototype, 'create', function wrapCreate(shim, create, name, args) {
388388
const [request] = args
389+
if (request.stream) {
390+
shim.logger.warn('Streaming is not supported for responses.create yet.')
391+
return
392+
}
389393

390394
return new RecorderSpec({
391395
name: OPENAI.COMPLETION,

0 commit comments

Comments
 (0)