koishi-plugin-cocoyyy-console 1.0.16-beta.7 → 1.0.16-beta.9
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 +10 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1434,7 +1434,7 @@ async function callOpenRouter(api_url, api_key, api_model = "gpt-4o-mini", messa
|
|
|
1434
1434
|
const { data } = await import_axios.default.post(
|
|
1435
1435
|
api_url,
|
|
1436
1436
|
{
|
|
1437
|
-
api_model,
|
|
1437
|
+
model: api_model,
|
|
1438
1438
|
messages
|
|
1439
1439
|
},
|
|
1440
1440
|
{
|
|
@@ -1463,7 +1463,12 @@ async function callOpenRouter(api_url, api_key, api_model = "gpt-4o-mini", messa
|
|
|
1463
1463
|
const err = error;
|
|
1464
1464
|
const status = err.response?.status;
|
|
1465
1465
|
const detail = err.response?.data?.error || err.response?.data?.message || err.message;
|
|
1466
|
-
logger.error("[callOpenRouter Error]: OpenRouter 请求失败"
|
|
1466
|
+
logger.error("[callOpenRouter Error]: OpenRouter 请求失败", {
|
|
1467
|
+
status,
|
|
1468
|
+
detail,
|
|
1469
|
+
url: err.config?.url,
|
|
1470
|
+
payload: err.config?.data
|
|
1471
|
+
});
|
|
1467
1472
|
const errorMessage = `test error${status ? `(${status})` : ""}: ${detail}`;
|
|
1468
1473
|
return { err: errorMessage, resp: null };
|
|
1469
1474
|
}
|
|
@@ -1493,6 +1498,9 @@ __name(extractImageAndText, "extractImageAndText");
|
|
|
1493
1498
|
async function checkShitOrNot(session, parttern_msg, config) {
|
|
1494
1499
|
chatHistory = [];
|
|
1495
1500
|
chatHistory.push({ role: "user", content: [{ type: "text", text: parttern_msg }] });
|
|
1501
|
+
if (dev_mode) {
|
|
1502
|
+
logger.info("[checkShitOrNot Info]: chatHistory", { chatHistory });
|
|
1503
|
+
}
|
|
1496
1504
|
const { err, resp } = await callOpenRouter(config.api_url, config.api_key, config.api_model, chatHistory);
|
|
1497
1505
|
if (err != null) {
|
|
1498
1506
|
logger.error("[callOpenRouter Error1]: " + err);
|