File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -170,14 +170,14 @@ public function getModels(?string $userId): array {
170170 }
171171 // if userId is null or the user is an admin and has no own creds set, cache the models for the instance
172172 if ($ userId === null || (
173- ($ this ->openAiSettingsService ->getUserApiKey ($ userId ) === ''
174- || (
175- $ this ->openAiSettingsService ->getUseBasicAuth () === '1 '
176- && $ this ->openAiSettingsService ->getUserBasicUser ($ userId ) === ''
177- && $ this ->openAiSettingsService ->getUserBasicPassword ($ userId ) === ''
178- )
173+ ($ this ->openAiSettingsService ->getUserApiKey ($ userId ) === ''
174+ || (
175+ $ this ->openAiSettingsService ->getUseBasicAuth ()
176+ && $ this ->openAiSettingsService ->getUserBasicUser ($ userId ) === ''
177+ && $ this ->openAiSettingsService ->getUserBasicPassword ($ userId ) === ''
179178 )
180- && $ this ->groupManager ->isAdmin ($ userId ))
179+ )
180+ && $ this ->groupManager ->isAdmin ($ userId ))
181181 ) {
182182 $ cache ->set ($ adminCacheKey , $ modelsResponse , Application::MODELS_CACHE_TTL );
183183 }
Original file line number Diff line number Diff line change 2828use OCP \Http \Client \IClientService ;
2929use OCP \IAppConfig ;
3030use OCP \ICacheFactory ;
31+ use OCP \IGroupManager ;
3132use PHPUnit \Framework \MockObject \MockObject ;
3233use Psr \Log \LoggerInterface ;
3334use Test \TestCase ;
@@ -78,6 +79,7 @@ protected function setUp(): void {
7879 \OC ::$ server ->get (ICacheFactory::class),
7980 \OC ::$ server ->get (QuotaUsageMapper::class),
8081 $ this ->openAiSettingsService ,
82+ \OC ::$ server ->get (IGroupManager::class),
8183 $ clientService ,
8284 );
8385
You can’t perform that action at this time.
0 commit comments