mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
### RAG Config System * Added ChromaDB client creation via config with sensible defaults * Introduced optional imports and shared RAG config utilities/schema * Enabled embedding function support with ChromaDB provider integration * Refactored configs for immutability and stronger type safety * Removed unused code and expanded test coverage
23 lines
744 B
Python
23 lines
744 B
Python
"""Tests for optional imports."""
|
|
|
|
import pytest
|
|
|
|
from crewai.rag.config.optional_imports.base import _MissingProvider
|
|
from crewai.rag.config.optional_imports.providers import MissingChromaDBConfig
|
|
|
|
|
|
def test_missing_provider_raises_runtime_error():
|
|
"""Test that _MissingProvider raises RuntimeError on instantiation."""
|
|
with pytest.raises(
|
|
RuntimeError, match="provider '__missing__' requested but not installed"
|
|
):
|
|
_MissingProvider()
|
|
|
|
|
|
def test_missing_chromadb_config_raises_runtime_error():
|
|
"""Test that MissingChromaDBConfig raises RuntimeError on instantiation."""
|
|
with pytest.raises(
|
|
RuntimeError, match="provider 'chromadb' requested but not installed"
|
|
):
|
|
MissingChromaDBConfig()
|