symposium 2.2.2 → 2.2.4

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 (3) hide show
  1. package/Agent.js +7 -2
  2. package/README.md +12 -4
  3. package/package.json +1 -1
package/Agent.js CHANGED
@@ -256,7 +256,8 @@ export default class Agent {
256
256
  for (let message of completion) {
257
257
  if (message.role === 'assistant' && message.content.some(c => c.type === 'reasoning')) {
258
258
  const reasoning = message.content.find(c => c.type === 'reasoning').content;
259
- emitter.emit('reasoning', reasoning);
259
+ if (reasoning)
260
+ emitter.emit('reasoning', reasoning);
260
261
  }
261
262
  }
262
263
 
@@ -410,7 +411,11 @@ export default class Agent {
410
411
  return {type: 'response', value: this.afterHandle(thread, completion, JSON.parse(m.content))};
411
412
  }
412
413
 
413
- emitter.emit('output', m.content);
414
+ emitter.emit('output', m);
415
+ break;
416
+
417
+ case 'image':
418
+ emitter.emit('output', m);
414
419
  break;
415
420
 
416
421
  case 'function':
package/README.md CHANGED
@@ -129,15 +129,23 @@ async function main() {
129
129
 
130
130
  const emitter = await agent.message('Hello, who are you?');
131
131
 
132
- emitter.on('output', (content) => {
133
- process.stdout.write(content);
132
+ emitter.on('output', message => {
133
+ switch (message.type) {
134
+ case 'text':
135
+ process.stdout.write(message.content);
136
+ break;
137
+
138
+ case 'image':
139
+ // Process image
140
+ break;
141
+ }
134
142
  });
135
143
 
136
- emitter.on('error', (error) => {
144
+ emitter.on('error', error => {
137
145
  console.error(`\nAn error occurred: ${error.message}`);
138
146
  });
139
147
 
140
- emitter.on('tool', (tool) => {
148
+ emitter.on('tool', tool => {
141
149
  console.log(`\n> Using tool: ${tool.name} with arguments ${JSON.stringify(tool.arguments)}\n`);
142
150
  });
143
151
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "2.2.2",
4
+ "version": "2.2.4",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",