Skip to content

Commit b9feb95

Browse files
committed
chore: switch llm analysis endpoint to default exhort url with EXHORT_DEV_MODE flag
1 parent f87eb27 commit b9feb95

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/llmAnalysis.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff 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
6063
export 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

8083
export 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
}

0 commit comments

Comments
 (0)