mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Add interactive Qdrant client installation prompt
This commit is contained in:
@@ -82,6 +82,21 @@ class QdrantVectorSearchTool(BaseTool):
|
|||||||
url=self.qdrant_url,
|
url=self.qdrant_url,
|
||||||
api_key=self.qdrant_api_key,
|
api_key=self.qdrant_api_key,
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
import click
|
||||||
|
|
||||||
|
if click.confirm(
|
||||||
|
"The 'qdrant-client' package is required to use the QdrantVectorSearchTool. "
|
||||||
|
"Would you like to install it?"
|
||||||
|
):
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
subprocess.run(["uv", "add", "qdrant-client"], check=True)
|
||||||
|
else:
|
||||||
|
raise ImportError(
|
||||||
|
"The 'qdrant-client' package is required to use the QdrantVectorSearchTool. "
|
||||||
|
"Please install it with: uv add qdrant-client"
|
||||||
|
)
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
self,
|
self,
|
||||||
@@ -103,11 +118,6 @@ class QdrantVectorSearchTool(BaseTool):
|
|||||||
ImportError: If qdrant-client is not installed
|
ImportError: If qdrant-client is not installed
|
||||||
ValueError: If Qdrant credentials are missing
|
ValueError: If Qdrant credentials are missing
|
||||||
"""
|
"""
|
||||||
if not QDRANT_AVAILABLE:
|
|
||||||
raise ImportError(
|
|
||||||
"The 'qdrant-client' package is required to use the QdrantVectorSearchTool. "
|
|
||||||
"Please install it with: pip install qdrant-client"
|
|
||||||
)
|
|
||||||
|
|
||||||
if not self.qdrant_url:
|
if not self.qdrant_url:
|
||||||
raise ValueError("QDRANT_URL is not set")
|
raise ValueError("QDRANT_URL is not set")
|
||||||
|
|||||||
Reference in New Issue
Block a user