symposium 0.1.11 → 0.2.0
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/Agent.js +4 -6
- package/Conversation.js +1 -3
- package/Logger.js +1 -3
- package/MemoryHandler.js +1 -3
- package/Message.js +1 -3
- package/Middleware.js +1 -3
- package/Model.js +1 -3
- package/Summarizer.js +4 -6
- package/Symposium.js +2 -3
- package/Tool.js +1 -3
- package/package.json +1 -1
package/Agent.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Symposium from "./Symposium.js";
|
|
2
2
|
import Conversation from "./Conversation.js";
|
|
3
3
|
|
|
4
|
-
class Agent {
|
|
4
|
+
export default class Agent {
|
|
5
5
|
name = 'Agent';
|
|
6
6
|
descriptionForFront = '';
|
|
7
7
|
options = {};
|
|
@@ -10,6 +10,7 @@ class Agent {
|
|
|
10
10
|
middlewares = new Map();
|
|
11
11
|
tools = new Map();
|
|
12
12
|
commands;
|
|
13
|
+
default_model = 'gpt-4-turbo';
|
|
13
14
|
|
|
14
15
|
constructor(options) {
|
|
15
16
|
this.options = {
|
|
@@ -101,12 +102,11 @@ class Agent {
|
|
|
101
102
|
|
|
102
103
|
async resetState(conversation) {
|
|
103
104
|
conversation.state = await this.getDefaultState();
|
|
105
|
+
conversation.state.model = Symposium.getModelByLabel(this.default_model);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
async getDefaultState() {
|
|
107
|
-
return {
|
|
108
|
-
model: 'gpt-4-turbo-preview',
|
|
109
|
-
};
|
|
109
|
+
return {};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
addTool(tool) {
|
|
@@ -346,5 +346,3 @@ class Agent {
|
|
|
346
346
|
return [this.name];
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
|
|
350
|
-
export default Agent;
|
package/Conversation.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Message from "./Message.js";
|
|
2
2
|
import Redis from "@travio/redis";
|
|
3
3
|
|
|
4
|
-
class Conversation {
|
|
4
|
+
export default class Conversation {
|
|
5
5
|
id;
|
|
6
6
|
reply;
|
|
7
7
|
messages = [];
|
|
@@ -83,5 +83,3 @@ class Conversation {
|
|
|
83
83
|
this.messages = this.messages.filter(m => !m.tags.includes(tag));
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
export default Conversation;
|
package/Logger.js
CHANGED
package/MemoryHandler.js
CHANGED
package/Message.js
CHANGED
package/Middleware.js
CHANGED
package/Model.js
CHANGED
package/Summarizer.js
CHANGED
|
@@ -2,11 +2,11 @@ import Symposium from "./Symposium.js";
|
|
|
2
2
|
import MemoryHandler from "./MemoryHandler.js";
|
|
3
3
|
import {encoding_for_model} from "tiktoken";
|
|
4
4
|
|
|
5
|
-
class Summarizer extends MemoryHandler {
|
|
6
|
-
constructor(threshold = 0.7, summary_length = 0.
|
|
5
|
+
export default class Summarizer extends MemoryHandler {
|
|
6
|
+
constructor(threshold = 0.7, summary_length = 0.5) {
|
|
7
7
|
super();
|
|
8
|
-
this.threshold =
|
|
9
|
-
this.summary_length =
|
|
8
|
+
this.threshold = threshold;
|
|
9
|
+
this.summary_length = summary_length;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
async handle(conversation) {
|
|
@@ -92,5 +92,3 @@ class Summarizer extends MemoryHandler {
|
|
|
92
92
|
return summarizedConversation;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
export default Summarizer;
|
package/Symposium.js
CHANGED
|
@@ -2,7 +2,7 @@ import Redis from "@travio/redis";
|
|
|
2
2
|
import OpenAI from "openai";
|
|
3
3
|
import Model from "./Model.js";
|
|
4
4
|
|
|
5
|
-
class Symposium {
|
|
5
|
+
export default class Symposium {
|
|
6
6
|
static openai;
|
|
7
7
|
static models = [];
|
|
8
8
|
|
|
@@ -10,6 +10,7 @@ class Symposium {
|
|
|
10
10
|
this.loadModel(new Model('gpt-3.5-turbo-0125', 'gpt-3.5', 16384));
|
|
11
11
|
this.loadModel(new Model('gpt-4', 'gpt-4', 8192));
|
|
12
12
|
this.loadModel(new Model('gpt-4-turbo-preview', 'gpt-4-turbo', 128000, 'gpt-4'));
|
|
13
|
+
this.loadModel(new Model('gpt-4-vision-preview', 'gpt-4-vision', 128000, 'gpt-4'));
|
|
13
14
|
|
|
14
15
|
return Redis.init();
|
|
15
16
|
}
|
|
@@ -44,5 +45,3 @@ class Symposium {
|
|
|
44
45
|
return response.text;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
export default Symposium;
|
package/Tool.js
CHANGED