|
@@ -9,7 +9,6 @@ from pathlib import Path
|
|
|
from typing import Generic, Optional, TypeVar
|
|
|
from urllib.parse import urlparse
|
|
|
|
|
|
-import chromadb
|
|
|
import requests
|
|
|
from pydantic import BaseModel
|
|
|
from sqlalchemy import JSON, Column, DateTime, Integer, func
|
|
@@ -1497,22 +1496,24 @@ Ensure that the tools are effectively utilized to achieve the highest-quality an
|
|
|
VECTOR_DB = os.environ.get("VECTOR_DB", "chroma")
|
|
|
|
|
|
# Chroma
|
|
|
-CHROMA_DATA_PATH = f"{DATA_DIR}/vector_db"
|
|
|
-CHROMA_TENANT = os.environ.get("CHROMA_TENANT", chromadb.DEFAULT_TENANT)
|
|
|
-CHROMA_DATABASE = os.environ.get("CHROMA_DATABASE", chromadb.DEFAULT_DATABASE)
|
|
|
-CHROMA_HTTP_HOST = os.environ.get("CHROMA_HTTP_HOST", "")
|
|
|
-CHROMA_HTTP_PORT = int(os.environ.get("CHROMA_HTTP_PORT", "8000"))
|
|
|
-CHROMA_CLIENT_AUTH_PROVIDER = os.environ.get("CHROMA_CLIENT_AUTH_PROVIDER", "")
|
|
|
-CHROMA_CLIENT_AUTH_CREDENTIALS = os.environ.get("CHROMA_CLIENT_AUTH_CREDENTIALS", "")
|
|
|
-# Comma-separated list of header=value pairs
|
|
|
-CHROMA_HTTP_HEADERS = os.environ.get("CHROMA_HTTP_HEADERS", "")
|
|
|
-if CHROMA_HTTP_HEADERS:
|
|
|
- CHROMA_HTTP_HEADERS = dict(
|
|
|
- [pair.split("=") for pair in CHROMA_HTTP_HEADERS.split(",")]
|
|
|
- )
|
|
|
-else:
|
|
|
- CHROMA_HTTP_HEADERS = None
|
|
|
-CHROMA_HTTP_SSL = os.environ.get("CHROMA_HTTP_SSL", "false").lower() == "true"
|
|
|
+if VECTOR_DB == "chroma":
|
|
|
+ import chromadb
|
|
|
+ CHROMA_DATA_PATH = f"{DATA_DIR}/vector_db"
|
|
|
+ CHROMA_TENANT = os.environ.get("CHROMA_TENANT", chromadb.DEFAULT_TENANT)
|
|
|
+ CHROMA_DATABASE = os.environ.get("CHROMA_DATABASE", chromadb.DEFAULT_DATABASE)
|
|
|
+ CHROMA_HTTP_HOST = os.environ.get("CHROMA_HTTP_HOST", "")
|
|
|
+ CHROMA_HTTP_PORT = int(os.environ.get("CHROMA_HTTP_PORT", "8000"))
|
|
|
+ CHROMA_CLIENT_AUTH_PROVIDER = os.environ.get("CHROMA_CLIENT_AUTH_PROVIDER", "")
|
|
|
+ CHROMA_CLIENT_AUTH_CREDENTIALS = os.environ.get("CHROMA_CLIENT_AUTH_CREDENTIALS", "")
|
|
|
+ # Comma-separated list of header=value pairs
|
|
|
+ CHROMA_HTTP_HEADERS = os.environ.get("CHROMA_HTTP_HEADERS", "")
|
|
|
+ if CHROMA_HTTP_HEADERS:
|
|
|
+ CHROMA_HTTP_HEADERS = dict(
|
|
|
+ [pair.split("=") for pair in CHROMA_HTTP_HEADERS.split(",")]
|
|
|
+ )
|
|
|
+ else:
|
|
|
+ CHROMA_HTTP_HEADERS = None
|
|
|
+ CHROMA_HTTP_SSL = os.environ.get("CHROMA_HTTP_SSL", "false").lower() == "true"
|
|
|
# this uses the model defined in the Dockerfile ENV variable. If you dont use docker or docker based deployments such as k8s, the default embedding model will be used (sentence-transformers/all-MiniLM-L6-v2)
|
|
|
|
|
|
# Milvus
|