symposium 0.6.3 → 0.6.5
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 -4
- package/models/AnthropicModel.js +16 -1
- package/package.json +1 -1
package/Agent.js
CHANGED
|
@@ -87,11 +87,11 @@ export default class Agent {
|
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
async message(thread,
|
|
91
|
-
await this.log('user_message',
|
|
92
|
-
thread.addMessage('user',
|
|
90
|
+
async message(thread, content) {
|
|
91
|
+
await this.log('user_message', content);
|
|
92
|
+
thread.addMessage('user', content);
|
|
93
93
|
|
|
94
|
-
await this.execute(thread
|
|
94
|
+
await this.execute(thread);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
async execute(thread) {
|
package/models/AnthropicModel.js
CHANGED
|
@@ -108,10 +108,25 @@ export default class AnthropicModel extends Model {
|
|
|
108
108
|
case 'function_response':
|
|
109
109
|
return {
|
|
110
110
|
type: 'tool_result',
|
|
111
|
-
content: c.content.response,
|
|
111
|
+
content: JSON.stringify(c.content.response),
|
|
112
112
|
tool_use_id: c.content.id,
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
case 'image':
|
|
116
|
+
switch (c.content.type) {
|
|
117
|
+
case 'base64':
|
|
118
|
+
return {
|
|
119
|
+
type: 'image',
|
|
120
|
+
media_type: c.content.mime,
|
|
121
|
+
data: c.content.data,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// TODO: url
|
|
125
|
+
|
|
126
|
+
default:
|
|
127
|
+
throw new Error('Image source not supported');
|
|
128
|
+
}
|
|
129
|
+
|
|
115
130
|
default:
|
|
116
131
|
throw new Error('Message type "' + c.type + '" unsupported by this model');
|
|
117
132
|
}
|