mirror of
https://github.com/Yanyutin753/RefreshToV1Api.git
synced 2025-10-17 00:24:13 +00:00
[fix] 支持绘图失败的错误输出
This commit is contained in:
15
main.py
15
main.py
@@ -187,9 +187,9 @@ CORS(app, resources={r"/images/*": {"origins": "*"}})
|
|||||||
PANDORA_UPLOAD_URL = 'files.pandoranext.com'
|
PANDORA_UPLOAD_URL = 'files.pandoranext.com'
|
||||||
|
|
||||||
|
|
||||||
VERSION = '0.4.6'
|
VERSION = '0.4.7'
|
||||||
# VERSION = 'test'
|
# VERSION = 'test'
|
||||||
UPDATE_INFO = '支持使用随机ua头下载gpt-4-vision接口传入的文件'
|
UPDATE_INFO = '支持绘图失败的错误输出'
|
||||||
# UPDATE_INFO = '【仅供临时测试使用】 '
|
# UPDATE_INFO = '【仅供临时测试使用】 '
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
@@ -1966,6 +1966,17 @@ def images_generations():
|
|||||||
pass
|
pass
|
||||||
# 构造响应的 JSON 结构
|
# 构造响应的 JSON 结构
|
||||||
response_json = {}
|
response_json = {}
|
||||||
|
# 检查 image_urls 是否为空
|
||||||
|
if not image_urls:
|
||||||
|
response_json = {
|
||||||
|
"error": {
|
||||||
|
"message": all_new_text, # 使用累积的文本作为错误信息
|
||||||
|
"type": "invalid_request_error",
|
||||||
|
"param": "",
|
||||||
|
"code": "content_policy_violation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else:
|
||||||
if response_format == "url":
|
if response_format == "url":
|
||||||
response_json = {
|
response_json = {
|
||||||
"created": int(time.time()), # 使用当前时间戳
|
"created": int(time.time()), # 使用当前时间戳
|
||||||
|
Reference in New Issue
Block a user