halbot 1993.2.87 → 1993.2.89
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 +8 -8
- package/skills/40_dream.mjs +15 -8
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.89",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://github.com/Leask/halbot",
|
|
7
7
|
"type": "module",
|
|
@@ -29,29 +29,29 @@
|
|
|
29
29
|
"url": "https://github.com/Leask/halbot.git"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@anthropic-ai/sdk": "^0.
|
|
32
|
+
"@anthropic-ai/sdk": "^0.40.1",
|
|
33
33
|
"@anthropic-ai/vertex-sdk": "^0.7.0",
|
|
34
34
|
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
35
35
|
"@ffprobe-installer/ffprobe": "^2.1.2",
|
|
36
36
|
"@google-cloud/speech": "^7.0.1",
|
|
37
37
|
"@google-cloud/text-to-speech": "^6.0.1",
|
|
38
38
|
"@google-cloud/vision": "^5.1.0",
|
|
39
|
-
"@google/genai": "^0.
|
|
39
|
+
"@google/genai": "^0.10.0",
|
|
40
40
|
"@mozilla/readability": "^0.6.0",
|
|
41
41
|
"fluent-ffmpeg": "^2.1.3",
|
|
42
42
|
"ioredis": "^5.6.1",
|
|
43
|
-
"js-tiktoken": "^1.0.
|
|
43
|
+
"js-tiktoken": "^1.0.20",
|
|
44
44
|
"jsdom": "^26.1.0",
|
|
45
45
|
"lorem-ipsum": "^2.0.8",
|
|
46
46
|
"mime": "^4.0.7",
|
|
47
|
-
"mysql2": "^3.14.
|
|
47
|
+
"mysql2": "^3.14.1",
|
|
48
48
|
"office-text-extractor": "^3.0.3",
|
|
49
|
-
"openai": "^4.
|
|
50
|
-
"pg": "^8.
|
|
49
|
+
"openai": "^4.96.2",
|
|
50
|
+
"pg": "^8.15.6",
|
|
51
51
|
"pgvector": "^0.2.0",
|
|
52
52
|
"telegraf": "^4.16.3",
|
|
53
53
|
"tesseract.js": "^6.0.1",
|
|
54
|
-
"utilitas": "^1999.1.
|
|
54
|
+
"utilitas": "^1999.1.54",
|
|
55
55
|
"youtube-transcript": "^1.2.1"
|
|
56
56
|
}
|
|
57
57
|
}
|
package/skills/40_dream.mjs
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { bot } from '../index.mjs';
|
|
2
2
|
|
|
3
3
|
const action = async (ctx, next) => {
|
|
4
|
+
let provider = '';
|
|
5
|
+
switch (ctx.cmd.cmd) {
|
|
6
|
+
case 'gptimage': provider = 'OPENAI'; break;
|
|
7
|
+
case 'dream': case 'imagen': default: provider = 'GEMINI';
|
|
8
|
+
}
|
|
4
9
|
if (!ctx.cmd.args) {
|
|
5
10
|
return await ctx.ok('Please input your prompt.');
|
|
6
11
|
}
|
|
7
|
-
let [objMsg,
|
|
12
|
+
let [objMsg, images] = [(await ctx.ok('💭'))[0], null]; //tts = null
|
|
8
13
|
try {
|
|
9
|
-
images = await ctx._.image.generate(ctx.cmd.args, {
|
|
14
|
+
images = await ctx._.image.generate(ctx.cmd.args, {
|
|
15
|
+
provider, expected: 'FILE'
|
|
16
|
+
});
|
|
10
17
|
} catch (err) {
|
|
11
18
|
return await ctx.er(err.message || 'Error generating image.',
|
|
12
19
|
{ lastMessageId: objMsg.message_id });
|
|
13
20
|
}
|
|
14
21
|
await ctx.deleteMessage(objMsg.message_id);
|
|
15
22
|
for (let image of images || []) {
|
|
16
|
-
tts = image.tts || '';
|
|
23
|
+
// tts = image.tts || '';
|
|
17
24
|
await ctx.image(image.data, { caption: image.caption || '' });
|
|
18
25
|
await ctx.timeout();
|
|
19
26
|
}
|
|
20
|
-
await ctx.shouldSpeech(tts);
|
|
27
|
+
// await ctx.shouldSpeech(tts);
|
|
21
28
|
};
|
|
22
29
|
|
|
23
30
|
export const { name, run, priority, func, cmds, help } = {
|
|
@@ -26,16 +33,16 @@ export const { name, run, priority, func, cmds, help } = {
|
|
|
26
33
|
priority: 40,
|
|
27
34
|
func: action,
|
|
28
35
|
help: bot.lines([
|
|
29
|
-
'¶ Use Google `Imagen` (default) or OpenAI `
|
|
36
|
+
'¶ Use Google `Imagen` (default) or OpenAI `GPT Image` to generate images.',
|
|
30
37
|
'Example 1: /dream a cat in a rocket',
|
|
31
38
|
'¶ Use `Imagen` to generate images.',
|
|
32
39
|
'Example 2: /imagen a cat in a car',
|
|
33
|
-
'¶ Use `
|
|
34
|
-
'Example: /
|
|
40
|
+
'¶ Use `GPT Image` to generate images.',
|
|
41
|
+
'Example: /gptimage a cat on a bike',
|
|
35
42
|
]),
|
|
36
43
|
cmds: {
|
|
37
44
|
dream: 'Generate images with default model: /dream `PROMPT`',
|
|
38
45
|
imagen: 'Generate images with `Imagen`: /imagen `PROMPT`',
|
|
39
|
-
|
|
46
|
+
gptimage: 'Generate images with `GPT Image`: /gptimage `PROMPT`',
|
|
40
47
|
},
|
|
41
48
|
};
|