symposium 2.1.9 → 2.1.10

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 CHANGED
@@ -22,6 +22,7 @@ export default class Agent {
22
22
  type = 'chat'; // chat, utility
23
23
  utility = null;
24
24
  initialized = false;
25
+ enable_image_generation = false;
25
26
 
26
27
  constructor(options) {
27
28
  this.options = {
@@ -341,7 +342,10 @@ export default class Agent {
341
342
  async generateCompletion(thread, options = {}, retry_counter = 1) {
342
343
  try {
343
344
  const model = Symposium.getModel(thread.state.model);
344
- const messages = await model.class.generate(model, thread, await this.getFunctions(), options);
345
+ const messages = await model.class.generate(model, thread, await this.getFunctions(), {
346
+ ...options,
347
+ image_generation: this.enable_image_generation,
348
+ });
345
349
  return model.tools ? messages : messages.map(m => this.parseFunctions(m));
346
350
  } catch (error) {
347
351
  if (error.response) {
@@ -71,13 +71,18 @@ export default class OpenAIModel extends Model {
71
71
  for (let m of messages)
72
72
  convertedMessages.push(...this.convertMessage(m, model));
73
73
 
74
+ const tools = functions.map(f => ({
75
+ type: 'function',
76
+ function: f,
77
+ }));
78
+
79
+ if (model.tools && model.image_generation && options.image_generation)
80
+ tools.push({type: 'image_generation'});
81
+
74
82
  const completion_payload = {
75
83
  model: model.name,
76
84
  messages: convertedMessages,
77
- tools: functions.map(f => ({
78
- type: 'function',
79
- function: f,
80
- })),
85
+ tools,
81
86
  };
82
87
 
83
88
  if (options.force_function) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "2.1.9",
4
+ "version": "2.1.10",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",