Skip to content

Commit

Permalink
always use internal addMessage to ensure blocks of same roles are joined
Browse files Browse the repository at this point in the history
  • Loading branch information
nunodonato committed Jul 19, 2024
1 parent 1050f13 commit 1b4278a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ public function addUserImageMessage(string $url, ?string $text = null): self
$message[] = $textMessage;
}

$this->messages[] = [
'role' => self::ROLE_USER,
'content' => $message,
];
$this->addMessage(self::ROLE_USER, $message);

return $this;
}
Expand All @@ -80,10 +77,7 @@ public function addUserImageMessageFromBase64(string $base64Encoded, string $mim
$message[] = $textMessage;
}

$this->messages[] = [
'role' => self::ROLE_USER,
'content' => $message,
];
$this->addMessage(self::ROLE_USER, $message);

return $this;
}
Expand Down

0 comments on commit 1b4278a

Please sign in to comment.