broken imports
Browse files- config.py +1 -5
- magic/vectordb.py +0 -13
config.py
CHANGED
|
@@ -15,7 +15,6 @@ from langchain.vectorstores import Pinecone
|
|
| 15 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 16 |
|
| 17 |
from magic.prompts import PROMPT, EXAMPLE_PROMPT
|
| 18 |
-
from magic.vectordb import VectorIndex
|
| 19 |
from magic.self_query_retriever import SelfQueryRetriever
|
| 20 |
|
| 21 |
from utils import get_courses
|
|
@@ -38,7 +37,7 @@ def set_openai_key(key):
|
|
| 38 |
|
| 39 |
class State:
|
| 40 |
settings: Settings
|
| 41 |
-
store: Pinecone
|
| 42 |
chain: RetrievalQAWithSourcesChain
|
| 43 |
courses: list
|
| 44 |
|
|
@@ -49,9 +48,6 @@ class State:
|
|
| 49 |
|
| 50 |
# OPENAI
|
| 51 |
set_openai_key(self.settings.OPENAI_API_KEY)
|
| 52 |
-
|
| 53 |
-
# LOCAL VECTORSTORE
|
| 54 |
-
# self.store: VectorIndex = VectorIndex()
|
| 55 |
|
| 56 |
# PINECONE VECTORSTORE
|
| 57 |
embeddings = OpenAIEmbeddings()
|
|
|
|
| 15 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 16 |
|
| 17 |
from magic.prompts import PROMPT, EXAMPLE_PROMPT
|
|
|
|
| 18 |
from magic.self_query_retriever import SelfQueryRetriever
|
| 19 |
|
| 20 |
from utils import get_courses
|
|
|
|
| 37 |
|
| 38 |
class State:
|
| 39 |
settings: Settings
|
| 40 |
+
store: Pinecone
|
| 41 |
chain: RetrievalQAWithSourcesChain
|
| 42 |
courses: list
|
| 43 |
|
|
|
|
| 48 |
|
| 49 |
# OPENAI
|
| 50 |
set_openai_key(self.settings.OPENAI_API_KEY)
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
# PINECONE VECTORSTORE
|
| 53 |
embeddings = OpenAIEmbeddings()
|
magic/vectordb.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
import logging
|
| 2 |
-
logger = logging.getLogger()
|
| 3 |
-
import os
|
| 4 |
-
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 5 |
-
from langchain.vectorstores import Chroma
|
| 6 |
-
from ingest import PERSIST_DIR
|
| 7 |
-
|
| 8 |
-
embedding = OpenAIEmbeddings()
|
| 9 |
-
class VectorIndex(Chroma):
|
| 10 |
-
def __init__(self):
|
| 11 |
-
if len(os.listdir(PERSIST_DIR)) < 2: # check if there are files in the directory
|
| 12 |
-
logger.error(f"VectorIndex: No files in {PERSIST_DIR}, have you run ingest.py?")
|
| 13 |
-
super().__init__(persist_directory=PERSIST_DIR, embedding_function=embedding)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|