Lines Matching full:question
163 * Ask a question with a chat history
165 * @param string $question
167 * @return array ['question' => $question, 'answer' => $answer, 'sources' => $sources]
170 public function askChatQuestion($question, $history = [], $sourcePage = '') argument
173 $contextQuestion = $this->rephraseChatQuestion($question, $history);
175 // Only use the rephrased question if it has more history than the chat history provides
177 $question = $contextQuestion;
180 $contextQuestion = $question;
182 return $this->askQuestion($question, $history, $contextQuestion, $sourcePage);
186 * Ask a single standalone question
188 * @param string $question The question to ask
189 * @param array $history [user, ai] of the previous question
190 * @param string $contextQuestion The question to use for context search
191 * @param string $sourcePage The page the question was asked on
192 * @return array ['question' => $question, 'answer' => $answer, 'sources' => $sources]
195 public function askQuestion($question, $history = [], $contextQuestion = '', $sourcePage = '') argument
204 $contextQuestion ?: $question,
210 $contextQuestion ?: $question, $this->getLanguageLimit()
220 $prompt = $this->getPrompt('question', [
222 'question' => $question,
227 'question' => $question,
241 'question' => $question,
249 * Rephrase a question into a standalone question based on the chat history
251 * @param string $question The original user question
253 * @return string The rephrased question
256 public function rephraseChatQuestion($question, $history) argument
259 'question' => $question,
274 * @param string $promptedQuestion The user question embedded in a prompt