hexo-theme-shokax 0.4.24 → 0.4.25
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/package.json
CHANGED
@@ -22,13 +22,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
22
22
|
));
|
23
23
|
var import_node_crypto = require("node:crypto");
|
24
24
|
var import_promises = __toESM(require("node:fs/promises"));
|
25
|
-
const config = hexo.theme.config.summary;
|
26
25
|
async function getSummaryByAPI(content) {
|
27
|
-
const apiKey = config.apiKey;
|
28
|
-
const apiUrl = config.apiUrl;
|
29
|
-
const model = config.model;
|
30
|
-
const temperature = config.temperature ?? 1.3;
|
31
|
-
const initalPrompt = config.initalPrompt;
|
26
|
+
const apiKey = hexo.theme.config.summary.apiKey;
|
27
|
+
const apiUrl = hexo.theme.config.summary.apiUrl;
|
28
|
+
const model = hexo.theme.config.summary.model;
|
29
|
+
const temperature = hexo.theme.config.summary.temperature ?? 1.3;
|
30
|
+
const initalPrompt = hexo.theme.config.summary.initalPrompt;
|
32
31
|
const res = await fetch(apiUrl, {
|
33
32
|
method: "POST",
|
34
33
|
headers: {
|
@@ -110,7 +109,7 @@ hexo.extend.generator.register("summary_ai", async function(locals) {
|
|
110
109
|
await db.readDB();
|
111
110
|
const postArray = posts.toArray();
|
112
111
|
const pLimit = require("@common.js/p-limit").default;
|
113
|
-
const concurrencyLimit = pLimit(config?.concurrency || 5);
|
112
|
+
const concurrencyLimit = pLimit(hexo.theme.config.summary?.concurrency || 5);
|
114
113
|
const processingPromises = postArray.map((post) => concurrencyLimit(async () => {
|
115
114
|
const content = post.content;
|
116
115
|
const path = post.path;
|