We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Windows
python 3.10
Latest Release
channel
wechatmp(公众号, 订阅号)
提示{'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, "图片生成失败"
<此处粘贴终端日志>
The text was updated successfully, but these errors were encountered:
+1,官方的代码更新了,需要适配下
https://learn.microsoft.com/en-us/azure/ai-services/openai/dall-e-quickstart?tabs=dalle3%2Ccommand-line&pivots=programming-language-python#generate-images-with-dall-e
Sorry, something went wrong.
我的提示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
#1809 应该修复了该问题
No branches or pull requests
前置确认
操作系统类型?
Windows
运行的python版本是?
python 3.10
使用的chatgpt-on-wechat版本是?
Latest Release
运行的
channel
类型是?wechatmp(公众号, 订阅号)
复现步骤 🕹
问题描述 😯
提示{'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, "图片生成失败"
终端日志 📒
The text was updated successfully, but these errors were encountered: