Spaces:
Sleeping
Sleeping
Update index.js
Browse files
index.js
CHANGED
@@ -608,6 +608,7 @@ async function handleResponse(response, model, res, isStream) {
|
|
608 |
if (!data.trim()) continue;
|
609 |
if (data === "[DONE]") continue;
|
610 |
const linejosn = JSON.parse(data);
|
|
|
611 |
if (linejosn?.error) {
|
612 |
Logger.error(JSON.stringify(linejosn, null, 2), 'Server');
|
613 |
stream.destroy();
|
@@ -761,7 +762,12 @@ async function handleImageResponse(imageUrl) {
|
|
761 |
} else {
|
762 |
Logger.info("生图成功", 'Server');
|
763 |
const result = await responseURL.json();
|
764 |
-
|
|
|
|
|
|
|
|
|
|
|
765 |
}
|
766 |
}
|
767 |
}
|
|
|
608 |
if (!data.trim()) continue;
|
609 |
if (data === "[DONE]") continue;
|
610 |
const linejosn = JSON.parse(data);
|
611 |
+
Logger.info(linejosn, 'Server');
|
612 |
if (linejosn?.error) {
|
613 |
Logger.error(JSON.stringify(linejosn, null, 2), 'Server');
|
614 |
stream.destroy();
|
|
|
762 |
} else {
|
763 |
Logger.info("生图成功", 'Server');
|
764 |
const result = await responseURL.json();
|
765 |
+
try {
|
766 |
+
var url = result.data.links.url
|
767 |
+
return ``
|
768 |
+
} catch (error) {
|
769 |
+
return error
|
770 |
+
}
|
771 |
}
|
772 |
}
|
773 |
}
|