Skip to content

fix: Initialize MistralConversation typed properties with defaults#85

Open
petarbasic wants to merge 1 commit intopartITech:mainfrom
petarbasic:fix/uninitialized-conversation-properties
Open

fix: Initialize MistralConversation typed properties with defaults#85
petarbasic wants to merge 1 commit intopartITech:mainfrom
petarbasic:fix/uninitialized-conversation-properties

Conversation

@petarbasic
Copy link
Contributor

Fixes #84

Several typed properties in MistralConversation lack default values, so creating a fresh instance via the empty constructor and then calling toArray() or any getter throws:

Typed property MistralConversation::$name must not be accessed before initialization

Added defaults matching the values already used in fromArray() (temperature = 0.3, toolChoice = 'auto', everything else null).

Fixes partITech#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MistralConversation: Uninitialized typed properties cause errors on fresh instances

1 participant