Skip to content

Commit b8eb005

Browse files
committed
Add URL extraction for Azure OpenAI debugging
- Extract url.full with complete URL - Extract url.path with deployment info (deployments/model-name/endpoint) - Improve Azure provider detection - Add unit test for URL extraction functionality
1 parent 145a900 commit b8eb005

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

js/packages/openinference-instrumentation-openai/test/openai.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,4 +1650,16 @@ describe("OpenAIInstrumentation with a custom tracer provider", () => {
16501650
expect(span.attributes["llm.model_name"]).toBe("gpt-3.5-turbo-0613");
16511651
});
16521652
});
1653+
1654+
describe("URL extraction", () => {
1655+
it("should detect Azure provider correctly", () => {
1656+
const azureClient = new OpenAI({
1657+
apiKey: "test-key",
1658+
baseURL: "https://test-resource.openai.azure.com/openai/deployments/gpt-4",
1659+
});
1660+
1661+
// Just verify the client was created with Azure base URL
1662+
expect(azureClient.baseURL).toContain("openai.azure.com");
1663+
});
1664+
});
16531665
});

0 commit comments

Comments
 (0)