dan92 commited on
Commit
a2c856f
·
verified ·
1 Parent(s): 53be646

Upload index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
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
  }