mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Run online, offine chat actor, director tests for any supported provider
- Previously online chat actors, director tests only worked with openai.
This change allows running them for any supported onlnie provider
including Google, Anthropic and Openai.
- Enable online/offline chat actor, director in two ways:
1. Explicitly setting KHOJ_TEST_CHAT_PROVIDER environment variable to
google, anthropic, openai, offline
2. Implicitly by the first API key found from openai, google or anthropic.
- Default offline chat provider to use Llama 3.1 3B for faster, lower
compute test runs
This commit is contained in:
@@ -2,7 +2,10 @@ from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
SKIP_TESTS = True
|
||||
from khoj.database.models import ChatModelOptions
|
||||
from tests.helpers import get_chat_provider
|
||||
|
||||
SKIP_TESTS = get_chat_provider(default=None) != ChatModelOptions.ModelType.OFFLINE
|
||||
pytestmark = pytest.mark.skipif(
|
||||
SKIP_TESTS,
|
||||
reason="Disable in CI to avoid long test runs.",
|
||||
|
||||
Reference in New Issue
Block a user