azure-openai-proxy icon indicating copy to clipboard operation
azure-openai-proxy copied to clipboard

Require support DALL-E model

Open shixinyu opened this issue 1 year ago • 6 comments

Greeting, Please consider add support DALL-E and in Azure OpenAI, the API route will be : https://xxx.openai.azure.com/openai/images/generations:submit?api-version=2023-06-01-preview

shixinyu avatar Jun 06 '23 05:06 shixinyu

Is there an API documentation?

stulzq avatar Jun 06 '23 09:06 stulzq

#22

stulzq avatar Jun 06 '23 09:06 stulzq

import requests import time import os api_base = 'https://aceplaying.openai.azure.com/' api_key = os.getenv("OPENAI_API_KEY") api_version = '2023-06-01-preview' url = "{}openai/images/generations:submit?api-version={}".format(api_base, api_version) headers= { "api-key": api_key, "Content-Type": "application/json" } body = { "prompt": "USER_PROMPT_GOES_HERE", "n": 2, "resolution": "1024x1024" } submission = requests.post(url, headers=headers, json=body) operation_location = submission.headers['Operation-Location'] retry_after = submission.headers['Retry-after'] status = "" while (status != "Succeeded"): time.sleep(int(retry_after)) response = requests.get(operation_location, headers=headers) status = response.json()['status'] image_url = response.json()['result']['contentUrl']

Just saw it from Azure Portal, does it help?

shixinyu avatar Jun 07 '23 06:06 shixinyu

This is not a valid API document, and I cannot rely on it to complete the task. I have studied the differences between OpenAI's DALLE API and Azure's preview API previously, and they are quite significant, making it impossible to act as a proxy.

stulzq avatar Jun 07 '23 06:06 stulzq

Alright, thank you for your working. Let's wait for MS release full DALLE API.

shixinyu avatar Jun 07 '23 07:06 shixinyu

Alright, thank you for your working. Let's wait for MS release full DALLE API.

ok

stulzq avatar Jun 07 '23 07:06 stulzq