chore: establish learning module baseline
This commit is contained in:
38
OpenMAIC/app/api/server-providers/route.ts
Normal file
38
OpenMAIC/app/api/server-providers/route.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import {
|
||||
getServerProviders,
|
||||
getServerTTSProviders,
|
||||
getServerASRProviders,
|
||||
getServerPDFProviders,
|
||||
getServerImageProviders,
|
||||
getServerVideoProviders,
|
||||
getServerWebSearchProviders,
|
||||
getParallelSceneConcurrency,
|
||||
} from '@/lib/server/provider-config';
|
||||
import { apiError, apiSuccess } from '@/lib/server/api-response';
|
||||
import { createLogger } from '@/lib/logger';
|
||||
|
||||
const log = createLogger('ServerProviders');
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
return apiSuccess({
|
||||
providers: getServerProviders(),
|
||||
tts: getServerTTSProviders(),
|
||||
asr: getServerASRProviders(),
|
||||
pdf: getServerPDFProviders(),
|
||||
image: getServerImageProviders(),
|
||||
video: getServerVideoProviders(),
|
||||
webSearch: getServerWebSearchProviders(),
|
||||
generation: {
|
||||
parallelSceneConcurrency: getParallelSceneConcurrency(),
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
log.error('Error fetching server providers:', error);
|
||||
return apiError(
|
||||
'INTERNAL_ERROR',
|
||||
500,
|
||||
error instanceof Error ? error.message : 'Unknown error',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user