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

azure的dall-e-3生成图片失败 #1848

Closed
2 tasks done
991547436 opened this issue Mar 27, 2024 · 3 comments
Closed
2 tasks done

azure的dall-e-3生成图片失败 #1848

991547436 opened this issue Mar 27, 2024 · 3 comments

Comments

@991547436
Copy link

前置确认

  • 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。

⚠️ 搜索issues中是否已存在类似问题

  • 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue

操作系统类型?

Windows

运行的python版本是?

python 3.10

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wechatmp(公众号, 订阅号)

复现步骤 🕹

QQ截图20240327150220

问题描述 😯

提示{'error': {'code': '404', 'message': 'Resource not found'}},通过sdk调用正确取图片的地址和参数如下,供参考

api_version = "2024-02-01"
url = "{}openai/deployments/dall-e-3/images/generations?api-version={}".format("https://xxx.openai.azure.com/", api_version)
api_key = api_key or openai.api_key
headers = {"api-key": api_key, "Content-Type": "application/json"}
logger = logging.getLogger(name)
try:
print(url)
body = {"prompt": query, "model": "dall-e-3"}
submission = requests.post(url, headers=headers, json=body)
print()
if "error" in submission.json():
return False, "图片生成失败" + submission.json()["error"]["message"]
else:
image_url = submission.json()["data"][0]["url"]
print(image_url)
return True, image_url
except Exception as e:
logger.error("create image error: {}".format(e))
return False, "图片生成失败"

终端日志 📒

<此处粘贴终端日志>
@cbaoox
Copy link

cbaoox commented Apr 22, 2024

我的提示create image error: 'operation-location',有没大神指点一下
[INFO][2024-04-22 12:29:28][bridge.py:56] - create bot chatGPTOnAzure for chat
[ERROR][2024-04-22 12:29:29][chat_gpt_bot.py:193] - create image error: 'operation-location'
[INFO][2024-04-22 12:29:29][wechatmp_channel.py:85] - [wechatmp] text cached, receiver oYaM96xwiXl6n-cpHHWGJ2g0jNWk
image

@6vision
Copy link
Collaborator

6vision commented Jul 18, 2024

#1809 应该修复了该问题

@6vision 6vision closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants