halbot 1991.1.12 → 1991.1.14
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 +1 -1
- package/skills/10_engine.mjs +1 -1
- package/skills/60_prepare.mjs +7 -7
- package/skills/70_chat.mjs +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "halbot",
|
|
3
3
|
"description": "Just another `ChatGPT` / `Gemini` / `Mistral (by ollama)` Telegram bob, which is simple design, easy to use, extendable and fun.",
|
|
4
|
-
"version": "1991.1.
|
|
4
|
+
"version": "1991.1.14",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/halbot",
|
|
7
7
|
"type": "module",
|
package/skills/10_engine.mjs
CHANGED
|
@@ -52,7 +52,7 @@ export const { name, run, priority, func, help, args } = {
|
|
|
52
52
|
validate: validateAi,
|
|
53
53
|
},
|
|
54
54
|
render: {
|
|
55
|
-
type: 'string', short: 'r', default: bot.BINARY_STRINGS[
|
|
55
|
+
type: 'string', short: 'r', default: bot.BINARY_STRINGS[0],
|
|
56
56
|
desc: `\`(${bot.BINARY_STRINGS.join(', ')})\` Enable/Disable enhanced output rendering.`,
|
|
57
57
|
validate: utilitas.humanReadableBoolean,
|
|
58
58
|
},
|
package/skills/60_prepare.mjs
CHANGED
|
@@ -4,14 +4,14 @@ const action = async (ctx, next) => {
|
|
|
4
4
|
// avatar
|
|
5
5
|
if (ctx.result) {
|
|
6
6
|
ctx.avatar = '⚙️';
|
|
7
|
-
} else if (ctx.
|
|
8
|
-
ctx.avatar = bot.EMOJI_SPEECH; ctx.result = utilitas.trim(ctx.
|
|
9
|
-
} else if (ctx.
|
|
10
|
-
ctx.avatar = '🔘'; ctx.result = utilitas.trim(ctx.
|
|
11
|
-
} else if (ctx.
|
|
7
|
+
} else if (ctx.m?.voice) {
|
|
8
|
+
ctx.avatar = bot.EMOJI_SPEECH; ctx.result = utilitas.trim(ctx.txt);
|
|
9
|
+
} else if (ctx.m?.data) {
|
|
10
|
+
ctx.avatar = '🔘'; ctx.result = utilitas.trim(ctx.txt);
|
|
11
|
+
} else if (ctx.m?.poll) {
|
|
12
12
|
ctx.avatar = '📊';
|
|
13
13
|
} else if (ctx.cmd?.cmd && ctx.cmd?.cmd !== 'clear') {
|
|
14
|
-
ctx.avatar = '🚀'; ctx.result = utilitas.trim(ctx.
|
|
14
|
+
ctx.avatar = '🚀'; ctx.result = utilitas.trim(ctx.txt);
|
|
15
15
|
} else {
|
|
16
16
|
ctx.avatar = '😸';
|
|
17
17
|
}
|
|
@@ -20,7 +20,7 @@ const action = async (ctx, next) => {
|
|
|
20
20
|
const additionInfo = ctx.collected.filter(
|
|
21
21
|
x => String.isString(x.content)
|
|
22
22
|
).map(x => x.content).join('\n').split(' ').filter(x => x);
|
|
23
|
-
ctx.prompt = (ctx.
|
|
23
|
+
ctx.prompt = (ctx.txt || '') + '\n\n';
|
|
24
24
|
while (await alan.countTokens(ctx.prompt) < maxInputTokens
|
|
25
25
|
&& additionInfo.length) {
|
|
26
26
|
ctx.prompt += ` ${additionInfo.shift()}`;
|
package/skills/70_chat.mjs
CHANGED
|
@@ -47,8 +47,8 @@ const action = async (ctx, next) => {
|
|
|
47
47
|
await ok(onProgress);
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
msgs[n] = ctx.session.config?.render ===
|
|
51
|
-
? resp.
|
|
50
|
+
msgs[n] = ctx.session.config?.render === true
|
|
51
|
+
? resp.rendered : resp.text;
|
|
52
52
|
tts[n] = ctx.selectedAi.length === 1
|
|
53
53
|
&& !msgs[n].split('\n').some(x => /^```/.test(x))
|
|
54
54
|
? resp.spoken : '';
|