1+ import { globalConfig } from './config' ;
2+
13/* eslint-disable @typescript-eslint/naming-convention */
24export interface ListModelCardResponse {
35 id : string ,
@@ -56,9 +58,6 @@ export interface ModelCardResponse {
5658 } [ ]
5759}
5860
59- export const exhortDevDefaultUrl = 'https://exhort.stage.devshift.net' ;
60- export const exhortDefaultUrl = 'https://rhda.rhcloud.com' ;
61-
6261// eslint-disable-next-line @typescript-eslint/no-unused-vars
6362export async function llmAnalysis ( models : string [ ] ) : Promise < ListModelCardResponse [ ] | undefined > {
6463 const reqBody = JSON . stringify ( {
@@ -69,7 +68,7 @@ export async function llmAnalysis(models: string[]): Promise<ListModelCardRespon
6968 } )
7069 } ) ;
7170
72- const resp = await fetch ( `${ selectExhortBackend ( ) } /api/v4/model-cards/` , {
71+ const resp = await fetch ( `${ globalConfig . backendUrl } /api/v4/model-cards/` , {
7372 method : 'POST' ,
7473 body : reqBody ,
7574 } ) ;
@@ -81,16 +80,10 @@ export async function llmAnalysis(models: string[]): Promise<ListModelCardRespon
8180}
8281
8382export async function llmAnalysisDetails ( modelID : string ) : Promise < ModelCardResponse | undefined > {
84- const resp = await fetch ( `${ selectExhortBackend ( ) } /api/v4/model-cards/${ modelID } ` ) ;
83+ const resp = await fetch ( `${ globalConfig . backendUrl } /api/v4/model-cards/${ modelID } ` ) ;
8584 if ( ! resp . ok ) {
8685 return undefined ;
8786 }
8887 return resp . json ( ) as Promise < ModelCardResponse > ;
8988}
9089
91- function selectExhortBackend ( ) {
92- if ( process . env [ 'TRUSTIFY_DA_DEV_MODE' ] === 'true' ) {
93- return exhortDevDefaultUrl ;
94- }
95- return exhortDefaultUrl ;
96- }
0 commit comments