@@ -33,6 +33,7 @@ import path from 'node:path';
33
33
import type { InferenceServer } from '@shared/models/IInference' ;
34
34
import type { CreationInferenceServerOptions } from '@shared/models/InferenceServerConfig' ;
35
35
import type { InferenceManager } from './managers/inference/inferenceManager' ;
36
+ import type { InferenceProviderRegistry } from './registries/InferenceProviderRegistry' ;
36
37
import type { Conversation } from '@shared/models/IPlaygroundMessage' ;
37
38
import type { PlaygroundV2Manager } from './managers/playgroundV2Manager' ;
38
39
import { getFreeRandomPort } from './utils/ports' ;
@@ -72,6 +73,7 @@ export class StudioApiImpl implements StudioAPI {
72
73
private localRepositories : LocalRepositoryRegistry ,
73
74
private taskRegistry : TaskRegistry ,
74
75
private inferenceManager : InferenceManager ,
76
+ private InferenceProviderRegistry : InferenceProviderRegistry ,
75
77
private playgroundV2 : PlaygroundV2Manager ,
76
78
private snippetManager : SnippetManager ,
77
79
private cancellationTokenRegistry : CancellationTokenRegistry ,
@@ -144,6 +146,10 @@ export class StudioApiImpl implements StudioAPI {
144
146
return this . inferenceManager . getServers ( ) ;
145
147
}
146
148
149
+ async getProviders ( ) : Promise < string [ ] > {
150
+ return this . InferenceProviderRegistry . getAll ( ) . map ( provider => provider . type ) ;
151
+ }
152
+
147
153
async requestDeleteInferenceServer ( ...containerIds : string [ ] ) : Promise < void > {
148
154
// Do not wait on the promise as the api would probably timeout before the user answer.
149
155
if ( containerIds . length === 0 ) throw new Error ( 'At least one container id should be provided.' ) ;
0 commit comments