Skip to content

Commit bb6b91d

Browse files
committed
more refactoring
1 parent 0a8ea4f commit bb6b91d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/utils/openai/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function instrumentMethod<T extends unknown[], R>(
183183
if (isStream(result)) {
184184
return startSpanManual(
185185
{
186-
name: `${operationName} ${model}`,
186+
name: `${operationName} ${model} stream-response`,
187187
op: getSpanOperation(methodPath),
188188
attributes: requestAttributes as Record<string, SpanAttributeValue>,
189189
},
@@ -199,6 +199,7 @@ function instrumentMethod<T extends unknown[], R>(
199199
finalOptions.recordOutputs ?? false,
200200
finish,
201201
) as unknown as R;
202+
202203
} catch (error) {
203204
captureException(error);
204205
finish();
@@ -207,6 +208,7 @@ function instrumentMethod<T extends unknown[], R>(
207208
},
208209
);
209210
} else {
211+
// Non-streaming responses
210212
return startSpan(
211213
{
212214
name: `${operationName} ${model}`,

0 commit comments

Comments
 (0)