Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SeeknnDestroy committed Oct 16, 2023
1 parent 1d863b4 commit 9e47f6c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions autollm/utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from llama_index import Document, StorageContext, VectorStoreIndex
from llama_index.vector_stores import PineconeVectorStore, QdrantVectorStore
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams

from autollm.auto.vector_store_index import AutoVectorStoreIndex
from autollm.utils.constants import DEFAULT_INDEX_NAME
Expand All @@ -29,9 +27,14 @@ def initialize_pinecone_index(


def initialize_qdrant_index(index_name: str, size: int = 1536, distance: str = 'EUCLID'):
"""Initialize Qdrant index."""
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams

# Initialize client
url = read_env_variable('QDRANT_URL')
api_key = read_env_variable('QDRANT_API_KEY')

client = QdrantClient(url=url, api_key=api_key)

# Convert string distance measure to Distance Enum equals to Distance.EUCLID
Expand All @@ -45,6 +48,7 @@ def initialize_qdrant_index(index_name: str, size: int = 1536, distance: str = '
def connect_vectorstore(vector_store, **params):
"""Connect to an existing vector store."""
import pinecone
from qdrant_client import QdrantClient

# Logic to connect to vector store based on the specific type of vector store
if isinstance(vector_store, PineconeVectorStore):
Expand Down

0 comments on commit 9e47f6c

Please sign in to comment.