mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-26 00:28:13 +00:00
Compare commits
4 Commits
devin/1768
...
devin/1741
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
538f1a2a84 | ||
|
|
dcf8e8d6e7 | ||
|
|
fde4c4e92b | ||
|
|
36e7236ffe |
@@ -136,6 +136,14 @@ pip install 'crewai[tools]'
|
|||||||
```
|
```
|
||||||
The command above installs the basic package and also adds extra components which require more dependencies to function.
|
The command above installs the basic package and also adds extra components which require more dependencies to function.
|
||||||
|
|
||||||
|
For vector storage and RAG capabilities, install with the chromadb extra:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pip install 'crewai[chromadb]'
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: If you're using Alpine Linux or other environments where onnxruntime is not available, you can still use CrewAI without the chromadb dependency, but with limited vector storage functionality.
|
||||||
|
|
||||||
### Troubleshooting Dependencies
|
### Troubleshooting Dependencies
|
||||||
|
|
||||||
If you encounter issues during installation or usage, here are some common solutions:
|
If you encounter issues during installation or usage, here are some common solutions:
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ dependencies = [
|
|||||||
"opentelemetry-sdk>=1.22.0",
|
"opentelemetry-sdk>=1.22.0",
|
||||||
"opentelemetry-exporter-otlp-proto-http>=1.22.0",
|
"opentelemetry-exporter-otlp-proto-http>=1.22.0",
|
||||||
# Data Handling
|
# Data Handling
|
||||||
"chromadb>=0.5.23",
|
|
||||||
"openpyxl>=3.1.5",
|
"openpyxl>=3.1.5",
|
||||||
"pyvis>=0.3.2",
|
"pyvis>=0.3.2",
|
||||||
# Authentication and Security
|
# Authentication and Security
|
||||||
@@ -64,6 +63,9 @@ mem0 = ["mem0ai>=0.1.29"]
|
|||||||
docling = [
|
docling = [
|
||||||
"docling>=2.12.0",
|
"docling>=2.12.0",
|
||||||
]
|
]
|
||||||
|
chromadb = [
|
||||||
|
"chromadb>=0.5.23",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.uv]
|
[tool.uv]
|
||||||
dev-dependencies = [
|
dev-dependencies = [
|
||||||
|
|||||||
@@ -6,11 +6,18 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
from typing import Any, Dict, List, Optional, Union, cast
|
from typing import Any, Dict, List, Optional, Union, cast
|
||||||
|
|
||||||
import chromadb
|
try:
|
||||||
import chromadb.errors
|
import chromadb
|
||||||
from chromadb.api import ClientAPI
|
import chromadb.errors
|
||||||
from chromadb.api.types import OneOrMany
|
from chromadb.api import ClientAPI
|
||||||
from chromadb.config import Settings
|
from chromadb.api.types import OneOrMany
|
||||||
|
from chromadb.config import Settings
|
||||||
|
CHROMADB_AVAILABLE = True
|
||||||
|
except ImportError:
|
||||||
|
CHROMADB_AVAILABLE = False
|
||||||
|
# Define placeholder types for type checking
|
||||||
|
ClientAPI = Any
|
||||||
|
OneOrMany = Any
|
||||||
|
|
||||||
from crewai.knowledge.storage.base_knowledge_storage import BaseKnowledgeStorage
|
from crewai.knowledge.storage.base_knowledge_storage import BaseKnowledgeStorage
|
||||||
from crewai.utilities import EmbeddingConfigurator
|
from crewai.utilities import EmbeddingConfigurator
|
||||||
@@ -42,9 +49,10 @@ class KnowledgeStorage(BaseKnowledgeStorage):
|
|||||||
search efficiency.
|
search efficiency.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
collection: Optional[chromadb.Collection] = None
|
collection: Optional[Any] = None # Will be chromadb.Collection when available
|
||||||
collection_name: Optional[str] = "knowledge"
|
collection_name: Optional[str] = "knowledge"
|
||||||
app: Optional[ClientAPI] = None
|
app: Optional[Any] = None # Will be ClientAPI when available
|
||||||
|
embedder: Optional[Any] = None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@@ -61,63 +69,98 @@ class KnowledgeStorage(BaseKnowledgeStorage):
|
|||||||
filter: Optional[dict] = None,
|
filter: Optional[dict] = None,
|
||||||
score_threshold: float = 0.35,
|
score_threshold: float = 0.35,
|
||||||
) -> List[Dict[str, Any]]:
|
) -> List[Dict[str, Any]]:
|
||||||
with suppress_logging():
|
if not CHROMADB_AVAILABLE:
|
||||||
if self.collection:
|
logging.warning(
|
||||||
fetched = self.collection.query(
|
"ChromaDB is not installed. Search functionality limited. "
|
||||||
query_texts=query,
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
n_results=limit,
|
)
|
||||||
where=filter,
|
return []
|
||||||
)
|
|
||||||
results = []
|
|
||||||
for i in range(len(fetched["ids"][0])): # type: ignore
|
|
||||||
result = {
|
|
||||||
"id": fetched["ids"][0][i], # type: ignore
|
|
||||||
"metadata": fetched["metadatas"][0][i], # type: ignore
|
|
||||||
"context": fetched["documents"][0][i], # type: ignore
|
|
||||||
"score": fetched["distances"][0][i], # type: ignore
|
|
||||||
}
|
|
||||||
if result["score"] >= score_threshold:
|
|
||||||
results.append(result)
|
|
||||||
return results
|
|
||||||
else:
|
|
||||||
raise Exception("Collection not initialized")
|
|
||||||
|
|
||||||
def initialize_knowledge_storage(self):
|
|
||||||
base_path = os.path.join(db_storage_path(), "knowledge")
|
|
||||||
chroma_client = chromadb.PersistentClient(
|
|
||||||
path=base_path,
|
|
||||||
settings=Settings(allow_reset=True),
|
|
||||||
)
|
|
||||||
|
|
||||||
self.app = chroma_client
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
collection_name = (
|
with suppress_logging():
|
||||||
f"knowledge_{self.collection_name}"
|
if self.collection:
|
||||||
if self.collection_name
|
fetched = self.collection.query(
|
||||||
else "knowledge"
|
query_texts=query,
|
||||||
)
|
n_results=limit,
|
||||||
if self.app:
|
where=filter,
|
||||||
self.collection = self.app.get_or_create_collection(
|
)
|
||||||
name=collection_name, embedding_function=self.embedder
|
results = []
|
||||||
)
|
for i in range(len(fetched["ids"][0])): # type: ignore
|
||||||
else:
|
result = {
|
||||||
raise Exception("Vector Database Client not initialized")
|
"id": fetched["ids"][0][i], # type: ignore
|
||||||
except Exception:
|
"metadata": fetched["metadatas"][0][i], # type: ignore
|
||||||
raise Exception("Failed to create or get collection")
|
"context": fetched["documents"][0][i], # type: ignore
|
||||||
|
"score": fetched["distances"][0][i], # type: ignore
|
||||||
|
}
|
||||||
|
if result["score"] >= score_threshold:
|
||||||
|
results.append(result)
|
||||||
|
return results
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
except (ImportError, NameError, AttributeError, Exception) as e:
|
||||||
|
logging.error(f"Error during knowledge search operation: {str(e)}")
|
||||||
|
return []
|
||||||
|
|
||||||
def reset(self):
|
def initialize_knowledge_storage(self):
|
||||||
base_path = os.path.join(db_storage_path(), KNOWLEDGE_DIRECTORY)
|
if not CHROMADB_AVAILABLE:
|
||||||
if not self.app:
|
import logging
|
||||||
self.app = chromadb.PersistentClient(
|
logging.warning(
|
||||||
|
"ChromaDB is not installed. Knowledge storage functionality will be limited. "
|
||||||
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
|
)
|
||||||
|
self.app = None
|
||||||
|
self.collection = None
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
base_path = os.path.join(db_storage_path(), "knowledge")
|
||||||
|
chroma_client = chromadb.PersistentClient(
|
||||||
path=base_path,
|
path=base_path,
|
||||||
settings=Settings(allow_reset=True),
|
settings=Settings(allow_reset=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.app.reset()
|
self.app = chroma_client
|
||||||
shutil.rmtree(base_path)
|
|
||||||
self.app = None
|
try:
|
||||||
self.collection = None
|
collection_name = (
|
||||||
|
f"knowledge_{self.collection_name}"
|
||||||
|
if self.collection_name
|
||||||
|
else "knowledge"
|
||||||
|
)
|
||||||
|
if self.app:
|
||||||
|
self.collection = self.app.get_or_create_collection(
|
||||||
|
name=collection_name, embedding_function=self.embedder
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
raise Exception("Vector Database Client not initialized")
|
||||||
|
except Exception:
|
||||||
|
raise Exception("Failed to create or get collection")
|
||||||
|
except Exception:
|
||||||
|
logging.warning(
|
||||||
|
"Error initializing ChromaDB. Knowledge storage functionality will be limited."
|
||||||
|
)
|
||||||
|
self.app = None
|
||||||
|
self.collection = None
|
||||||
|
|
||||||
|
def reset(self):
|
||||||
|
base_path = os.path.join(db_storage_path(), KNOWLEDGE_DIRECTORY)
|
||||||
|
try:
|
||||||
|
if not self.app:
|
||||||
|
self.app = chromadb.PersistentClient(
|
||||||
|
path=base_path,
|
||||||
|
settings=Settings(allow_reset=True),
|
||||||
|
)
|
||||||
|
|
||||||
|
self.app.reset()
|
||||||
|
shutil.rmtree(base_path)
|
||||||
|
self.app = None
|
||||||
|
self.collection = None
|
||||||
|
except (ImportError, NameError, AttributeError):
|
||||||
|
# Handle case when chromadb is not available
|
||||||
|
if os.path.exists(base_path):
|
||||||
|
shutil.rmtree(base_path)
|
||||||
|
self.app = None
|
||||||
|
self.collection = None
|
||||||
|
|
||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
@@ -125,7 +168,8 @@ class KnowledgeStorage(BaseKnowledgeStorage):
|
|||||||
metadata: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = None,
|
metadata: Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] = None,
|
||||||
):
|
):
|
||||||
if not self.collection:
|
if not self.collection:
|
||||||
raise Exception("Collection not initialized")
|
# Just return silently if chromadb is not available
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Create a dictionary to store unique documents
|
# Create a dictionary to store unique documents
|
||||||
@@ -154,7 +198,7 @@ class KnowledgeStorage(BaseKnowledgeStorage):
|
|||||||
filtered_ids.append(doc_id)
|
filtered_ids.append(doc_id)
|
||||||
|
|
||||||
# If we have no metadata at all, set it to None
|
# If we have no metadata at all, set it to None
|
||||||
final_metadata: Optional[OneOrMany[chromadb.Metadata]] = (
|
final_metadata = (
|
||||||
None if all(m is None for m in filtered_metadata) else filtered_metadata
|
None if all(m is None for m in filtered_metadata) else filtered_metadata
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -163,29 +207,40 @@ class KnowledgeStorage(BaseKnowledgeStorage):
|
|||||||
metadatas=final_metadata,
|
metadatas=final_metadata,
|
||||||
ids=filtered_ids,
|
ids=filtered_ids,
|
||||||
)
|
)
|
||||||
except chromadb.errors.InvalidDimensionException as e:
|
except (ImportError, NameError, AttributeError) as e:
|
||||||
Logger(verbose=True).log(
|
# Handle case when chromadb is not available
|
||||||
"error",
|
return
|
||||||
"Embedding dimension mismatch. This usually happens when mixing different embedding models. Try resetting the collection using `crewai reset-memories -a`",
|
|
||||||
"red",
|
|
||||||
)
|
|
||||||
raise ValueError(
|
|
||||||
"Embedding dimension mismatch. Make sure you're using the same embedding model "
|
|
||||||
"across all operations with this collection."
|
|
||||||
"Try resetting the collection using `crewai reset-memories -a`"
|
|
||||||
) from e
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
if "chromadb" in str(e.__class__):
|
||||||
|
# Handle chromadb-specific errors silently when chromadb might not be fully available
|
||||||
|
return
|
||||||
Logger(verbose=True).log("error", f"Failed to upsert documents: {e}", "red")
|
Logger(verbose=True).log("error", f"Failed to upsert documents: {e}", "red")
|
||||||
raise
|
# Don't raise the exception, just log it and continue
|
||||||
|
return
|
||||||
|
|
||||||
def _create_default_embedding_function(self):
|
def _create_default_embedding_function(self):
|
||||||
from chromadb.utils.embedding_functions.openai_embedding_function import (
|
try:
|
||||||
OpenAIEmbeddingFunction,
|
from chromadb.utils.embedding_functions.openai_embedding_function import (
|
||||||
)
|
OpenAIEmbeddingFunction,
|
||||||
|
)
|
||||||
|
|
||||||
return OpenAIEmbeddingFunction(
|
api_key = os.getenv("OPENAI_API_KEY")
|
||||||
api_key=os.getenv("OPENAI_API_KEY"), model_name="text-embedding-3-small"
|
if not api_key:
|
||||||
)
|
logging.warning(
|
||||||
|
"OPENAI_API_KEY not found. Vector operations will be limited."
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
|
return OpenAIEmbeddingFunction(
|
||||||
|
api_key=api_key, model_name="text-embedding-3-small"
|
||||||
|
)
|
||||||
|
except ImportError:
|
||||||
|
import logging
|
||||||
|
logging.warning(
|
||||||
|
"ChromaDB is not installed. Cannot create default embedding function. "
|
||||||
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
def _set_embedder_config(self, embedder: Optional[Dict[str, Any]] = None) -> None:
|
def _set_embedder_config(self, embedder: Optional[Dict[str, Any]] = None) -> None:
|
||||||
"""Set the embedding configuration for the knowledge storage.
|
"""Set the embedding configuration for the knowledge storage.
|
||||||
@@ -194,8 +249,12 @@ class KnowledgeStorage(BaseKnowledgeStorage):
|
|||||||
embedder_config (Optional[Dict[str, Any]]): Configuration dictionary for the embedder.
|
embedder_config (Optional[Dict[str, Any]]): Configuration dictionary for the embedder.
|
||||||
If None or empty, defaults to the default embedding function.
|
If None or empty, defaults to the default embedding function.
|
||||||
"""
|
"""
|
||||||
self.embedder = (
|
try:
|
||||||
EmbeddingConfigurator().configure_embedder(embedder)
|
self.embedder = (
|
||||||
if embedder
|
EmbeddingConfigurator().configure_embedder(embedder)
|
||||||
else self._create_default_embedding_function()
|
if embedder
|
||||||
)
|
else self._create_default_embedding_function()
|
||||||
|
)
|
||||||
|
except (ImportError, NameError, AttributeError):
|
||||||
|
# Handle case when chromadb is not available
|
||||||
|
self.embedder = None
|
||||||
|
|||||||
@@ -4,9 +4,15 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional, cast
|
||||||
|
|
||||||
from chromadb.api import ClientAPI
|
try:
|
||||||
|
from chromadb.api import ClientAPI
|
||||||
|
CHROMADB_AVAILABLE = True
|
||||||
|
except ImportError:
|
||||||
|
CHROMADB_AVAILABLE = False
|
||||||
|
# Define placeholder type for type checking
|
||||||
|
ClientAPI = Any
|
||||||
|
|
||||||
from crewai.memory.storage.base_rag_storage import BaseRAGStorage
|
from crewai.memory.storage.base_rag_storage import BaseRAGStorage
|
||||||
from crewai.utilities import EmbeddingConfigurator
|
from crewai.utilities import EmbeddingConfigurator
|
||||||
@@ -37,7 +43,7 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
search efficiency.
|
search efficiency.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
app: ClientAPI | None = None
|
app = None # Type will be ClientAPI when available
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, type, allow_reset=True, embedder_config=None, crew=None, path=None
|
self, type, allow_reset=True, embedder_config=None, crew=None, path=None
|
||||||
@@ -60,26 +66,41 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
self.embedder_config = configurator.configure_embedder(self.embedder_config)
|
self.embedder_config = configurator.configure_embedder(self.embedder_config)
|
||||||
|
|
||||||
def _initialize_app(self):
|
def _initialize_app(self):
|
||||||
import chromadb
|
if not CHROMADB_AVAILABLE:
|
||||||
from chromadb.config import Settings
|
logging.warning(
|
||||||
|
"ChromaDB is not installed. RAG storage functionality will be limited. "
|
||||||
self._set_embedder_config()
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
chroma_client = chromadb.PersistentClient(
|
)
|
||||||
path=self.path if self.path else self.storage_file_name,
|
self.app = None
|
||||||
settings=Settings(allow_reset=self.allow_reset),
|
self.collection = None
|
||||||
)
|
return
|
||||||
|
|
||||||
self.app = chroma_client
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.collection = self.app.get_collection(
|
import chromadb
|
||||||
name=self.type, embedding_function=self.embedder_config
|
from chromadb.config import Settings
|
||||||
)
|
|
||||||
except Exception:
|
self._set_embedder_config()
|
||||||
self.collection = self.app.create_collection(
|
chroma_client = chromadb.PersistentClient(
|
||||||
name=self.type, embedding_function=self.embedder_config
|
path=self.path if self.path else self.storage_file_name,
|
||||||
|
settings=Settings(allow_reset=self.allow_reset),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.app = chroma_client
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.collection = self.app.get_collection(
|
||||||
|
name=self.type, embedding_function=self.embedder_config
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
logging.info(f"Collection not found, creating new one: {str(e)}")
|
||||||
|
self.collection = self.app.create_collection(
|
||||||
|
name=self.type, embedding_function=self.embedder_config
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"Failed to initialize ChromaDB: {str(e)}")
|
||||||
|
self.app = None
|
||||||
|
self.collection = None
|
||||||
|
|
||||||
def _sanitize_role(self, role: str) -> str:
|
def _sanitize_role(self, role: str) -> str:
|
||||||
"""
|
"""
|
||||||
Sanitizes agent roles to ensure valid directory names.
|
Sanitizes agent roles to ensure valid directory names.
|
||||||
@@ -103,6 +124,10 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
def save(self, value: Any, metadata: Dict[str, Any]) -> None:
|
def save(self, value: Any, metadata: Dict[str, Any]) -> None:
|
||||||
if not hasattr(self, "app") or not hasattr(self, "collection"):
|
if not hasattr(self, "app") or not hasattr(self, "collection"):
|
||||||
self._initialize_app()
|
self._initialize_app()
|
||||||
|
|
||||||
|
if not self.collection:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._generate_embedding(value, metadata)
|
self._generate_embedding(value, metadata)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -115,9 +140,19 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
filter: Optional[dict] = None,
|
filter: Optional[dict] = None,
|
||||||
score_threshold: float = 0.35,
|
score_threshold: float = 0.35,
|
||||||
) -> List[Any]:
|
) -> List[Any]:
|
||||||
|
if not CHROMADB_AVAILABLE:
|
||||||
|
logging.warning(
|
||||||
|
"ChromaDB is not installed. Search functionality limited. "
|
||||||
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
|
)
|
||||||
|
return []
|
||||||
|
|
||||||
if not hasattr(self, "app"):
|
if not hasattr(self, "app"):
|
||||||
self._initialize_app()
|
self._initialize_app()
|
||||||
|
|
||||||
|
if not self.collection:
|
||||||
|
return []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with suppress_logging():
|
with suppress_logging():
|
||||||
response = self.collection.query(query_texts=query, n_results=limit)
|
response = self.collection.query(query_texts=query, n_results=limit)
|
||||||
@@ -142,6 +177,9 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
if not hasattr(self, "app") or not hasattr(self, "collection"):
|
if not hasattr(self, "app") or not hasattr(self, "collection"):
|
||||||
self._initialize_app()
|
self._initialize_app()
|
||||||
|
|
||||||
|
if not self.collection:
|
||||||
|
return
|
||||||
|
|
||||||
self.collection.add(
|
self.collection.add(
|
||||||
documents=[text],
|
documents=[text],
|
||||||
metadatas=[metadata or {}],
|
metadatas=[metadata or {}],
|
||||||
@@ -149,26 +187,44 @@ class RAGStorage(BaseRAGStorage):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def reset(self) -> None:
|
def reset(self) -> None:
|
||||||
|
if not self.app:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.app:
|
self.app.reset()
|
||||||
self.app.reset()
|
path = f"{db_storage_path()}/{self.type}"
|
||||||
shutil.rmtree(f"{db_storage_path()}/{self.type}")
|
if os.path.exists(path):
|
||||||
self.app = None
|
shutil.rmtree(path)
|
||||||
self.collection = None
|
self.app = None
|
||||||
|
self.collection = None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if "attempt to write a readonly database" in str(e):
|
if "attempt to write a readonly database" in str(e):
|
||||||
# Ignore this specific error
|
# Ignore this specific error
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
logging.error(f"Error during {self.type} reset: {str(e)}")
|
||||||
f"An error occurred while resetting the {self.type} memory: {e}"
|
# Don't raise the exception, just log it
|
||||||
)
|
|
||||||
|
|
||||||
def _create_default_embedding_function(self):
|
def _create_default_embedding_function(self):
|
||||||
from chromadb.utils.embedding_functions.openai_embedding_function import (
|
try:
|
||||||
OpenAIEmbeddingFunction,
|
from chromadb.utils.embedding_functions.openai_embedding_function import (
|
||||||
)
|
OpenAIEmbeddingFunction,
|
||||||
|
)
|
||||||
|
|
||||||
return OpenAIEmbeddingFunction(
|
api_key = os.getenv("OPENAI_API_KEY")
|
||||||
api_key=os.getenv("OPENAI_API_KEY"), model_name="text-embedding-3-small"
|
if not api_key:
|
||||||
)
|
logging.warning(
|
||||||
|
"OPENAI_API_KEY not found. Vector operations will be limited."
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
|
return OpenAIEmbeddingFunction(
|
||||||
|
api_key=api_key, model_name="text-embedding-3-small"
|
||||||
|
)
|
||||||
|
except ImportError:
|
||||||
|
import logging
|
||||||
|
logging.warning(
|
||||||
|
"ChromaDB is not installed. Cannot create default embedding function. "
|
||||||
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
import os
|
import os
|
||||||
from typing import Any, Dict, Optional, cast
|
from typing import Any, Dict, Optional, cast
|
||||||
|
|
||||||
from chromadb import Documents, EmbeddingFunction, Embeddings
|
try:
|
||||||
from chromadb.api.types import validate_embedding_function
|
from chromadb import Documents, EmbeddingFunction, Embeddings
|
||||||
|
from chromadb.api.types import validate_embedding_function
|
||||||
|
CHROMADB_AVAILABLE = True
|
||||||
|
except ImportError:
|
||||||
|
CHROMADB_AVAILABLE = False
|
||||||
|
# Define placeholder types for type checking
|
||||||
|
Documents = Any
|
||||||
|
EmbeddingFunction = Any
|
||||||
|
Embeddings = Any
|
||||||
|
def validate_embedding_function(func): return func
|
||||||
|
|
||||||
|
|
||||||
class EmbeddingConfigurator:
|
class EmbeddingConfigurator:
|
||||||
@@ -47,6 +56,14 @@ class EmbeddingConfigurator:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _create_default_embedding_function():
|
def _create_default_embedding_function():
|
||||||
|
if not CHROMADB_AVAILABLE:
|
||||||
|
import logging
|
||||||
|
logging.warning(
|
||||||
|
"ChromaDB is not installed. Cannot create default embedding function. "
|
||||||
|
"Install with 'pip install crewai[chromadb]' to enable full functionality."
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
from chromadb.utils.embedding_functions.openai_embedding_function import (
|
from chromadb.utils.embedding_functions.openai_embedding_function import (
|
||||||
OpenAIEmbeddingFunction,
|
OpenAIEmbeddingFunction,
|
||||||
)
|
)
|
||||||
|
|||||||
52
tests/test_optional_dependencies.py
Normal file
52
tests/test_optional_dependencies.py
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import importlib
|
||||||
|
import sys
|
||||||
|
from unittest import mock
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
def test_rag_storage_without_chromadb():
|
||||||
|
# Mock the import to simulate chromadb not being installed
|
||||||
|
with mock.patch.dict(sys.modules, {'chromadb': None}):
|
||||||
|
# Force reload to ensure our mock takes effect
|
||||||
|
if 'crewai.memory.storage.rag_storage' in sys.modules:
|
||||||
|
importlib.reload(sys.modules['crewai.memory.storage.rag_storage'])
|
||||||
|
|
||||||
|
# Now import and test
|
||||||
|
from crewai.memory.storage.rag_storage import RAGStorage
|
||||||
|
|
||||||
|
# Should not raise an exception
|
||||||
|
storage = RAGStorage(type="test", allow_reset=True)
|
||||||
|
|
||||||
|
# Methods should handle the case when chromadb is not available
|
||||||
|
assert storage.app is None
|
||||||
|
assert storage.collection is None
|
||||||
|
|
||||||
|
# These methods should not raise exceptions
|
||||||
|
storage.save("test", {})
|
||||||
|
results = storage.search("test")
|
||||||
|
assert results == []
|
||||||
|
storage.reset()
|
||||||
|
|
||||||
|
def test_knowledge_storage_without_chromadb():
|
||||||
|
# Mock the import to simulate chromadb not being installed
|
||||||
|
with mock.patch.dict(sys.modules, {'chromadb': None}):
|
||||||
|
# Force reload to ensure our mock takes effect
|
||||||
|
if 'crewai.knowledge.storage.knowledge_storage' in sys.modules:
|
||||||
|
importlib.reload(sys.modules['crewai.knowledge.storage.knowledge_storage'])
|
||||||
|
|
||||||
|
# Now import and test
|
||||||
|
from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage
|
||||||
|
|
||||||
|
# Should not raise an exception
|
||||||
|
storage = KnowledgeStorage()
|
||||||
|
|
||||||
|
# Methods should handle the case when chromadb is not available
|
||||||
|
assert storage.app is None
|
||||||
|
assert storage.collection is None
|
||||||
|
|
||||||
|
# These methods should not raise exceptions
|
||||||
|
storage.initialize_knowledge_storage()
|
||||||
|
results = storage.search(["test"])
|
||||||
|
assert results == []
|
||||||
|
storage.reset()
|
||||||
103
uv.lock
generated
103
uv.lock
generated
@@ -1,42 +1,19 @@
|
|||||||
version = 1
|
version = 1
|
||||||
requires-python = ">=3.10, <3.13"
|
requires-python = ">=3.10, <3.13"
|
||||||
resolution-markers = [
|
resolution-markers = [
|
||||||
"python_full_version < '3.11' and platform_system == 'Darwin' and sys_platform == 'darwin'",
|
"python_full_version < '3.11' and sys_platform == 'darwin'",
|
||||||
"python_full_version < '3.11' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'darwin'",
|
"python_version < '0'",
|
||||||
"(python_full_version < '3.11' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform == 'darwin') or (python_full_version < '3.11' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'darwin')",
|
"python_full_version < '3.11' and platform_machine == 'aarch64' and sys_platform == 'linux'",
|
||||||
"python_full_version < '3.11' and platform_machine == 'aarch64' and platform_system == 'Darwin' and sys_platform == 'linux'",
|
"(python_full_version < '3.11' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version < '3.11' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
||||||
"python_full_version < '3.11' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'linux'",
|
"python_full_version == '3.11.*' and sys_platform == 'darwin'",
|
||||||
"python_full_version < '3.11' and platform_machine == 'aarch64' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'linux'",
|
"python_full_version == '3.11.*' and platform_machine == 'aarch64' and sys_platform == 'linux'",
|
||||||
"(python_full_version < '3.11' and platform_machine != 'aarch64' and platform_system == 'Darwin' and sys_platform != 'darwin') or (python_full_version < '3.11' and platform_system == 'Darwin' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
"(python_full_version == '3.11.*' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version == '3.11.*' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
||||||
"python_full_version < '3.11' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux'",
|
"python_full_version >= '3.12' and python_full_version < '3.12.4' and sys_platform == 'darwin'",
|
||||||
"(python_full_version < '3.11' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform != 'darwin') or (python_full_version < '3.11' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and sys_platform == 'linux'",
|
||||||
"python_full_version == '3.11.*' and platform_system == 'Darwin' and sys_platform == 'darwin'",
|
"(python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.12' and python_full_version < '3.12.4' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
||||||
"python_full_version == '3.11.*' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'darwin'",
|
"python_full_version >= '3.12.4' and sys_platform == 'darwin'",
|
||||||
"(python_full_version == '3.11.*' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform == 'darwin') or (python_full_version == '3.11.*' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'darwin')",
|
"python_full_version >= '3.12.4' and platform_machine == 'aarch64' and sys_platform == 'linux'",
|
||||||
"python_full_version == '3.11.*' and platform_machine == 'aarch64' and platform_system == 'Darwin' and sys_platform == 'linux'",
|
"(python_full_version >= '3.12.4' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.12.4' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
||||||
"python_full_version == '3.11.*' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'linux'",
|
|
||||||
"python_full_version == '3.11.*' and platform_machine == 'aarch64' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'linux'",
|
|
||||||
"(python_full_version == '3.11.*' and platform_machine != 'aarch64' and platform_system == 'Darwin' and sys_platform != 'darwin') or (python_full_version == '3.11.*' and platform_system == 'Darwin' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
|
||||||
"python_full_version == '3.11.*' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux'",
|
|
||||||
"(python_full_version == '3.11.*' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform != 'darwin') or (python_full_version == '3.11.*' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
|
||||||
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_system == 'Darwin' and sys_platform == 'darwin'",
|
|
||||||
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'darwin'",
|
|
||||||
"(python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform == 'darwin') or (python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'darwin')",
|
|
||||||
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Darwin' and sys_platform == 'linux'",
|
|
||||||
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'linux'",
|
|
||||||
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'linux'",
|
|
||||||
"(python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine != 'aarch64' and platform_system == 'Darwin' and sys_platform != 'darwin') or (python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_system == 'Darwin' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
|
||||||
"python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux'",
|
|
||||||
"(python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform != 'darwin') or (python_full_version >= '3.12' and python_full_version < '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
|
||||||
"python_full_version >= '3.12.4' and platform_system == 'Darwin' and sys_platform == 'darwin'",
|
|
||||||
"python_full_version >= '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'darwin'",
|
|
||||||
"(python_full_version >= '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform == 'darwin') or (python_full_version >= '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'darwin')",
|
|
||||||
"python_full_version >= '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Darwin' and sys_platform == 'linux'",
|
|
||||||
"python_full_version >= '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform == 'linux'",
|
|
||||||
"python_full_version >= '3.12.4' and platform_machine == 'aarch64' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'linux'",
|
|
||||||
"(python_full_version >= '3.12.4' and platform_machine != 'aarch64' and platform_system == 'Darwin' and sys_platform != 'darwin') or (python_full_version >= '3.12.4' and platform_system == 'Darwin' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
|
||||||
"python_full_version >= '3.12.4' and platform_machine == 'aarch64' and platform_system == 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux'",
|
|
||||||
"(python_full_version >= '3.12.4' and platform_machine != 'aarch64' and platform_system != 'Darwin' and sys_platform != 'darwin') or (python_full_version >= '3.12.4' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -333,7 +310,7 @@ name = "build"
|
|||||||
version = "1.2.2.post1"
|
version = "1.2.2.post1"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "colorama", marker = "os_name == 'nt'" },
|
{ name = "colorama", marker = "(os_name == 'nt' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name == 'nt' and sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
{ name = "importlib-metadata", marker = "python_full_version < '3.10.2'" },
|
{ name = "importlib-metadata", marker = "python_full_version < '3.10.2'" },
|
||||||
{ name = "packaging" },
|
{ name = "packaging" },
|
||||||
{ name = "pyproject-hooks" },
|
{ name = "pyproject-hooks" },
|
||||||
@@ -568,7 +545,7 @@ name = "click"
|
|||||||
version = "8.1.8"
|
version = "8.1.8"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "colorama", marker = "platform_system == 'Windows'" },
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593 }
|
sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593 }
|
||||||
wheels = [
|
wheels = [
|
||||||
@@ -625,7 +602,6 @@ dependencies = [
|
|||||||
{ name = "appdirs" },
|
{ name = "appdirs" },
|
||||||
{ name = "auth0-python" },
|
{ name = "auth0-python" },
|
||||||
{ name = "blinker" },
|
{ name = "blinker" },
|
||||||
{ name = "chromadb" },
|
|
||||||
{ name = "click" },
|
{ name = "click" },
|
||||||
{ name = "instructor" },
|
{ name = "instructor" },
|
||||||
{ name = "json-repair" },
|
{ name = "json-repair" },
|
||||||
@@ -651,6 +627,9 @@ dependencies = [
|
|||||||
agentops = [
|
agentops = [
|
||||||
{ name = "agentops" },
|
{ name = "agentops" },
|
||||||
]
|
]
|
||||||
|
chromadb = [
|
||||||
|
{ name = "chromadb" },
|
||||||
|
]
|
||||||
docling = [
|
docling = [
|
||||||
{ name = "docling" },
|
{ name = "docling" },
|
||||||
]
|
]
|
||||||
@@ -701,7 +680,7 @@ requires-dist = [
|
|||||||
{ name = "appdirs", specifier = ">=1.4.4" },
|
{ name = "appdirs", specifier = ">=1.4.4" },
|
||||||
{ name = "auth0-python", specifier = ">=4.7.1" },
|
{ name = "auth0-python", specifier = ">=4.7.1" },
|
||||||
{ name = "blinker", specifier = ">=1.9.0" },
|
{ name = "blinker", specifier = ">=1.9.0" },
|
||||||
{ name = "chromadb", specifier = ">=0.5.23" },
|
{ name = "chromadb", marker = "extra == 'chromadb'", specifier = ">=0.5.23" },
|
||||||
{ name = "click", specifier = ">=8.1.7" },
|
{ name = "click", specifier = ">=8.1.7" },
|
||||||
{ name = "crewai-tools", marker = "extra == 'tools'", specifier = ">=0.37.0" },
|
{ name = "crewai-tools", marker = "extra == 'tools'", specifier = ">=0.37.0" },
|
||||||
{ name = "docling", marker = "extra == 'docling'", specifier = ">=2.12.0" },
|
{ name = "docling", marker = "extra == 'docling'", specifier = ">=2.12.0" },
|
||||||
@@ -2500,7 +2479,7 @@ version = "1.6.1"
|
|||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "click" },
|
{ name = "click" },
|
||||||
{ name = "colorama", marker = "platform_system == 'Windows'" },
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||||
{ name = "ghp-import" },
|
{ name = "ghp-import" },
|
||||||
{ name = "jinja2" },
|
{ name = "jinja2" },
|
||||||
{ name = "markdown" },
|
{ name = "markdown" },
|
||||||
@@ -2681,7 +2660,7 @@ version = "2.10.2"
|
|||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "pygments" },
|
{ name = "pygments" },
|
||||||
{ name = "pywin32", marker = "platform_system == 'Windows'" },
|
{ name = "pywin32", marker = "sys_platform == 'win32'" },
|
||||||
{ name = "tqdm" },
|
{ name = "tqdm" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/3a/93/80ac75c20ce54c785648b4ed363c88f148bf22637e10c9863db4fbe73e74/mpire-2.10.2.tar.gz", hash = "sha256:f66a321e93fadff34585a4bfa05e95bd946cf714b442f51c529038eb45773d97", size = 271270 }
|
sdist = { url = "https://files.pythonhosted.org/packages/3a/93/80ac75c20ce54c785648b4ed363c88f148bf22637e10c9863db4fbe73e74/mpire-2.10.2.tar.gz", hash = "sha256:f66a321e93fadff34585a4bfa05e95bd946cf714b442f51c529038eb45773d97", size = 271270 }
|
||||||
@@ -2928,7 +2907,7 @@ name = "nvidia-cudnn-cu12"
|
|||||||
version = "9.1.0.70"
|
version = "9.1.0.70"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and platform_system != 'Darwin') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'linux')" },
|
{ name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
]
|
]
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/9f/fd/713452cd72343f682b1c7b9321e23829f00b842ceaedcda96e742ea0b0b3/nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl", hash = "sha256:165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f", size = 664752741 },
|
{ url = "https://files.pythonhosted.org/packages/9f/fd/713452cd72343f682b1c7b9321e23829f00b842ceaedcda96e742ea0b0b3/nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl", hash = "sha256:165764f44ef8c61fcdfdfdbe769d687e06374059fbb388b6c89ecb0e28793a6f", size = 664752741 },
|
||||||
@@ -2955,9 +2934,9 @@ name = "nvidia-cusolver-cu12"
|
|||||||
version = "11.4.5.107"
|
version = "11.4.5.107"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and platform_system != 'Darwin') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'linux')" },
|
{ name = "nvidia-cublas-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
{ name = "nvidia-cusparse-cu12", marker = "(platform_machine != 'aarch64' and platform_system != 'Darwin') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'linux')" },
|
{ name = "nvidia-cusparse-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and platform_system != 'Darwin') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'linux')" },
|
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
]
|
]
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/bc/1d/8de1e5c67099015c834315e333911273a8c6aaba78923dd1d1e25fc5f217/nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl", hash = "sha256:8a7ec542f0412294b15072fa7dab71d31334014a69f953004ea7a118206fe0dd", size = 124161928 },
|
{ url = "https://files.pythonhosted.org/packages/bc/1d/8de1e5c67099015c834315e333911273a8c6aaba78923dd1d1e25fc5f217/nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl", hash = "sha256:8a7ec542f0412294b15072fa7dab71d31334014a69f953004ea7a118206fe0dd", size = 124161928 },
|
||||||
@@ -2968,7 +2947,7 @@ name = "nvidia-cusparse-cu12"
|
|||||||
version = "12.1.0.106"
|
version = "12.1.0.106"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and platform_system != 'Darwin') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'linux')" },
|
{ name = "nvidia-nvjitlink-cu12", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
]
|
]
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/65/5b/cfaeebf25cd9fdec14338ccb16f6b2c4c7fa9163aefcf057d86b9cc248bb/nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:f3b50f42cf363f86ab21f720998517a659a48131e8d538dc02f8768237bd884c", size = 195958278 },
|
{ url = "https://files.pythonhosted.org/packages/65/5b/cfaeebf25cd9fdec14338ccb16f6b2c4c7fa9163aefcf057d86b9cc248bb/nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl", hash = "sha256:f3b50f42cf363f86ab21f720998517a659a48131e8d538dc02f8768237bd884c", size = 195958278 },
|
||||||
@@ -3506,7 +3485,7 @@ name = "portalocker"
|
|||||||
version = "2.10.1"
|
version = "2.10.1"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "pywin32", marker = "platform_system == 'Windows'" },
|
{ name = "pywin32", marker = "sys_platform == 'win32'" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/ed/d3/c6c64067759e87af98cc668c1cc75171347d0f1577fab7ca3749134e3cd4/portalocker-2.10.1.tar.gz", hash = "sha256:ef1bf844e878ab08aee7e40184156e1151f228f103aa5c6bd0724cc330960f8f", size = 40891 }
|
sdist = { url = "https://files.pythonhosted.org/packages/ed/d3/c6c64067759e87af98cc668c1cc75171347d0f1577fab7ca3749134e3cd4/portalocker-2.10.1.tar.gz", hash = "sha256:ef1bf844e878ab08aee7e40184156e1151f228f103aa5c6bd0724cc330960f8f", size = 40891 }
|
||||||
wheels = [
|
wheels = [
|
||||||
@@ -5019,19 +4998,19 @@ dependencies = [
|
|||||||
{ name = "fsspec" },
|
{ name = "fsspec" },
|
||||||
{ name = "jinja2" },
|
{ name = "jinja2" },
|
||||||
{ name = "networkx" },
|
{ name = "networkx" },
|
||||||
{ name = "nvidia-cublas-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cublas-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cuda-cupti-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cuda-cupti-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cuda-nvrtc-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cuda-nvrtc-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cuda-runtime-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cuda-runtime-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cudnn-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cudnn-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cufft-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cufft-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-curand-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-curand-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cusolver-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cusolver-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-cusparse-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-cusparse-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-nccl-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-nccl-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "nvidia-nvtx-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "nvidia-nvtx-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "sympy" },
|
{ name = "sympy" },
|
||||||
{ name = "triton", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" },
|
{ name = "triton", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" },
|
||||||
{ name = "typing-extensions" },
|
{ name = "typing-extensions" },
|
||||||
]
|
]
|
||||||
wheels = [
|
wheels = [
|
||||||
@@ -5078,7 +5057,7 @@ name = "tqdm"
|
|||||||
version = "4.66.5"
|
version = "4.66.5"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "colorama", marker = "platform_system == 'Windows'" },
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||||
]
|
]
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/58/83/6ba9844a41128c62e810fddddd72473201f3eacde02046066142a2d96cc5/tqdm-4.66.5.tar.gz", hash = "sha256:e1020aef2e5096702d8a025ac7d16b1577279c9d63f8375b63083e9a5f0fcbad", size = 169504 }
|
sdist = { url = "https://files.pythonhosted.org/packages/58/83/6ba9844a41128c62e810fddddd72473201f3eacde02046066142a2d96cc5/tqdm-4.66.5.tar.gz", hash = "sha256:e1020aef2e5096702d8a025ac7d16b1577279c9d63f8375b63083e9a5f0fcbad", size = 169504 }
|
||||||
wheels = [
|
wheels = [
|
||||||
@@ -5120,7 +5099,7 @@ name = "triton"
|
|||||||
version = "3.0.0"
|
version = "3.0.0"
|
||||||
source = { registry = "https://pypi.org/simple" }
|
source = { registry = "https://pypi.org/simple" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "filelock", marker = "(platform_machine != 'aarch64' and platform_system != 'Darwin') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform != 'linux')" },
|
{ name = "filelock", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
|
||||||
]
|
]
|
||||||
wheels = [
|
wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/45/27/14cc3101409b9b4b9241d2ba7deaa93535a217a211c86c4cc7151fb12181/triton-3.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e1efef76935b2febc365bfadf74bcb65a6f959a9872e5bddf44cc9e0adce1e1a", size = 209376304 },
|
{ url = "https://files.pythonhosted.org/packages/45/27/14cc3101409b9b4b9241d2ba7deaa93535a217a211c86c4cc7151fb12181/triton-3.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e1efef76935b2febc365bfadf74bcb65a6f959a9872e5bddf44cc9e0adce1e1a", size = 209376304 },
|
||||||
|
|||||||
Reference in New Issue
Block a user