Feat/configurable summary system prompts - #425
Conversation
| $this->l->t('The model used to generate the completion'), | ||
| EShapeType::Enum | ||
| ), | ||
| 'talk_meeting' => new ShapeDescriptor( |
There was a problem hiding this comment.
talk_meeting suggests sth related to meeting content, it should be is_talk_meeting or is_from_talk_meeting for boolean
There was a problem hiding this comment.
We could even make it more general with sth like: 'source': '<enum>'
| ), | ||
| 'talk_meeting' => new ShapeDescriptor( | ||
| $this->l->t("Talk meeting flag"), | ||
| $this->l->t('Flag that indicates if the summary is generated from a Talk meeting recording.'), |
There was a problem hiding this comment.
Flag indicating whether ... sounds more natural and concise
Assisted-by: ChatGPT:GPT-5.6 Luna Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
Assisted-by: ChatGPT:GPT-5.6 Luna Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
Assisted-by: ChatGPT:GPT-5.6 Luna Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
Assisted-by: ChatGPT:GPT-5.6 Luna Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
58ff049 to
b483820
Compare
|
Hi @astkwcz, Sorry I missed this pr somehow. I don't think this is the right way of implementing this for talk as all of these would need to be done for the other providers such as llm2. This is also more of a hack anyway and should be handled in talk and not the providers for summary. IMO the better option for completely custom summary instructions specific to talk is to use the text2text task type in talk instead and pass the custom instructions and transcript there. The talk_meeting flag would also look really weird in the assistant's UI and could confuse users. |
I understand, just to confirm - in this case we are losing chunking mechanism for Talk summary and the whole transcript should fit in
I was not aware that it also appears in UI. I am looking at it right now in Assistant's UI and you are right, it confuses me. Following custom instructions for Nextcloud Assistant:
I think option number 1 is better. I would be happy to implement configurable system prompts for Summarize, Translate and other Tasks. |
|
Hi @astkwcz, I had an internal talk with my team and we decided the best approach would be implementing this in talk with a text2text task type. If you need help contacting someone from the talk team for that pr I can get you in contact with someone. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
Hi @lukasdotcom Thanks for insights, I just created PR to spreed repo: nextcloud/spreed#19111 I used I would really appreciate if you could get me in contact with someone from Talk team regarding this PR. |
Configurable system prompts for summary tasks
This PR adds a functionality for Summary Provider to define custom system prompt and distinguish them based on two cases:
Those summaries have different context, so different model's instructions are needed
How to provide system prompts?
I created two additional functions to read a value from from config keys. In this case:
system_prompt_summaryandsystem_prompt_talk_summary. To set those values you have to useocccommand:and
If the value of the configurable system prompt is empty string
""or there is no keysystem_prompt_summary/system_prompt_talk_summary, a system prompt for summary will have default value.Default value is a value of the
summarySystemPromptbefore my changes:You are a helpful assistant that summarizes text in the same language as the text. You should only return the summary without any additional information.Distinguish if a summary is for a Talk meeting
The idea is to pass a flag
'talk_meeting'that equals to 1 in an array passed in Task object. Default value in this PR sets it to 0:'talk_meeting' => 0. I am going to make a PR to nextcloud spreed repo as well.Naming convention
Names of the keys that are used to set prompts are similar to naming convention in Summary Provider that was ealier introduced-
summarySystemPrompt. I start with a prefixsystem_promptbecause I think it is good idea to provide configurable system prompts for other tasks as well, for example translation. It will be easier to read config:app if system_prompts will be written one above/belowe another (keys are sorted).Tests
testSummaryProvider- tests default functionality (no system prompt set usingocc) of the changes. It ensures that the default summary system prompt is the same as it was before my changestestSummaryProviderConfigurableSystemPrompt- tests if configurable system prompt works. I set keysystem_prompt_summaryvalue and delete it even if the test failstestSummaryProviderConfigurableTalkSystemPrompt- the same as the above + I pass'talk_meeting'flag in the requestQuestion for devs
I am currently running nc34 and
integration_openaiversion4.5.2. Where should I also make PR to have configurable system prompts in my case?Additional PR (spreed)
After review/changes I will make PR to spreed repo to enable passing a flag
'talk_meeting'.Thoughts
I am aware of additional instructions for LLM that are set by assigning a value to
formatandcomplexity. It affects model output but it is still pretty much hard-coded. The main issue is that there is no possibility to have specific instruction for a specific context of summary task. In this case - call meeting on Talk (summary from a transcript). Sample output format:Configurable system prompt will provide a possibility to customize the output freely.
I am also aware that devs have a vision for Summary Provider and its output by using specific instructions for:
format- auto, sentence, paragraph, bullet_pointscomplexity- simple, medium, complexThe output format is controlled in some way. Changes in this PR give full control to the admin of nextcloud instance.
I see the potential conflict between changes that I introduced in this PR and existing intended way to influence the output in specific, controlled way (
format,complexity). I am open to changing and adjusting the implementation and hope we could work something out.