export class LlmModelConfigurationError extends Error {
  constructor(context?: string) {
    super(`LLM model is not configured${context ? ` (${context})` : ''}`);
    this.name = 'LlmModelConfigurationError';
  }
}

export function requireConfiguredLlmModel(
  value: string | null | undefined,
  context?: string,
): string {
  const model = value?.trim();
  if (!model) throw new LlmModelConfigurationError(context);
  return model;
}
