Skip to content

Commit

Permalink
feat(settings/admin/ai): fix provider list not being declared
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Jul 17, 2024
1 parent b4a320a commit 8e4eb84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ public function getProviders(): array {
public function getPreferredProvider(string $taskType) {
try {
$preferences = json_decode($this->config->getAppValue('core', 'ai.taskprocessing_provider_preferences', 'null'), associative: true, flags: JSON_THROW_ON_ERROR);
$providers = $this->getProviders();
if (isset($preferences[$taskType])) {
$providers = $this->getProviders();
$provider = current(array_values(array_filter($providers, fn ($provider) => $provider->getId() === $preferences[$taskType])));
if ($provider !== false) {
return $provider;
Expand Down

0 comments on commit 8e4eb84

Please sign in to comment.