Is your feature request related to a problem? Please describe.
Hi team,
It would be great to have an option (like a toggle button or something like that) to only send the last email to the AI for the "Thread summary" feature. The reason is that normally the other emails are already included in the body of the last email, so it's a waste of tokens and time sending/processing the same information a lot of times (once per email in the thread).
Describe the solution you'd like
Add a button in Mail's configuration that enables code like:
Instead of the $messagesBodies in
|
$messagesBodies = array_map(function ($message) use ($client, $account, $currentUserId) { |
Have only the body of the last one:
$lastMessage = $messages[array_key_last($messages)];
$mailbox = $this->mailManager->getMailbox($currentUserId, $lastMessage->getMailboxId());
$imapMessage = $this->mailManager->getImapMessage(
$client,
$account,
$mailbox,
$lastMessage->getUid(), true
);
$messagesBodies = [$imapMessage->getPlainBody()];
Describe alternatives you've considered
No response
Additional context
No response
Is your feature request related to a problem? Please describe.
Hi team,
It would be great to have an option (like a toggle button or something like that) to only send the last email to the AI for the "Thread summary" feature. The reason is that normally the other emails are already included in the body of the last email, so it's a waste of tokens and time sending/processing the same information a lot of times (once per email in the thread).
Describe the solution you'd like
Add a button in Mail's configuration that enables code like:
Instead of the
$messagesBodiesinmail/lib/Service/AiIntegrations/AiIntegrationsService.php
Line 146 in 203ce36
Have only the body of the last one:
Describe alternatives you've considered
No response
Additional context
No response