Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require support DALL-E model #36

Open
shixinyu opened this issue Jun 6, 2023 · 6 comments
Open

Require support DALL-E model #36

shixinyu opened this issue Jun 6, 2023 · 6 comments

Comments

@shixinyu
Copy link

shixinyu commented Jun 6, 2023

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

@stulzq
Copy link
Owner

stulzq commented Jun 6, 2023

Is there an API documentation?

@stulzq
Copy link
Owner

stulzq commented Jun 6, 2023

#22

@shixinyu
Copy link
Author

shixinyu commented Jun 7, 2023

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?

@stulzq
Copy link
Owner

stulzq commented Jun 7, 2023

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.

@shixinyu
Copy link
Author

shixinyu commented Jun 7, 2023

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

@stulzq
Copy link
Owner

stulzq commented Jun 7, 2023

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

ok

@stulzq stulzq closed this as completed Jun 8, 2023
@stulzq stulzq reopened this Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants