@langitdeveloper/baileys 2.2.1 → 2.2.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/Utils/bot-toolkit.js +10 -4
- package/package.json +1 -1
package/lib/Utils/bot-toolkit.js
CHANGED
|
@@ -429,12 +429,18 @@ const makeBotToolkit = (conn, logger) => {
|
|
|
429
429
|
}
|
|
430
430
|
rateLimitBuckets.set(bucketKey, now);
|
|
431
431
|
return false;
|
|
432
|
-
}
|
|
433
|
-
|
|
432
|
+
},
|
|
433
|
+
/**
|
|
434
|
+
* dispatcher (e.g. `.aimahiru`) - this function only does the actual
|
|
435
|
+
* call + prompt shaping, not command parsing.
|
|
436
|
+
*
|
|
437
|
+
* @param input.errorText the error/stack trace the user is hitting
|
|
438
|
+
* @param input.code the snippet of their bot code, if any
|
|
439
|
+
*/
|
|
434
440
|
async aiMahiru({ errorText, code, apiKey, model = 'claude-haiku-4-5-20251001' }) {
|
|
435
|
-
const key = apiKey || process.env.
|
|
441
|
+
const key = apiKey || process.env.api_key;
|
|
436
442
|
if (!key) {
|
|
437
|
-
throw new Error('aiMahiru: no Anthropic API key provided (pass apiKey or set
|
|
443
|
+
throw new Error('aiMahiru: no Anthropic API key provided (pass apiKey or set api_key)');
|
|
438
444
|
}
|
|
439
445
|
const promptParts = [
|
|
440
446
|
'Kamu adalah Mahiru, asisten debug buat fork Baileys bernama mahiru-bails/@langitdeveloper.',
|