File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ export interface ModelCardResponse {
5656 } [ ]
5757}
5858
59+ export const exhortDevDefaultUrl = 'https://exhort.stage.devshift.net' ;
60+ export const exhortDefaultUrl = 'https://rhda.rhcloud.com' ;
61+
5962// eslint-disable-next-line @typescript-eslint/no-unused-vars
6063export async function llmAnalysis ( models : string [ ] ) : Promise < ListModelCardResponse [ ] | undefined > {
6164 const reqBody = JSON . stringify ( {
@@ -66,7 +69,7 @@ export async function llmAnalysis(models: string[]): Promise<ListModelCardRespon
6669 } )
6770 } ) ;
6871
69- const resp = await fetch ( `https://exhort.stage.devshift.net /api/v4/model-cards/` , {
72+ const resp = await fetch ( `${ selectExhortBackend ( ) } /api/v4/model-cards/` , {
7073 method : 'POST' ,
7174 body : reqBody ,
7275 } ) ;
@@ -78,9 +81,16 @@ export async function llmAnalysis(models: string[]): Promise<ListModelCardRespon
7881}
7982
8083export async function llmAnalysisDetails ( modelID : string ) : Promise < ModelCardResponse | undefined > {
81- const resp = await fetch ( `https://exhort.stage.devshift.net /api/v4/model-cards/${ modelID } ` ) ;
84+ const resp = await fetch ( `${ selectExhortBackend ( ) } /api/v4/model-cards/${ modelID } ` ) ;
8285 if ( ! resp . ok ) {
8386 return undefined ;
8487 }
8588 return resp . json ( ) as Promise < ModelCardResponse > ;
89+ }
90+
91+ function selectExhortBackend ( ) {
92+ if ( process . env [ 'EXHORT_DEV_MODE' ] === 'true' ) {
93+ return exhortDevDefaultUrl ;
94+ }
95+ return exhortDefaultUrl ;
8696}
You can’t perform that action at this time.
0 commit comments