Check if a command exists in PATH.
(self, command: str)
| 211 | return True |
| 212 | |
| 213 | def _command_exists(self, command: str) -> bool: |
| 214 | """Check if a command exists in PATH.""" |
| 215 | try: |
| 216 | subprocess.run([command, '--version'], |
| 217 | capture_output=True, check=True, timeout=5) |
| 218 | return True |
| 219 | except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError): |
| 220 | return False |
| 221 | |
| 222 | def ensure_models(self): |
| 223 | """Ensure required Ollama models are available.""" |
no test coverage detected