symposium 0.1.6 → 0.1.8

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.
Files changed (2) hide show
  1. package/Agent.js +16 -2
  2. package/package.json +2 -5
package/Agent.js CHANGED
@@ -105,7 +105,7 @@ class Agent {
105
105
 
106
106
  async getDefaultState() {
107
107
  return {
108
- model: 'gpt-3.5-turbo-16k',
108
+ model: 'gpt-4-1106-preview',
109
109
  };
110
110
  }
111
111
 
@@ -204,7 +204,13 @@ class Agent {
204
204
  }
205
205
  }
206
206
 
207
- const completion = await this.generateCompletion(conversation);
207
+ const completion_payload = {};
208
+ if (this.options.talking_function) {
209
+ completion_payload.functions = [this.options.talking_function];
210
+ completion_payload.function_call = {name: this.options.talking_function.name};
211
+ }
212
+
213
+ const completion = await this.generateCompletion(conversation, completion_payload);
208
214
 
209
215
  await this.handleCompletion(conversation, completion);
210
216
 
@@ -266,6 +272,14 @@ class Agent {
266
272
  }
267
273
 
268
274
  async handleCompletion(conversation, completion) {
275
+ if (this.options.talking_function && completion.function_call) {
276
+ const text = completion.function_call.arguments[Object.keys(this.options.talking_function.parameters.properties)[0]];
277
+ conversation.addAssistantMessage(text);
278
+ await this.log('ai_message', text);
279
+ await conversation.reply(text);
280
+ return conversation.storeState()
281
+ }
282
+
269
283
  conversation.addAssistantMessage(completion.content, completion.function_call ? {
270
284
  ...completion.function_call,
271
285
  arguments: JSON.stringify(completion.function_call.arguments),
package/package.json CHANGED
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.1.6",
4
+ "version": "0.1.8",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
9
- },
10
7
  "author": "Domenico Giambra",
11
8
  "license": "ISC",
12
9
  "dependencies": {
13
- "@travio/redis": "^1.3.2",
10
+ "@travio/redis": "^2.0.0",
14
11
  "openai": "^4.12.1",
15
12
  "tiktoken": "^1.0.10"
16
13
  }