AI email summary includes prompt
Steps to reproduce
Let the mail app generate some mail summary.
Expected behavior
There should only be the actual summary be shown
Actual behavior
The AI Summary includes information from the Prompt and/or "-signs:
main - INFO - {'output': 'Here is a helpful summary of the email message in under 160 characters:\n\n"Reminder: Review and update something by end of week."'}
Mail app version
5.1.3
Nextcloud version
31.0.6
Mailserver or service
No response
Operating system
No response
PHP engine version
None
Nextcloud memory caching
No response
Web server
None
Database
None
Additional info
No response
I added Output *ONLY* the Summary itself, leave out any introduction. to the Prompt here https://github.com/nextcloud/mail/blob/ee21dccc3d517eb5e9a2c8fd6fb8fd588ac73382/lib/Service/AiIntegrations/AiIntegrationsService.php#L100 (and asked to summarize in a specific language) which seems to successfully solve this issue.
Would be nice if these Prompts were accessible on in the AI admin settings
Is there a way to reset already existing summaries and force the mail app to re-summerize all mails?
Thanks for your bug report 👍
Sounds reasonable to update the prompt like that. Could you send a pr?
Is there a way to reset already existing summaries
Only by clearing the cache.
Would be nice if these Prompts were accessible on in the AI admin settings
Logged a feature request for it https://github.com/nextcloud/mail/issues/11285.
Is there a way to reset already existing summaries and force the mail app to re-summerize all mails?
@1358 Yes, you can clear the memory cache. In case you want to only clear the keys corresponding to the mail summaries you can only delete the ones containing the string mail.ai.
Redis example: redis-cli keys '*mail.ai*' | xargs -d '\n' redis-cli del
Sounds reasonable to update the prompt like that. Could you send a pr?
Sure :)
Is there a way to reset already existing summaries
Only by clearing the cache.
Redis
example: redis-cli keys '*mail.ai*' | xargs -d '\n' redis-cli del
Hm, this seems to only affect the quick-replies and the thread-summary, not the message summary shown in the message list below the subject. Digging into the db update public.oc_mail_messages set summary = null where summary is not null; removes the summaries from the message list but they are not re-generated afterwards. Is there anything else needed to reset this?
Looking at https://github.com/nextcloud/mail/pull/10465, it appears that the AI summaries are only triggered when a message is detected for the first time. It may work to move the message to a different folder. Otherwise, remove the account and add again.