MCPcopy Create free account
hub / github.com/MigoXLab/coderio / validateModelConfig

Function validateModelConfig

src/utils/call-model.ts:29–35  ·  view source on GitHub ↗

* Validate model configuration * @param config - Model configuration to validate * @throws Error if required fields are missing

(config: ModelConfig | null | undefined)

Source from the content-addressed store, hash-verified

27 * @throws Error if required fields are missing
28 */
29function 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

Callers 1

callModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected