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/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
- "repository": {
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.0",
52
- "bugs": {
53
- "url": "https://github.com/AndrewImm-OP/neogram/issues"
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': 'Bearer openai',
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': 'Bearer openai',
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
@@ -764,6 +764,8 @@ export declare class Bot {
764
764
 
765
765
  // AI Classes
766
766
  export declare class OnlySQ {
767
+ constructor(options?: { apiKey?: string });
768
+
767
769
  getModels(options?: {
768
770
  modality?: string | string[];
769
771
  can_tools?: boolean;