(timeoutMS int, fallbackEnabled bool)
| 974 | } |
| 975 | |
| 976 | func testConfigTwoBackends(timeoutMS int, fallbackEnabled bool) *config.Config { |
| 977 | return &config.Config{ |
| 978 | Server: config.ServerConfig{ |
| 979 | Host: "127.0.0.1", |
| 980 | Port: 0, |
| 981 | RequestTimeoutMS: 3000, |
| 982 | }, |
| 983 | Telemetry: config.TelemetryConfig{ |
| 984 | MetricsEnabled: true, |
| 985 | TracingEnabled: true, |
| 986 | Exporter: "log", |
| 987 | }, |
| 988 | Backends: []config.BackendConfig{ |
| 989 | { |
| 990 | Name: "small-model", |
| 991 | Type: "mock", |
| 992 | TimeoutMS: timeoutMS, |
| 993 | Cost: config.CostConfig{Unit: 1}, |
| 994 | Capabilities: []string{ |
| 995 | "chat", |
| 996 | "summarization", |
| 997 | }, |
| 998 | }, |
| 999 | { |
| 1000 | Name: "large-model", |
| 1001 | Type: "mock", |
| 1002 | TimeoutMS: timeoutMS, |
| 1003 | Cost: config.CostConfig{Unit: 5}, |
| 1004 | Capabilities: []string{ |
| 1005 | "chat", |
| 1006 | "reasoning", |
| 1007 | "summarization", |
| 1008 | }, |
| 1009 | }, |
| 1010 | }, |
| 1011 | Tenants: []config.TenantConfig{ |
| 1012 | { |
| 1013 | ID: "team-a", |
| 1014 | Class: "premium", |
| 1015 | Priority: "high", |
| 1016 | BudgetPerRequest: 100, |
| 1017 | RateLimitRPS: 100, |
| 1018 | }, |
| 1019 | }, |
| 1020 | Routing: config.RoutingConfig{ |
| 1021 | DefaultBackend: "small-model", |
| 1022 | Rules: []config.RouteRule{ |
| 1023 | { |
| 1024 | Name: "premium-simple-expensive-route", |
| 1025 | When: config.RouteWhen{ |
| 1026 | TenantClass: "premium", |
| 1027 | TaskType: "simple", |
| 1028 | }, |
| 1029 | UseBackend: "large-model", |
| 1030 | }, |
| 1031 | }, |
| 1032 | }, |
| 1033 | Reliability: config.ReliabilityConfig{ |
no outgoing calls
no test coverage detected