Check if the native vector engine (PersistStore) is available.
()
| 144 | |
| 145 | |
| 146 | def check_native_engine() -> tuple[bool, str, Optional[str]]: |
| 147 | """Check if the native vector engine (PersistStore) is available.""" |
| 148 | try: |
| 149 | from openviking.storage.vectordb.engine import ( |
| 150 | AVAILABLE_ENGINE_VARIANTS, |
| 151 | ENGINE_VARIANT, |
| 152 | ) |
| 153 | except ImportError as exc: |
| 154 | return ( |
| 155 | False, |
| 156 | f"Cannot import engine module: {exc}", |
| 157 | "pip install openviking --upgrade --force-reinstall", |
| 158 | ) |
| 159 | |
| 160 | if ENGINE_VARIANT == "unavailable": |
| 161 | variants = ", ".join(AVAILABLE_ENGINE_VARIANTS) if AVAILABLE_ENGINE_VARIANTS else "none" |
| 162 | machine = platform.machine() |
| 163 | return ( |
| 164 | False, |
| 165 | f"No compatible engine variant (platform: {machine}, packaged: {variants})", |
| 166 | 'pip install openviking --upgrade --force-reinstall\n Alt: Use vectordb.backend = "volcengine" instead of "local"', |
| 167 | ) |
| 168 | |
| 169 | return True, f"variant={ENGINE_VARIANT}", None |
| 170 | |
| 171 | |
| 172 | def check_agfs() -> tuple[bool, str, Optional[str]]: |