When creating a new MistralConversation via the empty constructor and then calling toArray() or any getter, PHP throws a "Typed property must not be accessed before initialization" error.
The constructor is empty, but several nullable/typed properties like $name, $description, $model, $stop, $temperature, $toolChoice etc. have no default values. They only get initialized through fromArray(), which means freshly constructed instances break immediately.
Steps to reproduce:
$conversation = new MistralConversation();
$conversation->setAgentId('some-agent-id');
$conversation->toArray(); // TypeError: must not be accessed before initialization
Fix: Add default values to all property declarations, matching the defaults already used in fromArray() (temperature = 0.3, toolChoice = 'auto', everything else null).
When creating a new MistralConversation via the empty constructor and then calling toArray() or any getter, PHP throws a "Typed property must not be accessed before initialization" error.
The constructor is empty, but several nullable/typed properties like $name, $description, $model, $stop, $temperature, $toolChoice etc. have no default values. They only get initialized through fromArray(), which means freshly constructed instances break immediately.
Steps to reproduce:
Fix: Add default values to all property declarations, matching the defaults already used in fromArray() (temperature = 0.3, toolChoice = 'auto', everything else null).