Skip to content

Commit 24b5925

Browse files
committed
when no AI setting has been set, make sure the selected text processing provider is the same as the one that will be used
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent 799c6de commit 24b5925

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

apps/settings/lib/Settings/Admin/ArtificialIntelligence.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public function getForm() {
8686
'name' => $provider->getName(),
8787
'taskType' => $provider->getTaskType(),
8888
];
89-
$textProcessingSettings[$provider->getTaskType()] = $provider instanceof IProviderWithId ? $provider->getId() : $provider::class;
89+
if (!isset($textProcessingSettings[$provider->getTaskType()])) {
90+
$textProcessingSettings[$provider->getTaskType()] = $provider instanceof IProviderWithId ? $provider->getId() : $provider::class;
91+
}
9092
}
9193
$textProcessingTaskTypes = [];
9294
foreach ($textProcessingSettings as $taskTypeClass => $providerClass) {

apps/testing/lib/Provider/FakeTextProcessingProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function getName(): string {
3434
}
3535

3636
public function process(string $prompt): string {
37-
return strrev($prompt);
37+
return strrev($prompt) . ' (done with FakeTextProcessingProvider)';
3838
}
3939

4040
public function getTaskType(): string {

apps/testing/lib/Provider/FakeTextProcessingProviderSync.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getName(): string {
3636
}
3737

3838
public function process(string $prompt): string {
39-
return strrev($prompt);
39+
return strrev($prompt) . ' (done with FakeTextProcessingProviderSync)';
4040
}
4141

4242
public function getTaskType(): string {

0 commit comments

Comments
 (0)