(_config: ModelConfig & { options?: TestConfigOptions })
| 17 | } |
| 18 | |
| 19 | function testConfig(_config: ModelConfig & { options?: TestConfigOptions }) { |
| 20 | const { options, ...config } = _config; |
| 21 | const model = config.model; |
| 22 | const api = getLlmApi({ |
| 23 | provider: config.provider as any, |
| 24 | apiKey: config.apiKey, |
| 25 | apiBase: config.apiBase, |
| 26 | env: config.env, |
| 27 | }); |
| 28 | |
| 29 | if ( |
| 30 | ["chat", "summarize", "edit", "apply"].some((role) => |
| 31 | config.roles?.includes(role as any), |
| 32 | ) |
| 33 | ) { |
| 34 | testChat(api, model, options); |
| 35 | } |
| 36 | |
| 37 | if (config.roles?.includes("embed")) { |
| 38 | testEmbed(api, model); |
| 39 | } |
| 40 | |
| 41 | if (config.roles?.includes("rerank")) { |
| 42 | testRerank(api, model); |
| 43 | } |
| 44 | |
| 45 | if (config.roles?.includes("autocomplete")) { |
| 46 | testFim(api, model); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | const TESTS: Omit<ModelConfig & { options?: TestConfigOptions }, "name">[] = [ |
| 51 | { |
no test coverage detected