halbot 1993.2.7 → 1993.2.8

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.
Files changed (2) hide show
  1. package/index.mjs +15 -15
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -36,20 +36,6 @@ const init = async (options) => {
36
36
  ]);
37
37
  let embedding;
38
38
  // init ai engines
39
- if (options?.googleApiKey) {
40
- await alan.init({
41
- provider: 'GEMINI', apiKey: options?.googleApiKey,
42
- model: options?.geminiModel, // only support custom model while initiating
43
- ...options || {},
44
- });
45
- ai['Gemini'] = {
46
- engine: 'GEMINI', priority: options?.geminiPriority || 0,
47
- };
48
- engines['GEMINI'] = {
49
- // save for reference not for prompting
50
- model: options?.geminiModel,
51
- };
52
- }
53
39
  if (options?.openaiApiKey || options?.chatGptApiKey) {
54
40
  await alan.init({
55
41
  provider: 'OPENAI',
@@ -57,13 +43,27 @@ const init = async (options) => {
57
43
  ...options || {},
58
44
  });
59
45
  ai['ChatGPT'] = {
60
- engine: 'CHATGPT', priority: options?.chatGptPriority || 1,
46
+ engine: 'CHATGPT', priority: options?.chatGptPriority || 0,
61
47
  };
62
48
  engines['CHATGPT'] = {
63
49
  // only support custom model while prompting
64
50
  model: options?.chatGptModel,
65
51
  };
66
52
  }
53
+ if (options?.googleApiKey) {
54
+ await alan.init({
55
+ provider: 'GEMINI', apiKey: options?.googleApiKey,
56
+ model: options?.geminiModel, // only support custom model while initiating
57
+ ...options || {},
58
+ });
59
+ ai['Gemini'] = {
60
+ engine: 'GEMINI', priority: options?.geminiPriority || 1,
61
+ };
62
+ engines['GEMINI'] = {
63
+ // save for reference not for prompting
64
+ model: options?.geminiModel,
65
+ };
66
+ }
67
67
  if (options?.claudeApiKey) {
68
68
  await alan.init({
69
69
  provider: 'CLAUDE', apiKey: options?.claudeApiKey,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "halbot",
3
3
  "description": "Just another `ChatGPT` / `Gemini` / `Mistral (by ollama)` Telegram bob, which is simple design, easy to use, extendable and fun.",
4
- "version": "1993.2.7",
4
+ "version": "1993.2.8",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/halbot",
7
7
  "type": "module",