Skip to content

Commit a8adf1d

Browse files
committed
fix: azure vendor
1 parent f24d54b commit a8adf1d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const AI_PROMPT_TOOLS = "ai.prompt.tools";
2424
// Uses prefixes to match AI SDK patterns like "openai.chat", "anthropic.messages", etc.
2525
const VENDOR_MAPPING: Record<string, string> = {
2626
openai: "OpenAI",
27-
"azure-openai": "OpenAI",
27+
"azure-openai": "Azure",
2828
anthropic: "Anthropic",
2929
cohere: "Cohere",
3030
mistral: "MistralAI",
@@ -36,7 +36,6 @@ const VENDOR_MAPPING: Record<string, string> = {
3636
perplexity: "Perplexity",
3737
"amazon-bedrock": "AWS",
3838
bedrock: "AWS",
39-
azure: "Azure",
4039
google: "Google",
4140
vertex: "Google",
4241
ollama: "Ollama",

packages/traceloop-sdk/test/ai-sdk-transformations.test.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,6 @@ describe("AI SDK Transformations", () => {
927927
"openai.completions",
928928
"openai.embeddings",
929929
"openai",
930-
"azure-openai.chat",
931930
];
932931

933932
openaiProviders.forEach((provider) => {
@@ -942,6 +941,23 @@ describe("AI SDK Transformations", () => {
942941
});
943942
});
944943

944+
it("should transform azure openai provider to Azure system", () => {
945+
const openaiProviders = [
946+
"azure-openai",
947+
];
948+
949+
openaiProviders.forEach((provider) => {
950+
const attributes = {
951+
"ai.model.provider": provider,
952+
};
953+
954+
transformAiSdkAttributes(attributes);
955+
956+
assert.strictEqual(attributes[SpanAttributes.LLM_SYSTEM], "Azure");
957+
assert.strictEqual(attributes["ai.model.provider"], undefined);
958+
});
959+
});
960+
945961
it("should transform other providers to their value", () => {
946962
const attributes = {
947963
"ai.model.provider": "anthropic",
@@ -1093,7 +1109,7 @@ describe("AI SDK Transformations", () => {
10931109
assert.strictEqual(attributes[SpanAttributes.LLM_USAGE_TOTAL_TOKENS], 15);
10941110

10951111
// Check vendor transformation
1096-
assert.strictEqual(attributes[SpanAttributes.LLM_SYSTEM], "OpenAI");
1112+
assert.strictEqual(attributes[SpanAttributes.LLM_SYSTEM], "Azure");
10971113

10981114
// Check original AI SDK attributes are removed
10991115
assert.strictEqual(attributes["ai.response.object"], undefined);

0 commit comments

Comments
 (0)