* Validate model configuration * @param config - Model configuration to validate * @throws Error if required fields are missing
(config: ModelConfig | null | undefined)
| 27 | * @throws Error if required fields are missing |
| 28 | */ |
| 29 | function validateModelConfig(config: ModelConfig | null | undefined): asserts config is ModelConfig { |
| 30 | if (!config || !config.provider || !config.model || !config.baseUrl || !config.apiKey) { |
| 31 | throw new Error( |
| 32 | `Invalid model configuration. Required fields: provider, model, baseUrl, apiKey. Please check your config.yaml file.` |
| 33 | ); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Call an LLM model with the given options |