Spaces:
Sleeping
Sleeping
Upload index.js
Browse files
index.js
CHANGED
@@ -527,8 +527,8 @@ async function handleNormalResponse(response, model, res) {
|
|
527 |
}
|
528 |
} else if (linejosn.response === "modelResponse" && model === 'grok-latest-image') {
|
529 |
console.log('检测到图片响应:', linejosn.modelResponse);
|
530 |
-
if (linejosn?.modelResponse?.generatedImageUrls) {
|
531 |
-
imageUrl = linejosn.modelResponse.generatedImageUrls;
|
532 |
console.log('获取到图片URL:', imageUrl);
|
533 |
}
|
534 |
}
|
|
|
527 |
}
|
528 |
} else if (linejosn.response === "modelResponse" && model === 'grok-latest-image') {
|
529 |
console.log('检测到图片响应:', linejosn.modelResponse);
|
530 |
+
if (linejosn?.modelResponse?.generatedImageUrls?.length > 0) {
|
531 |
+
imageUrl = linejosn.modelResponse.generatedImageUrls[0]; // 获取第一个URL
|
532 |
console.log('获取到图片URL:', imageUrl);
|
533 |
}
|
534 |
}
|