koishi-plugin-aka-ai-generator 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +9 -7
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -771,8 +771,8 @@ var GeminiProvider = class {
|
|
|
771
771
|
logger
|
|
772
772
|
);
|
|
773
773
|
imageParts.push({
|
|
774
|
-
|
|
775
|
-
|
|
774
|
+
inlineData: {
|
|
775
|
+
mimeType,
|
|
776
776
|
data
|
|
777
777
|
}
|
|
778
778
|
});
|
|
@@ -792,7 +792,11 @@ var GeminiProvider = class {
|
|
|
792
792
|
}
|
|
793
793
|
],
|
|
794
794
|
generationConfig: {
|
|
795
|
-
responseModalities: ["IMAGE"]
|
|
795
|
+
responseModalities: ["IMAGE"],
|
|
796
|
+
imageConfig: {
|
|
797
|
+
aspectRatio: "16:9",
|
|
798
|
+
imageSize: "4K"
|
|
799
|
+
}
|
|
796
800
|
}
|
|
797
801
|
};
|
|
798
802
|
logger.debug("调用 Gemini API", { prompt, imageCount: urls.length, numImages, current: i + 1, endpoint });
|
|
@@ -802,10 +806,8 @@ var GeminiProvider = class {
|
|
|
802
806
|
requestData,
|
|
803
807
|
{
|
|
804
808
|
headers: {
|
|
805
|
-
"Content-Type": "application/json"
|
|
806
|
-
|
|
807
|
-
params: {
|
|
808
|
-
key: this.config.apiKey
|
|
809
|
+
"Content-Type": "application/json",
|
|
810
|
+
"x-goog-api-key": this.config.apiKey
|
|
809
811
|
},
|
|
810
812
|
timeout: this.config.apiTimeout * 1e3
|
|
811
813
|
}
|