diff --git a/packages/traceloop-sdk/src/lib/tracing/ai-sdk-transformations.ts b/packages/traceloop-sdk/src/lib/tracing/ai-sdk-transformations.ts index 6f609533..3bf260b5 100644 --- a/packages/traceloop-sdk/src/lib/tracing/ai-sdk-transformations.ts +++ b/packages/traceloop-sdk/src/lib/tracing/ai-sdk-transformations.ts @@ -66,6 +66,7 @@ const ROLE_USER = "user"; // Uses prefixes to match AI SDK patterns like "openai.chat", "anthropic.messages", etc. const VENDOR_MAPPING: Record = { openai: "OpenAI", + azure: "Azure", "azure-openai": "Azure", anthropic: "Anthropic", cohere: "Cohere", diff --git a/packages/traceloop-sdk/test/ai-sdk/ai-sdk-transformations.test.ts b/packages/traceloop-sdk/test/ai-sdk/ai-sdk-transformations.test.ts index 1b664ec5..12e38db0 100644 --- a/packages/traceloop-sdk/test/ai-sdk/ai-sdk-transformations.test.ts +++ b/packages/traceloop-sdk/test/ai-sdk/ai-sdk-transformations.test.ts @@ -1016,6 +1016,22 @@ describe("AI SDK Transformations", () => { }); }); + it("should transform azure provider (ai-sdk/azure) to Azure system", () => { + const azureProviders = ["azure.chat", "azure.completions", "azure"]; + + azureProviders.forEach((provider) => { + const attributes = { + "ai.model.provider": provider, + }; + + transformLLMSpans(attributes); + + assert.strictEqual(attributes[ATTR_GEN_AI_PROVIDER_NAME], "azure"); + assert.strictEqual(attributes[ATTR_GEN_AI_SYSTEM], "Azure"); + assert.strictEqual(attributes["ai.model.provider"], undefined); + }); + }); + it("should transform other providers to their value", () => { const attributes = { "ai.model.provider": "anthropic",