symposium 0.1.3 → 0.1.4
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/Model.js +13 -0
- package/Symposium.js +10 -12
- package/package.json +1 -1
package/Model.js
ADDED
package/Symposium.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import Redis from "@travio/redis";
|
|
2
2
|
import OpenAI from "openai";
|
|
3
|
+
import {Model} from "./Model.js";
|
|
3
4
|
|
|
4
5
|
class Symposium {
|
|
5
6
|
static openai;
|
|
6
|
-
static models = [
|
|
7
|
-
{
|
|
8
|
-
label: 'gpt-3.5',
|
|
9
|
-
name: 'gpt-3.5-turbo-16k',
|
|
10
|
-
tokens: 16384,
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
label: 'gpt-4',
|
|
14
|
-
name: 'gpt-4',
|
|
15
|
-
tokens: 8192
|
|
16
|
-
}
|
|
17
|
-
];
|
|
7
|
+
static models = [];
|
|
18
8
|
|
|
19
9
|
static async init() {
|
|
10
|
+
this.loadModel(new Model('gpt-3.5-turbo-16k', 'gpt-3.5', 16384));
|
|
11
|
+
this.loadModel(new Model('gpt-4', 'gpt-4', 8192));
|
|
12
|
+
this.loadModel(new Model('gpt-4-1106-preview', 'gpt-4-turbo', 128000));
|
|
13
|
+
|
|
20
14
|
return Redis.init();
|
|
21
15
|
}
|
|
22
16
|
|
|
17
|
+
static loadModel(model) {
|
|
18
|
+
this.models.push(model);
|
|
19
|
+
}
|
|
20
|
+
|
|
23
21
|
static async getOpenAi() {
|
|
24
22
|
if (!this.openai)
|
|
25
23
|
this.openai = new OpenAI({apiKey: process.env.OPENAI_API_KEY});
|