halbot 1993.2.84 → 1993.2.86
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/hal.mjs +7 -7
- package/package.json +1 -1
- package/skills/-8845_thread.mjs +1 -1
- package/skills/20_instant.mjs +2 -43
package/lib/hal.mjs
CHANGED
|
@@ -557,7 +557,7 @@ const subconscious = [{
|
|
|
557
557
|
}
|
|
558
558
|
await ctx.ok(resp, { md });
|
|
559
559
|
}, help: bot.lines([
|
|
560
|
-
'Basic behaviors for debug only.',
|
|
560
|
+
'¶ Basic behaviors for debug only.',
|
|
561
561
|
]), cmds: {
|
|
562
562
|
thethreelaws: `Isaac Asimov's [Three Laws of Robotics](https://en.wikipedia.org/wiki/Three_Laws_of_Robotics)`,
|
|
563
563
|
ultimateanswer: '[The Answer to the Ultimate Question of Life, The Universe, and Everything](https://bit.ly/43wDhR3).',
|
|
@@ -817,7 +817,7 @@ const subconscious = [{
|
|
|
817
817
|
}
|
|
818
818
|
await ctx.ok(lines2(help), { md: true });
|
|
819
819
|
}, help: bot.lines([
|
|
820
|
-
'Basic syntax of this document:',
|
|
820
|
+
'¶ Basic syntax of this document:',
|
|
821
821
|
'Scheme for commands: /`COMMAND`: `DESCRIPTION`',
|
|
822
822
|
'Scheme for options: `OPTION`(`SHORT`), `TYPE`(`DEFAULT`): `DESCRIPTION`',
|
|
823
823
|
]), cmds: {
|
|
@@ -856,7 +856,7 @@ const subconscious = [{
|
|
|
856
856
|
break;
|
|
857
857
|
}
|
|
858
858
|
}, help: bot.lines([
|
|
859
|
-
'Configure the bot by UNIX/Linux CLI style.',
|
|
859
|
+
'¶ Configure the bot by UNIX/Linux CLI style.',
|
|
860
860
|
'Using [node:util.parseArgs](https://nodejs.org/docs/latest-v21.x/api/util.html#utilparseargsconfig) to parse arguments.',
|
|
861
861
|
]), cmds: {
|
|
862
862
|
toggle: 'Toggle configurations. Only works for boolean values.',
|
|
@@ -899,8 +899,8 @@ const subconscious = [{
|
|
|
899
899
|
const vector = await hal._.embedding(keyWords);
|
|
900
900
|
result = await hal._.database?.client?.query?.(
|
|
901
901
|
`SELECT * FROM ${table} WHERE bot_id = $1 AND chat_id = $2`
|
|
902
|
-
+ ` ORDER BY distilled_vector
|
|
903
|
-
+ ` OFFSET $4`, [
|
|
902
|
+
+ ` ORDER BY distilled_vector <=> $3 ASC`
|
|
903
|
+
+ ` LIMIT ${SEARCH_LIMIT} OFFSET $4`, [
|
|
904
904
|
ctx.botInfo.id, ctx.chatId,
|
|
905
905
|
await dbio.encodeVector(vector), offset
|
|
906
906
|
]);
|
|
@@ -930,7 +930,7 @@ const subconscious = [{
|
|
|
930
930
|
})));
|
|
931
931
|
result.length || await ctx.er('No more records.');
|
|
932
932
|
}, help: bot.lines([
|
|
933
|
-
'Search history.',
|
|
933
|
+
'¶ Search history.',
|
|
934
934
|
'Example 1: /search Answer to the Ultimate Question',
|
|
935
935
|
'Example 2: /search Answer to the Ultimate Question --skip=10',
|
|
936
936
|
]), cmds: {
|
|
@@ -941,7 +941,7 @@ const subconscious = [{
|
|
|
941
941
|
await ctx.shouldSpeech();
|
|
942
942
|
await next();
|
|
943
943
|
}, help: bot.lines([
|
|
944
|
-
'When enabled, the bot will speak out the answer if available.',
|
|
944
|
+
'¶ When enabled, the bot will speak out the answer if available.',
|
|
945
945
|
'Example 1: /set --tts on',
|
|
946
946
|
'Example 2: /set --tts off',
|
|
947
947
|
]), args: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "halbot",
|
|
3
3
|
"description": "Just another `ChatGPT` / `Gemini` / `Claude` / `Azure` / `Jina` / `Ollama` Telegram bob, which is simple design, easy to use, extendable and fun.",
|
|
4
|
-
"version": "1993.2.
|
|
4
|
+
"version": "1993.2.86",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/halbot",
|
|
7
7
|
"type": "module",
|
package/skills/-8845_thread.mjs
CHANGED
|
@@ -173,7 +173,7 @@ export const { name, run, priority, func, help, cmdx } = {
|
|
|
173
173
|
run: true,
|
|
174
174
|
priority: -8845,
|
|
175
175
|
func: action,
|
|
176
|
-
help: 'Thread management.',
|
|
176
|
+
help: '¶ Thread management.',
|
|
177
177
|
cmdx: {
|
|
178
178
|
clear: 'Clear current thread.',
|
|
179
179
|
end: 'End current thread.',
|
package/skills/20_instant.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alan, bot
|
|
1
|
+
import { alan, bot } from '../index.mjs';
|
|
2
2
|
|
|
3
3
|
const action = async (ctx, next) => {
|
|
4
4
|
const ais = await alan.getAi(null, { all: true });
|
|
@@ -7,42 +7,6 @@ const action = async (ctx, next) => {
|
|
|
7
7
|
case 'all':
|
|
8
8
|
ctx.selectedAi = allAi;
|
|
9
9
|
ctx.hello(ctx.cmd.args);
|
|
10
|
-
break;
|
|
11
|
-
case 'chatgpt':
|
|
12
|
-
if (!utilitas.insensitiveHas(allAi, 'chatgpt')) {
|
|
13
|
-
return await ctx.er('ChatGPT is not available.');
|
|
14
|
-
}
|
|
15
|
-
ctx.selectedAi = ['ChatGPT'];
|
|
16
|
-
ctx.hello(ctx.cmd.args);
|
|
17
|
-
break;
|
|
18
|
-
case 'gemini':
|
|
19
|
-
if (!utilitas.insensitiveHas(allAi, 'gemini')) {
|
|
20
|
-
return await ctx.er('Gemini is not available.');
|
|
21
|
-
}
|
|
22
|
-
ctx.selectedAi = ['Gemini'];
|
|
23
|
-
ctx.hello(ctx.cmd.args);
|
|
24
|
-
break;
|
|
25
|
-
case 'claude':
|
|
26
|
-
if (!utilitas.insensitiveHas(allAi, 'claude')) {
|
|
27
|
-
return await ctx.er('Claude is not available.');
|
|
28
|
-
}
|
|
29
|
-
ctx.selectedAi = ['Claude'];
|
|
30
|
-
ctx.hello(ctx.cmd.args);
|
|
31
|
-
break;
|
|
32
|
-
case 'azure':
|
|
33
|
-
if (!utilitas.insensitiveHas(allAi, 'azure')) {
|
|
34
|
-
return await ctx.er('Azure is not available.');
|
|
35
|
-
}
|
|
36
|
-
ctx.selectedAi = ['Azure'];
|
|
37
|
-
ctx.hello(ctx.cmd.args);
|
|
38
|
-
break;
|
|
39
|
-
case 'ollama':
|
|
40
|
-
if (!utilitas.insensitiveHas(allAi, 'ollama')) {
|
|
41
|
-
return await ctx.er('Ollama is not available.');
|
|
42
|
-
}
|
|
43
|
-
ctx.selectedAi = ['Ollama'];
|
|
44
|
-
ctx.hello(ctx.cmd.args);
|
|
45
|
-
break;
|
|
46
10
|
}
|
|
47
11
|
await next();
|
|
48
12
|
};
|
|
@@ -53,14 +17,9 @@ export const { name, run, priority, func, help, cmds } = {
|
|
|
53
17
|
priority: 20,
|
|
54
18
|
func: action,
|
|
55
19
|
help: bot.lines([
|
|
56
|
-
'Use an AI engine `temporary` without touching your settings.',
|
|
20
|
+
'¶ Use an AI engine `temporary` without touching your settings.',
|
|
57
21
|
]),
|
|
58
22
|
cmds: {
|
|
59
23
|
all: 'Use all AI engines simultaneously: /all Say hello to all AIs!',
|
|
60
|
-
gemini: 'Use ♊️ Gemini temporary: /gemini Say hello to Gemini!',
|
|
61
|
-
chatgpt: 'Use ⚛️ ChatGPT temporary: /chatgpt Say hello to ChatGPT!',
|
|
62
|
-
claude: 'Use ✴️ Claude temporary: /claude Say hello to Claude!',
|
|
63
|
-
azure: 'Use ☁️ Azure temporary: /azure Say hello to Azure!',
|
|
64
|
-
ollama: 'Use 🦙 Ollama temporary: /ollama Say hello to Ollama!',
|
|
65
24
|
},
|
|
66
25
|
};
|