Fix #2694: Make chromadb an optional dependency to fix Windows installation issues

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-04-26 18:38:34 +00:00
parent 51eb5e9998
commit 8dd779371d
7 changed files with 319 additions and 159 deletions

View File

@@ -1,5 +1,11 @@
import pytest
chromadb_not_installed = False
try:
import chromadb
except ImportError:
chromadb_not_installed = True
from crewai.memory.long_term.long_term_memory import LongTermMemory
from crewai.memory.long_term.long_term_memory_item import LongTermMemoryItem
@@ -10,6 +16,7 @@ def long_term_memory():
return LongTermMemory()
@pytest.mark.skipif(chromadb_not_installed, reason="ChromaDB is not installed")
def test_save_and_search(long_term_memory):
memory = LongTermMemoryItem(
agent="test_agent",