Skip to content

Commit

Permalink
fix: message coercion bug affecting vision
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Feb 27, 2025
1 parent 18170f7 commit ec0a721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/src/modules/puterai/lib/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = class Messages {
if ( whatis(message.content[i]) !== 'object' ) {
throw new Error('each message content item must be a string or object');
}
if ( ! message.content[i].type ) {
if ( typeof message.content[i].text === 'string' && ! message.content[i].type ) {
message.content[i].type = 'text';
}
}
Expand Down

0 comments on commit ec0a721

Please sign in to comment.