symposium 0.6.4 → 0.6.6
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 +18 -0
- 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
|
@@ -112,6 +112,24 @@ export default class AnthropicModel extends Model {
|
|
|
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
|
+
source: {
|
|
121
|
+
type: 'base64',
|
|
122
|
+
media_type: c.content.mime,
|
|
123
|
+
data: c.content.data,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// TODO: url
|
|
128
|
+
|
|
129
|
+
default:
|
|
130
|
+
throw new Error('Image source not supported');
|
|
131
|
+
}
|
|
132
|
+
|
|
115
133
|
default:
|
|
116
134
|
throw new Error('Message type "' + c.type + '" unsupported by this model');
|
|
117
135
|
}
|