mirror of
https://github.com/LLM-Red-Team/qwen-free-api.git
synced 2024-12-23 03:29:21 +08:00
支持生成图像为空时重试
This commit is contained in:
parent
6abc2d760f
commit
a6a0806136
@ -6,5 +6,6 @@ export default {
|
|||||||
API_FILE_URL_INVALID: [-2003, '远程文件URL非法'],
|
API_FILE_URL_INVALID: [-2003, '远程文件URL非法'],
|
||||||
API_FILE_EXECEEDS_SIZE: [-2004, '远程文件超出大小'],
|
API_FILE_EXECEEDS_SIZE: [-2004, '远程文件超出大小'],
|
||||||
API_CHAT_STREAM_PUSHING: [-2005, '已有对话流正在输出'],
|
API_CHAT_STREAM_PUSHING: [-2005, '已有对话流正在输出'],
|
||||||
API_CONTENT_FILTERED: [-2006, '内容由于合规问题已被阻止生成']
|
API_CONTENT_FILTERED: [-2006, '内容由于合规问题已被阻止生成'],
|
||||||
|
API_IMAGE_GENERATION_FAILED: [-2007, '图像生成失败']
|
||||||
}
|
}
|
@ -260,6 +260,9 @@ async function generateImages(
|
|||||||
// 异步移除会话,如果消息不合规,此操作可能会抛出数据库错误异常,请忽略
|
// 异步移除会话,如果消息不合规,此操作可能会抛出数据库错误异常,请忽略
|
||||||
removeConversation(convId, ticket).catch((err) => console.error(err));
|
removeConversation(convId, ticket).catch((err) => console.error(err));
|
||||||
|
|
||||||
|
if(imageUrls.length == 0)
|
||||||
|
throw new APIException(EX.API_IMAGE_GENERATION_FAILED);
|
||||||
|
|
||||||
return imageUrls;
|
return imageUrls;
|
||||||
})().catch((err) => {
|
})().catch((err) => {
|
||||||
if (retryCount < MAX_RETRY_COUNT) {
|
if (retryCount < MAX_RETRY_COUNT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user