CollectionChoice
final class CollectionChoice
Methods
__construct(Collection $collection, Closure|string|null $by = null, Closure|array|string|null $describe = null)
Create a new choice between the items of the given collection.
Details
at line 45
__construct(Collection $collection, Closure|string|null $by = null, Closure|array|string|null $describe = null)
Create a new choice between the items of the given collection.
A string-keyed collection of strings without a "by" or "describe" resolver maps option names to descriptions, and its keys are chosen.
at line 73
mixed
decide(string $question, string|array $text, float|null $threshold = null, Provider|Lab|array|string|null $provider = null, string|null $model = null, int|null $timeout = null)
Choose the item that best answers the question about the given text.