symposium 2.1.4 → 2.1.6
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/Models/OllamaModel.js +17 -12
- package/Symposium.js +1 -1
- package/package.json +1 -1
package/Models/OllamaModel.js
CHANGED
|
@@ -4,20 +4,25 @@ import Message from "../Message.js";
|
|
|
4
4
|
|
|
5
5
|
export default class OllamaModel extends Model {
|
|
6
6
|
async getModels() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
try {
|
|
8
|
+
const {models} = await ollama.list();
|
|
9
|
+
|
|
10
|
+
const map = new Map();
|
|
11
|
+
|
|
12
|
+
for (let m of models) {
|
|
13
|
+
map.set(m.name, {
|
|
14
|
+
name: m.name,
|
|
15
|
+
tokens: null, // TODO
|
|
16
|
+
tools: true,
|
|
17
|
+
structured_output: true,
|
|
18
|
+
})
|
|
19
|
+
}
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
tools: true,
|
|
16
|
-
structured_output: true,
|
|
17
|
-
})
|
|
21
|
+
return map;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
// Ollama daemon not running or not reachable
|
|
24
|
+
return new Map();
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
return map;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
async generate(model, thread, functions = [], options = {}) {
|
package/Symposium.js
CHANGED
|
@@ -39,7 +39,7 @@ export default class Symposium {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
static async loadModel(model_class) {
|
|
42
|
-
const models = await model_class.getModels().entries();
|
|
42
|
+
const models = (await model_class.getModels()).entries();
|
|
43
43
|
for (let [key, model] of models) {
|
|
44
44
|
if (this.models.has(key))
|
|
45
45
|
throw new Error(`Duplicate model with key "${key}"`);
|