AnswersQuestions
trait AnswersQuestions
Methods
string
classificationEndpoint()
Get the path of the endpoint that answers questions.
classify(ClassificationProvider $provider, string $model, string|array $state, array $questions, int $timeout = 30, array $providerOptions = [], array $attachments = [])
Answer the given questions about the state.
string
answeringModel(array $data, string $model)
Get the name of the model that answered the questions.
array
Answer|null
array
withIntegerKeys(array $levels)
Cast the string level keys the provider returns to integers.
Details
at line 29
abstract protected string
classificationEndpoint()
Get the path of the endpoint that answers questions.
at line 39
ClassificationResponse
classify(ClassificationProvider $provider, string $model, string|array $state, array $questions, int $timeout = 30, array $providerOptions = [], array $attachments = [])
Answer the given questions about the state.
at line 81
protected string
answeringModel(array $data, string $model)
Get the name of the model that answered the questions.
at line 89
protected array
mapQuestion(Question $question)
Map a question to the decisions wire format.
at line 114
protected Answer|null
mapAnswer(array $answer, Question|null $question = null)
Map an answer to an answer object, skipping unknown answer types.
at line 132
protected array
withIntegerKeys(array $levels)
Cast the string level keys the provider returns to integers.