fix(settings): Don't show built-in textprocessing task types in textprocessing settings

TaskProcessing is transparent to textprocessing providers and TextProcessing can use Taskprocessing providers so these are unnecessary

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
Marcel Klehr 2024-08-30 09:17:29 +02:00 committed by Julien Veyssier
parent b06302e024
commit a2b087421e
No known key found for this signature in database
GPG key ID: 4141FEE162030638

View file

@ -148,7 +148,15 @@ export default {
return Object.keys(this.settings['ai.textprocessing_provider_preferences']).length > 0 && Array.isArray(this.textProcessingTaskTypes)
},
tpTaskTypes() {
return Object.keys(this.settings['ai.textprocessing_provider_preferences']).filter(type => !!this.getTextProcessingTaskType(type))
const builtinTextProcessingTypes = [
'\\OCP\\TextProcessing\\FreePromptTaskType',
'\\OCP\\TextProcessing\\HeadlineTaskType',
'\\OCP\\TextProcessing\\SummaryTaskType',
'\\OCP\\TextProcessing\\TopicsTaskType',
]
return Object.keys(this.settings['ai.textprocessing_provider_preferences'])
.filter(type => !!this.getTextProcessingTaskType(type))
.filter(type => !builtinTextProcessingTypes.includes(type))
},
hasText2ImageProviders() {
return this.text2imageProviders.length > 0