Skip to content

Commit 6b1deb9

Browse files
committed
fix
1 parent 349fa07 commit 6b1deb9

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

packages/traceloop-sdk/src/lib/tracing/ai-sdk-transformations.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -479,27 +479,18 @@ const transformVendor = (attributes: Record<string, any>): void => {
479479
if (AI_MODEL_PROVIDER in attributes) {
480480
const vendor = attributes[AI_MODEL_PROVIDER];
481481

482+
// Find matching vendor prefix in mapping
482483
let mappedVendor = null;
483484
if (typeof vendor === "string" && vendor.length > 0) {
484-
const providerName = vendor.split(".")[0];
485-
486-
// Set the standard gen_ai.provider.name attribute with lowercase provider name
487-
attributes[ATTR_GEN_AI_PROVIDER_NAME] = providerName;
488-
489-
// Find the mapped vendor for backward compatibility with deprecated gen_ai.system
490485
for (const prefix of Object.keys(VENDOR_MAPPING)) {
491486
if (vendor.startsWith(prefix)) {
492487
mappedVendor = VENDOR_MAPPING[prefix];
493488
break;
494489
}
495490
}
496-
497-
// Set deprecated gen_ai.system attribute for backward compatibility
498-
if (mappedVendor) {
499-
attributes[ATTR_GEN_AI_SYSTEM] = mappedVendor;
500-
}
501491
}
502492

493+
attributes[ATTR_GEN_AI_SYSTEM] = mappedVendor || vendor;
503494
delete attributes[AI_MODEL_PROVIDER];
504495
}
505496
};

0 commit comments

Comments
 (0)