symposium 0.14.14 → 0.14.16

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 CHANGED
@@ -29,7 +29,7 @@ export default class Symposium {
29
29
  * - async get(key)
30
30
  * - async set(key, value)
31
31
  */
32
- static async init(storage) {
32
+ static async init(storage = null) {
33
33
  this.loadModel(new Gpt35());
34
34
  this.loadModel(new Gpt4());
35
35
  this.loadModel(new Gpt4Turbo());
@@ -52,8 +52,10 @@ export default class Symposium {
52
52
 
53
53
  this.loadModel(new Grok4());
54
54
 
55
- this.storage = storage;
56
- await this.storage.init();
55
+ if (storage) {
56
+ this.storage = storage;
57
+ await this.storage.init();
58
+ }
57
59
  }
58
60
 
59
61
  static loadModel(model) {
package/Thread.js CHANGED
@@ -38,7 +38,7 @@ export default class Thread {
38
38
  await this.flush();
39
39
  this.state = {};
40
40
 
41
- const conv = await Symposium.storage.get('thread-' + this.unique);
41
+ const conv = Symposium.storage ? (await Symposium.storage.get('thread-' + this.unique)) : null;
42
42
  if (conv) {
43
43
  this.state = conv.state || {};
44
44
  this.messages = conv.messages.map(m => new Message(m.role, m.content, m.name, m.tags));
@@ -55,10 +55,12 @@ export default class Thread {
55
55
  }
56
56
 
57
57
  async storeState() {
58
- await Symposium.storage.set('thread-' + this.unique, {
59
- state: this.state,
60
- messages: this.messages,
61
- });
58
+ if (Symposium.storage) {
59
+ await Symposium.storage.set('thread-' + this.unique, {
60
+ state: this.state,
61
+ messages: this.messages,
62
+ });
63
+ }
62
64
  }
63
65
 
64
66
  addDirectMessage(message) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.14.14",
4
+ "version": "0.14.16",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",