Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(TextProcessing): Add two new provider interfaces #41271

Merged
merged 16 commits into from Nov 13, 2023

Conversation

marcelklehr
Copy link
Member

@marcelklehr marcelklehr commented Nov 3, 2023

Summary

Since we added the TextProcessing API in 27.1 some shortcomings have presented themselves, which I seek to improve with this PR.

Additions in this PR:

  • allow providers to obtain current task's userId
  • allow providers to expose average task runtime
  • IManager now also exposes a runOrSchedule() method which takes into account this runtime estimation
  • the schedule OCS API endpoint now uses runOrSchedule to avoid always scheduling a background job which has a max-delay of 5min even if the provider would be done in a few seconds, like the OpenAI provider for example.

Todo

  • Check and possible extend tests

Checklist

- allow providers to obtain current task's userId
- allow providers to expose average task runtime

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
core/Controller/TextProcessingApiController.php Outdated Show resolved Hide resolved
lib/private/TextProcessing/Manager.php Outdated Show resolved Hide resolved
lib/public/TextProcessing/IProvider2.php Outdated Show resolved Hide resolved
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…Providers

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…lready

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr changed the title enh(TextProcessing): Add IProvider2 enh(TextProcessing): Add two new provider provider interfaces Nov 7, 2023
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr changed the title enh(TextProcessing): Add two new provider provider interfaces enh(TextProcessing): Add two new provider provider provider interfaces Nov 8, 2023
@marcelklehr marcelklehr changed the title enh(TextProcessing): Add two new provider provider provider interfaces enh(TextProcessing): Add two new provider interfaces Nov 8, 2023
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small remarks.

lib/private/TextProcessing/Manager.php Outdated Show resolved Hide resolved
lib/private/TextProcessing/Manager.php Outdated Show resolved Hide resolved
lib/public/TextProcessing/IProviderWithUserId.php Outdated Show resolved Hide resolved
marcelklehr and others added 3 commits November 8, 2023 17:00
Co-authored-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@ChristophWurst ChristophWurst added the pending documentation This pull request needs an associated documentation update label Nov 10, 2023
@blizzz blizzz mentioned this pull request Nov 10, 2023
@marcelklehr
Copy link
Member Author

Docs are here: nextcloud/documentation#11273

@nickvergessen nickvergessen merged commit 0feb55e into master Nov 13, 2023
47 of 50 checks passed
@nickvergessen nickvergessen deleted the enh/text-processing-iprovider2 branch November 13, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants