reka.askSends a message to the Reka neural network and returns its response.
Signature: reka.ask(model string, text string, temperature float = 0.7, maxTokens int = 0, timeout int = 0) string
Arguments:
model — model name.text — a request to the neural network.temperature — a number from 0 to 1 that determines the degree of reliability and variability of responses (0 — maximum reliability, 1 — maximum variability).maxTokens — the maximum number of tokens in the neural network response (if greater than zero). If the value is less than or equal to zero, the restriction does not apply.timeout — the time limit for executing the request in seconds (if greater than zero).Return value: The neural network response as a string.
Note: Valid values for the model parameter:
reka-core — Reka Core model.r — Reka Flash model.See the full list on the page.
Example of use:
$answer = reka.ask(“reka-core”, “Is there life on Mars?”, 0.5, 500, 15) // $answer will contain the neural network's answer to the given question.