mirror of
https://github.com/nextcloud/server.git
synced 2026-03-22 02:21:12 -04:00
fix: 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>
This commit is contained in:
parent
0379a8d7a9
commit
ba94de2510
3 changed files with 5 additions and 3 deletions
|
|
@ -86,7 +86,9 @@ class ArtificialIntelligence implements IDelegatedSettings {
|
|||
'name' => $provider->getName(),
|
||||
'taskType' => $provider->getTaskType(),
|
||||
];
|
||||
$textProcessingSettings[$provider->getTaskType()] = $provider instanceof IProviderWithId ? $provider->getId() : $provider::class;
|
||||
if (!isset($textProcessingSettings[$provider->getTaskType()])) {
|
||||
$textProcessingSettings[$provider->getTaskType()] = $provider instanceof IProviderWithId ? $provider->getId() : $provider::class;
|
||||
}
|
||||
}
|
||||
$textProcessingTaskTypes = [];
|
||||
foreach ($textProcessingSettings as $taskTypeClass => $providerClass) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class FakeTextProcessingProvider implements IProvider {
|
|||
}
|
||||
|
||||
public function process(string $prompt): string {
|
||||
return strrev($prompt);
|
||||
return strrev($prompt) . ' (done with FakeTextProcessingProvider)';
|
||||
}
|
||||
|
||||
public function getTaskType(): string {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class FakeTextProcessingProviderSync implements IProviderWithExpectedRuntime {
|
|||
}
|
||||
|
||||
public function process(string $prompt): string {
|
||||
return strrev($prompt);
|
||||
return strrev($prompt) . ' (done with FakeTextProcessingProviderSync)';
|
||||
}
|
||||
|
||||
public function getTaskType(): string {
|
||||
|
|
|
|||
Loading…
Reference in a new issue