symposium 2.1.0 → 2.1.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/Symposium.js +7 -5
- package/package.json +1 -1
package/Symposium.js
CHANGED
|
@@ -8,6 +8,7 @@ export default class Symposium {
|
|
|
8
8
|
static models = new Map();
|
|
9
9
|
static storage = null;
|
|
10
10
|
static transcription_model = null;
|
|
11
|
+
static embedding_model = null;
|
|
11
12
|
|
|
12
13
|
/*
|
|
13
14
|
* Storage must expose the following methods:
|
|
@@ -76,7 +77,7 @@ export default class Symposium {
|
|
|
76
77
|
|
|
77
78
|
if (!this.transcription_model)
|
|
78
79
|
this.transcription_model = Symposium.getModel(model);
|
|
79
|
-
if (!this.transcription_model.type !== 'stt')
|
|
80
|
+
if (!!this.transcription_model || !this.transcription_model.type !== 'stt')
|
|
80
81
|
throw new Error('Specified model is not a transcription model');
|
|
81
82
|
|
|
82
83
|
let file;
|
|
@@ -103,7 +104,7 @@ export default class Symposium {
|
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
|
-
return this.transcription_model.transcribe(file, model, prompt);
|
|
107
|
+
return this.transcription_model.class.transcribe(file, model, prompt);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
static async embed(input, model = null) {
|
|
@@ -111,11 +112,12 @@ export default class Symposium {
|
|
|
111
112
|
if (!model)
|
|
112
113
|
throw new Error('Embedding model not specified');
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (!this.embedding_model)
|
|
116
|
+
this.embedding_model = Symposium.getModel(model);
|
|
117
|
+
if (!this.embedding_model || this.embedding_model.type !== 'embedding')
|
|
116
118
|
throw new Error('Specified model is not an embedding model');
|
|
117
119
|
|
|
118
|
-
return embedding_model.embed(input, model);
|
|
120
|
+
return this.embedding_model.class.embed(input, model);
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
static getExtFromMime(mime) {
|