server
server copied to clipboard
Introduce LanguageModel OCP API
- Resolves: #38578
- Closes: #38059
Summary
This adds a LanguageModel namespace with an ILanguageModelManager that queries registered ILanguageModelProviders to either synchronously run or asynchronously schedule ILanguageModelTasks. When scheduled asynchronously, the tasks will be run in a background job and either a TaskFailedEvent or a TaskSuccessfulEvent is emitted with error message or the output, respectively. Currently implemented are two task types: SummarizeTask and FreePromptTask.
TODO
- [ ] Ethical AI rating should be accessible somehow, preferably via info.xml
- [ ] Setting default provider per task type
- [x] ocs API with a polling endpoint to query the result
- [x] db needs an output column and ILanguageModelTask probably also needs getters and setters for that
- [x] make linters happy
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [ ] Tests (unit, integration, api and/or acceptance) are included
- [x] Screenshots before/after for front-end changes
- [ ] Documentation (manuals or wiki) has been updated or is not required
- [x] Backports requested where applicable (ex: critical bugfixes)