Fix/max tokens hardcoded#364
Conversation
Signed-off-by: Nicolas Varlot nicolas.varlot@ac-versailles.fr Signed-off-by: Nicolas Varlot <165952530+n-iv@users.noreply.github.com>
Signed-off-by: Nicolas Varlot <165952530+n-iv@users.noreply.github.com>
Signed-off-by: Nicolas Varlot <165952530+n-iv@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes hardcoded max_tokens => 1000 defaults in the task-processing providers and instead uses the configured value from OpenAiSettingsService, preventing truncated generations when admins have configured higher token limits.
Changes:
- Replaced hardcoded
max_tokensdefaults with$this->openAiSettingsService->getMaxTokens()in task optional input defaults. - Applies the same configuration-driven behavior consistently across headline, topics, and general text-to-text providers.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/TaskProcessing/TopicsProvider.php | Use configured max token limit for default optional input shape. |
| lib/TaskProcessing/TextToTextProvider.php | Use configured max token limit for default optional input shape. |
| lib/TaskProcessing/HeadlineProvider.php | Use configured max token limit for default optional input shape. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Lukas Schaefer <lukas@lschaefer.xyz> Signed-off-by: Nicolas Varlot <nicolas.varlot@ac-versailles.fr>
|
Thank you for your contribution @n-iv |
|
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.) |
We noticed some occurrences of 'max_tokens' => 1000 in the Nextcloud codebase, specifically in:
This prevents requests from being executed in full, and leads to half-generated documents or truncated answers, which ruins the user experience.
We replaced those faulty lines with:
'max_tokens' => $this->openAiSettingsService->getMaxTokens()