neogram 9.3.0 → 9.3.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/README.md +623 -1001
- package/examples/README.md +47 -0
- package/examples/ai-bot.js +155 -0
- package/examples/simple-bot.js +30 -0
- package/examples/test-bot-debug.js +26 -0
- package/examples/test-bot-full.js +221 -0
- package/examples/test-bot.js +196 -0
- package/package.json +6 -11
- package/src/ai/OnlySQ.js +6 -2
- package/types/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -8,15 +8,11 @@
|
|
|
8
8
|
"contributors": [
|
|
9
9
|
{
|
|
10
10
|
"name": "AndrewImm-OP",
|
|
11
|
-
"email": "bessmertnyja89@gmail.com"
|
|
12
|
-
"url": "https://github.com/AndrewImm-OP"
|
|
11
|
+
"email": "bessmertnyja89@gmail.com"
|
|
13
12
|
}
|
|
14
13
|
],
|
|
15
14
|
"license": "MIT",
|
|
16
|
-
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/AndrewImm-OP/neogram.git"
|
|
19
|
-
},
|
|
15
|
+
|
|
20
16
|
"keywords": [
|
|
21
17
|
"telegram",
|
|
22
18
|
"bot",
|
|
@@ -30,6 +26,7 @@
|
|
|
30
26
|
"files": [
|
|
31
27
|
"src",
|
|
32
28
|
"types",
|
|
29
|
+
"examples",
|
|
33
30
|
"README.md",
|
|
34
31
|
"LICENSE"
|
|
35
32
|
],
|
|
@@ -48,9 +45,7 @@
|
|
|
48
45
|
"cheerio": "^1.0.0",
|
|
49
46
|
"form-data": "^4.0.0"
|
|
50
47
|
},
|
|
51
|
-
"version": "9.3.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
"homepage": "https://github.com/AndrewImm-OP/neogram#readme"
|
|
48
|
+
"version": "9.3.2"
|
|
49
|
+
|
|
50
|
+
|
|
56
51
|
}
|
package/src/ai/OnlySQ.js
CHANGED
|
@@ -2,6 +2,10 @@ import axios from 'axios';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
|
|
4
4
|
export class OnlySQ {
|
|
5
|
+
constructor(options = {}) {
|
|
6
|
+
this.apiKey = options.apiKey || 'openai';
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
async getModels({
|
|
6
10
|
modality = null,
|
|
7
11
|
can_tools = null,
|
|
@@ -70,7 +74,7 @@ export class OnlySQ {
|
|
|
70
74
|
const { data } = await axios.post('https://api.onlysq.ru/ai/v2', payload, {
|
|
71
75
|
timeout: 30000,
|
|
72
76
|
headers: {
|
|
73
|
-
'Authorization':
|
|
77
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
74
78
|
'Content-Type': 'application/json',
|
|
75
79
|
'User-Agent': 'Mozilla/5.0 (compatible; OnlySQ/1.0)',
|
|
76
80
|
},
|
|
@@ -103,7 +107,7 @@ export class OnlySQ {
|
|
|
103
107
|
{
|
|
104
108
|
timeout: 60000, // Image generation can take longer
|
|
105
109
|
headers: {
|
|
106
|
-
'Authorization':
|
|
110
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
107
111
|
'Content-Type': 'application/json',
|
|
108
112
|
'User-Agent': 'Mozilla/5.0 (compatible; OnlySQ/1.0)',
|
|
109
113
|
},
|
package/types/index.d.ts
CHANGED