Skip to content

Commit f4c60b0

Browse files
committed
overwrite conversation id only if not previously sert
1 parent 44fd627 commit f4c60b0

File tree

1 file changed

+3
-1
lines changed
  • packages/core/src/tracing/vercel-ai

1 file changed

+3
-1
lines changed

packages/core/src/tracing/vercel-ai/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,9 @@ function addProviderMetadataToAttributes(attributes: SpanAttributes): void {
470470
'gen_ai.usage.output_tokens.prediction_rejected',
471471
openaiMetadata.rejectedPredictionTokens,
472472
);
473-
setAttributeIfDefined(attributes, 'gen_ai.conversation.id', openaiMetadata.responseId);
473+
if (!attributes['gen_ai.conversation.id']) {
474+
setAttributeIfDefined(attributes, 'gen_ai.conversation.id', openaiMetadata.responseId);
475+
}
474476
}
475477

476478
if (providerMetadataObject.anthropic) {

0 commit comments

Comments
 (0)