mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix(puterai): adapt message role for claude
This commit is contained in:
parent
3bface8c66
commit
c08b897d4a
@ -41,6 +41,7 @@ class ClaudeService extends BaseService {
|
|||||||
if ( whatis(message.content) !== 'array' ) {
|
if ( whatis(message.content) !== 'array' ) {
|
||||||
message.content = [message.content];
|
message.content = [message.content];
|
||||||
}
|
}
|
||||||
|
if ( ! message.role ) message.role = 'user';
|
||||||
if ( message.role === 'user' && previous_was_user ) {
|
if ( message.role === 'user' && previous_was_user ) {
|
||||||
const last_msg = adapted_messages[adapted_messages.length-1];
|
const last_msg = adapted_messages[adapted_messages.length-1];
|
||||||
last_msg.content.push(
|
last_msg.content.push(
|
||||||
|
Loading…
Reference in New Issue
Block a user