class ChoiceAnswer extends Answer

Methods

array
toArray()

Get the instance as an array.

array
jsonSerialize()

Get the JSON serializable representation of the instance.

from  Answer
__construct(string $choice, array $probabilities, float|null $confidence = null)

Create a new choice answer instance.

float
probabilityOf(string $option)

Get the probability of the given option.

Details

at line 33
array toArray()

Get the instance as an array.

Return Value

array

in Answer at line 20
array jsonSerialize()

Get the JSON serializable representation of the instance.

Return Value

array

at line 15
__construct(string $choice, array $probabilities, float|null $confidence = null)

Create a new choice answer instance.

Parameters

string $choice
array $probabilities
float|null $confidence

null when the provider cannot measure the distribution's certainty

at line 25
float probabilityOf(string $option)

Get the probability of the given option.

Parameters

string $option

Return Value

float