From 23018494f071dd6ab7f92c83f113da107037ac23 Mon Sep 17 00:00:00 2001 From: Petar Basic Date: Mon, 16 Feb 2026 17:22:05 +0100 Subject: [PATCH] fix: Initialize MistralConversation typed properties with defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #84 — creating a MistralConversation via the empty constructor and then calling toArray() or any getter throws a TypeError because several typed properties have no default values. --- src/Clients/Mistral/MistralConversation.php | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Clients/Mistral/MistralConversation.php b/src/Clients/Mistral/MistralConversation.php index d37e218..31ec64e 100644 --- a/src/Clients/Mistral/MistralConversation.php +++ b/src/Clients/Mistral/MistralConversation.php @@ -17,20 +17,20 @@ class MistralConversation private ?array $completionArgs = []; // Completion arguments broken out - private null|array|string $stop; - private null|float $presencePenalty; - private null|float $frequencyPenalty; - private float $temperature; - private null|float $topP; - private null|int $maxTokens; - private null|int $randomSeed; - private null|array $prediction; - private null|array $responseFormat; - private string $toolChoice; - private ?string $name; - private ?string $description; - private ?string $object; - private ?string $model; + private null|array|string $stop = null; + private null|float $presencePenalty = null; + private null|float $frequencyPenalty = null; + private float $temperature = 0.3; + private null|float $topP = null; + private null|int $maxTokens = null; + private null|int $randomSeed = null; + private null|array $prediction = null; + private null|array $responseFormat = null; + private string $toolChoice = 'auto'; + private ?string $name = null; + private ?string $description = null; + private ?string $object = null; + private ?string $model = null; private string $handoffExecution = 'server'; private DateTimeImmutable $createdAt; private DateTimeImmutable $updatedAt;