Skip to content

Commit

Permalink
fix: Fix a bug in saving the fallback model of an AI Route (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO authored Jan 24, 2025
1 parent 0e57d52 commit f038c5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions frontend/src/interfaces/llm-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ export interface LlmProvider {
name: string;
type: string;
protocol?: string;
modelMapping: ModelMapping;
tokens: string[];
tokenFailoverConfig?: TokeFailoverConfig;
}

export interface ModelMapping {
[propName: string]: string;
}

export interface TokeFailoverConfig {
enabled?: boolean;
failureThreshold?: number;
Expand All @@ -21,11 +16,6 @@ export interface TokeFailoverConfig {
healthCheckModel?: string;
}

export enum LlmProviderType {
OPENAI = 'openai',
QWEN = 'qwen',
}

export enum LlmProviderProtocol {
OPENAI_V1 = 'openai/v1',
}
2 changes: 1 addition & 1 deletion frontend/src/pages/ai/components/RouteForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const AiRouteForm: React.FC = forwardRef((props: { value: any }, ref) => {
provider: fallbackConfig_upstreams,
modelMapping: {},
};
_upstreams["modelMapping"][fallbackConfig_modelNames] = fallbackConfig_upstreams;
_upstreams["modelMapping"]["*"] = fallbackConfig_modelNames;
payload['fallbackConfig']['upstreams'] = [_upstreams];
payload['fallbackConfig']['strategy'] = "SEQ";
}
Expand Down

0 comments on commit f038c5e

Please sign in to comment.