diff --git a/sdk/openai/openai/assets.json b/sdk/openai/openai/assets.json index 194115fbcfbb..7b5b4792cf98 100644 --- a/sdk/openai/openai/assets.json +++ b/sdk/openai/openai/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/openai/openai", - "Tag": "js/openai/openai_d5f951ca47" + "Tag": "js/openai/openai_5a9957cec2" } diff --git a/sdk/openai/openai/test/public/openai.spec.ts b/sdk/openai/openai/test/public/openai.spec.ts index e14252cb75fc..e0178cc63247 100644 --- a/sdk/openai/openai/test/public/openai.spec.ts +++ b/sdk/openai/openai/test/public/openai.spec.ts @@ -21,6 +21,7 @@ import { import { logger } from "./utils/logger.js"; import { createDefaultHttpClient, + createEmptyPipeline, createHttpHeaders, createPipelineRequest, } from "@azure/core-rest-pipeline"; @@ -396,6 +397,11 @@ describe("OpenAI", function () { async function checkSize(imageUrl: string): Promise { const coreClient = createDefaultHttpClient(); + const pipeline = createEmptyPipeline(); + + // Inject the recorder pipeline policy so that the request for image size gets recorded + pipeline.addPolicy(recorder.configureClientOptions({}).additionalPolicies![0].policy); + const set = new Set(); const request = createPipelineRequest({ url: imageUrl, @@ -403,7 +409,8 @@ describe("OpenAI", function () { headers: createHttpHeaders(), streamResponseStatusCodes: set.add(200), }); - const response = await coreClient.sendRequest(request); + + const response = await pipeline.sendRequest(coreClient, request); const dimensions = await getImageDimensions(response); assert.isDefined(dimensions, "Unable to get dimensions"); diff --git a/sdk/openai/openai/test/public/utils/recordedClient.ts b/sdk/openai/openai/test/public/utils/recordedClient.ts index 0a88046b8fa3..d183657ce77c 100644 --- a/sdk/openai/openai/test/public/utils/recordedClient.ts +++ b/sdk/openai/openai/test/public/utils/recordedClient.ts @@ -24,6 +24,15 @@ const envSetupForPlayback: { [k: string]: string } = { const recorderStartOptions: RecorderStartOptions = { envSetupForPlayback, + sanitizerOptions: { + generalSanitizers: [ + { + regex: true, + target: `\\.png?[^"]+`, + value: ".png?sanitized", + }, + ], + }, }; export type AuthMethod = "AzureAPIKey" | "OpenAIKey" | "AAD" | "DummyAPIKey";