mirror of
https://github.com/open-webui/open-webui
synced 2025-03-04 11:29:59 +00:00
refac: conditional import of chromadb
This commit is contained in:
parent
6fedd72e39
commit
b52a7e3543
@ -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,6 +1496,8 @@ Ensure that the tools are effectively utilized to achieve the highest-quality an
|
||||
VECTOR_DB = os.environ.get("VECTOR_DB", "chroma")
|
||||
|
||||
# Chroma
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user