mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-25 16:18:13 +00:00
feat: Add comprehensive Elasticsearch support to crewai.rag
- Implement ElasticsearchClient with full sync/async operations - Add ElasticsearchConfig with connection and embedding options - Create factory pattern following ChromaDB/Qdrant conventions - Add comprehensive test suite with 26 passing tests (100% coverage) - Support both sync and async Elasticsearch operations - Include proper error handling and edge case coverage - Update type system and factory to support Elasticsearch provider - Follow existing RAG patterns for consistency Resolves #3404 Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
import pytest
|
||||
|
||||
from crewai.rag.config.optional_imports.base import _MissingProvider
|
||||
from crewai.rag.config.optional_imports.providers import MissingChromaDBConfig
|
||||
from crewai.rag.config.optional_imports.providers import (
|
||||
MissingChromaDBConfig,
|
||||
MissingElasticsearchConfig,
|
||||
)
|
||||
|
||||
|
||||
def test_missing_provider_raises_runtime_error():
|
||||
@@ -20,3 +23,11 @@ def test_missing_chromadb_config_raises_runtime_error():
|
||||
RuntimeError, match="provider 'chromadb' requested but not installed"
|
||||
):
|
||||
MissingChromaDBConfig()
|
||||
|
||||
|
||||
def test_missing_elasticsearch_config_raises_runtime_error():
|
||||
"""Test that MissingElasticsearchConfig raises RuntimeError on instantiation."""
|
||||
with pytest.raises(
|
||||
RuntimeError, match="provider 'elasticsearch' requested but not installed"
|
||||
):
|
||||
MissingElasticsearchConfig()
|
||||
|
||||
Reference in New Issue
Block a user