client icon indicating copy to clipboard operation
client copied to clipboard

[Bug]: Images (Dall-e 3) method not working with Azure

Open kukicado opened this issue 1 year ago • 1 comments

Description

Trying to create a custom factory to use Dall-e 3 with Azure does not work with the client library. It gives a "resource not found" error, although the resource exists and works with other client libraries.

Screenshot 2024-03-19 at 1 53 42 PM

Steps To Reproduce

  1. Setup an Azure OpenAI factory:

$client = \OpenAI::factory() ->withBaseUri('{resource}.openai.azure.com/openai/deployments/{deployment-name}') ->withHttpHeader('api-key', 'XXXXX') ->withQueryParam('api-version', '2023-06-01-preview') ->make();

$response = $client->images()->create([
    'prompt' => 'a monkey eating a banana',
    'n' => 1,
    'size' => '1024x1024',
    //'response_format' => 'url',
]);
  1. Try to run the route, get "resource not found" exception.

I have tried changing the base URI to {resource}.openai.azure.com as well and added deployment name in the create method, but the issue persists.

OpenAI PHP Client Version

^0.8.4

PHP Version

8.2.12

Notes

No response

kukicado avatar Mar 19 '24 20:03 kukicado

API-Version 2024-02-15-preview has helped for me!

berott avatar Mar 23 '24 23:03 berott

Hi @kukicado

This does not look like an error related to the package.

If you do not agree, feel free to reopen the issue.

gehrisandro avatar May 28 '24 21:05 gehrisandro