halbot 1993.2.85 → 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 CHANGED
@@ -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 <-> $3 LIMIT ${SEARCH_LIMIT}`
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
  ]);
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.85",
4
+ "version": "1993.2.86",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",
@@ -1,48 +1,12 @@
1
- import { alan, bot, utilitas } from '../index.mjs';
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 });
5
5
  const allAi = ais.map(x => x.id);
6
- switch (ctx.cmd?.cmd) {
6
+ switch (ctx.cmd.cmd) {
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,9 +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 model `temporary` without touching your settings.',
57
- 'Example 1: /[AI_ID] Say hello to [AI_ID]!',
58
- 'Example 2: /all Say hello to all AIs!',
20
+ '¶ Use an AI engine `temporary` without touching your settings.',
59
21
  ]),
60
- cmdx: {},
22
+ cmds: {
23
+ all: 'Use all AI engines simultaneously: /all Say hello to all AIs!',
24
+ },
61
25
  };