We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fefab6e commit c213c49Copy full SHA for c213c49
src/Results/DTO/Candidate.php
@@ -44,6 +44,12 @@ class Candidate implements WithJsonSchemaInterface
44
*/
45
public function __construct(Message $message, FinishReasonEnum $finishReason, int $tokenCount)
46
{
47
+ if (!$message->getRole()->isModel()) {
48
+ throw new \InvalidArgumentException(
49
+ 'Message must be a model message.'
50
+ );
51
+ }
52
+
53
$this->message = $message;
54
$this->finishReason = $finishReason;
55
$this->tokenCount = $tokenCount;
0 commit comments