Validate LLM configuration (required for optimize, LLM translate, split).
(config: dict)
| 81 | |
| 82 | |
| 83 | def validate_llm(config: dict) -> bool: |
| 84 | """Validate LLM configuration (required for optimize, LLM translate, split).""" |
| 85 | api_key = get(config, "llm.api_key") |
| 86 | model = get(config, "llm.model") |
| 87 | |
| 88 | if not api_key: |
| 89 | output.config_missing_error( |
| 90 | "LLM API key", |
| 91 | "llm.api_key", |
| 92 | "OPENAI_API_KEY", |
| 93 | "--api-key", |
| 94 | ) |
| 95 | return False |
| 96 | if not model: |
| 97 | output.config_missing_error( |
| 98 | "LLM model", |
| 99 | "llm.model", |
| 100 | "OPENAI_MODEL", |
| 101 | "--model", |
| 102 | ) |
| 103 | return False |
| 104 | return True |
| 105 | |
| 106 | |
| 107 | def validate_whisper_api(config: dict) -> bool: |
no test coverage detected