symposium 0.5.0 → 0.5.1

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.
@@ -59,8 +59,15 @@ export default class OpenAIModel extends Model {
59
59
  const message_content = [];
60
60
  if (completion.content)
61
61
  message_content.push({type: 'text', content: completion.content});
62
- if (completion.function_call && completion.function_call.arguments)
63
- message_content.push({type: 'function', content: completion.function_call});
62
+ if (completion.function_call) {
63
+ message_content.push({
64
+ type: 'function',
65
+ content: {
66
+ name: completion.function_call.name,
67
+ arguments: completion.function_call.arguments ? JSON.parse(completion.function_call.arguments) : {},
68
+ },
69
+ });
70
+ }
64
71
 
65
72
  return [
66
73
  new Message('assistant', message_content),
@@ -83,14 +90,16 @@ export default class OpenAIModel extends Model {
83
90
  if (this.supports_functions) {
84
91
  messages.push({
85
92
  role: message.role,
86
- content: null,
87
93
  name: message.name,
88
- function_call: c.content,
94
+ function_call: {
95
+ name: c.content.name,
96
+ arguments: c.content.arguments ? JSON.stringify(c.content.arguments) : '{}',
97
+ },
89
98
  });
90
99
  } else {
91
100
  messages.push({
92
101
  role: message.role,
93
- content: c.content,
102
+ content: '```CALL \n' + c.content.name + '\n' + JSON.stringify(c.content.arguments || {}) + '\n```',
94
103
  name: message.name,
95
104
  });
96
105
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "symposium",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "description": "Agents",
6
6
  "main": "index.js",
7
7
  "author": "Domenico Giambra",