Files
awoooi/apps/api/tests/test_knowledge_extractor_model.py
Your Name 8699fe0c7f
All checks were successful
CD Pipeline / tests (push) Successful in 1m23s
Code Review / ai-code-review (push) Successful in 14s
CD Pipeline / build-and-deploy (push) Successful in 3m35s
CD Pipeline / post-deploy-checks (push) Successful in 3m23s
fix(api): align kb extractor ollama model
2026-05-31 18:07:03 +08:00

17 lines
696 B
Python

from src.core.config import settings
from src.services import knowledge_extractor_service
def test_extract_model_uses_configured_ollama_tool_model(monkeypatch):
"""KB extractor must use a configured model that exists on GCP Ollama."""
monkeypatch.setattr(settings, "OLLAMA_TOOL_MODEL", "hermes3:latest")
assert knowledge_extractor_service._get_extract_model() == "hermes3:latest"
def test_extract_model_falls_back_to_hermes_when_config_empty(monkeypatch):
"""Empty runtime config should not fall back to the removed llama3.2 model."""
monkeypatch.setattr(settings, "OLLAMA_TOOL_MODEL", "")
assert knowledge_extractor_service._get_extract_model() == "hermes3:latest"