diff --git a/src/resources/images.ts b/src/resources/images.ts index ece51889e..0aef5881b 100644 --- a/src/resources/images.ts +++ b/src/resources/images.ts @@ -55,7 +55,13 @@ export class Images extends APIResource { return this._client.post( '/images/edits', multipartFormRequestOptions( - { body, ...options, stream: body.stream ?? false, __security: { bearerAuth: true } }, + { + body, + ...options, + stream: body.stream ?? false, + __metadata: { model: body.model }, + __security: { bearerAuth: true }, + }, this._client, ), ) as APIPromise | APIPromise>; diff --git a/tests/lib/azure.test.ts b/tests/lib/azure.test.ts index 7c0192b27..4664d3f71 100644 --- a/tests/lib/azure.test.ts +++ b/tests/lib/azure.test.ts @@ -585,6 +585,18 @@ describe('azure request building', () => { }); }); + test('handles image edit', async () => { + expect( + await client.images.edit({ + model: deployment, + image: new File([], ''), + prompt: 'prompt', + }), + ).toMatchObject({ + url: `https://example.com/openai/deployments/${deployment}/images/edits?api-version=${apiVersion}`, + }); + }); + test('handles assistants', async () => { expect( await client.beta.assistants.create({