Lines Matching refs:history
166 * @param array[] $history The chat history [[user, ai], [user, ai], ...]
170 public function askChatQuestion($question, $history = [], $sourcePage = '') argument
172 if ($history && $this->getConf('rephraseHistory') > 0) {
173 $contextQuestion = $this->rephraseChatQuestion($question, $history);
182 return $this->askQuestion($question, $history, $contextQuestion, $sourcePage);
189 * @param array $history [user, ai] of the previous question
195 public function askQuestion($question, $history = [], $contextQuestion = '', $sourcePage = '') argument
229 $history = [];
235 $history,
252 * @param array[] $history The chat history [[user, ai], [user, ai], ...]
256 public function rephraseChatQuestion($question, $history) argument
264 $history,
275 * @param array[] $history The chat history [[user, ai], [user, ai], ...]
282 array $history, argument
292 $messages = $this->historyMessages($history, $remainingContext, $historySize);
305 * @param array[] $history The chat history [[user, ai], [user, ai], ...]
310 protected function historyMessages(array $history, int $tokenLimit, int $sizeLimit): array argument
315 $history = array_reverse($history);
316 $history = array_slice($history, 0, $sizeLimit);
317 foreach ($history as $row) {