Skip to content

Commit

Permalink
fixup! Enh: Improve smart replies prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <[email protected]>
  • Loading branch information
hamza221 committed Jun 11, 2024
1 parent 962c2cd commit 95cd679
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Service/AiIntegrations/AiIntegrationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function getSmartReply(Account $account, Mailbox $mailbox, Message $messa
throw new ServiceException('Text processing is not available in your current Nextcloud version', 0, $e);
}
if (in_array(FreePromptTaskType::class, $manager->getAvailableTaskTypes(), true)) {
$cachedReplies = $this->cache->getValue('smartReplies_'.$message->getUid());
$cachedReplies = $this->cache->getValue('smartReplies_'.$message->getId());
if ($cachedReplies) {
return json_decode($cachedReplies, true);
}
Expand Down Expand Up @@ -216,7 +216,7 @@ public function getSmartReply(Account $account, Mailbox $mailbox, Message $messa
$task = new Task(FreePromptTaskType::class, $prompt, 'mail,', $currentUserId);
$manager->runTask($task);
$replies = $task->getOutput();
$this->cache->addValue('smartReplies_'.$message->getUid(), $replies);
$this->cache->addValue('smartReplies_'.$message->getId(), $replies);
return json_decode($replies, true);

} else {
Expand Down

0 comments on commit 95cd679

Please sign in to comment.