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.
@@ -4,20 +4,25 @@ import Message from "../Message.js";
4
4
 
5
5
  export default class OllamaModel extends Model {
6
6
  async getModels() {
7
- const {models} = await ollama.list();
8
-
9
- const map = new Map();
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
- for (let m of models) {
12
- map.set(m.name, {
13
- name: m.name,
14
- tokens: null, // TODO
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}"`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "2.1.4",
4
+ "version": "2.1.6",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",