fix vectorstore use
Browse files- app.py +4 -4
- climateqa/engine/chains/retrieve_documents.py +2 -2
app.py
CHANGED
@@ -7,7 +7,7 @@ from azure.storage.fileshare import ShareServiceClient
|
|
7 |
# Import custom modules
|
8 |
from climateqa.engine.embeddings import get_embeddings_function
|
9 |
from climateqa.engine.llm import get_llm
|
10 |
-
from climateqa.engine.vectorstore import
|
11 |
from climateqa.engine.reranker import get_reranker
|
12 |
from climateqa.engine.graph import make_graph_agent, make_graph_agent_poc
|
13 |
from climateqa.engine.chains.retrieve_papers import find_papers
|
@@ -67,9 +67,9 @@ user_id = create_user_id()
|
|
67 |
# Create vectorstore and retriever
|
68 |
embeddings_function = get_embeddings_function()
|
69 |
|
70 |
-
vectorstore =
|
71 |
-
vectorstore_graphs =
|
72 |
-
vectorstore_region =
|
73 |
|
74 |
|
75 |
llm = get_llm(provider="openai", max_tokens=1024, temperature=0.0)
|
|
|
7 |
# Import custom modules
|
8 |
from climateqa.engine.embeddings import get_embeddings_function
|
9 |
from climateqa.engine.llm import get_llm
|
10 |
+
from climateqa.engine.vectorstore import get_azure_search_vectorstore
|
11 |
from climateqa.engine.reranker import get_reranker
|
12 |
from climateqa.engine.graph import make_graph_agent, make_graph_agent_poc
|
13 |
from climateqa.engine.chains.retrieve_papers import find_papers
|
|
|
67 |
# Create vectorstore and retriever
|
68 |
embeddings_function = get_embeddings_function()
|
69 |
|
70 |
+
vectorstore = get_azure_search_vectorstore(embeddings=embeddings_function, index_name="climateqa-ipx")
|
71 |
+
vectorstore_graphs = get_azure_search_vectorstore(embeddings=embeddings_function, index_name="climateqa-owid", text_key="description")
|
72 |
+
vectorstore_region = get_azure_search_vectorstore(embeddings=embeddings_function, index_name="climateqa-v2")
|
73 |
|
74 |
|
75 |
llm = get_llm(provider="openai", max_tokens=1024, temperature=0.0)
|
climateqa/engine/chains/retrieve_documents.py
CHANGED
@@ -19,7 +19,7 @@ from ..llm import get_llm
|
|
19 |
from .prompts import retrieve_chapter_prompt_template
|
20 |
from langchain_core.prompts import ChatPromptTemplate
|
21 |
from langchain_core.output_parsers import StrOutputParser
|
22 |
-
from ..vectorstore import
|
23 |
from ..embeddings import get_embeddings_function
|
24 |
import ast
|
25 |
|
@@ -134,7 +134,7 @@ def get_ToCs(version: str) :
|
|
134 |
"version": version
|
135 |
}
|
136 |
embeddings_function = get_embeddings_function()
|
137 |
-
vectorstore =
|
138 |
tocs = vectorstore.similarity_search_with_score(query="",filter = filters_text)
|
139 |
|
140 |
# remove duplicates or almost duplicates
|
|
|
19 |
from .prompts import retrieve_chapter_prompt_template
|
20 |
from langchain_core.prompts import ChatPromptTemplate
|
21 |
from langchain_core.output_parsers import StrOutputParser
|
22 |
+
from ..vectorstore import get_azure_search_vectorstore
|
23 |
from ..embeddings import get_embeddings_function
|
24 |
import ast
|
25 |
|
|
|
134 |
"version": version
|
135 |
}
|
136 |
embeddings_function = get_embeddings_function()
|
137 |
+
vectorstore = get_azure_search_vectorstore(embeddings=embeddings_function, index_name="climateqa")
|
138 |
tocs = vectorstore.similarity_search_with_score(query="",filter = filters_text)
|
139 |
|
140 |
# remove duplicates or almost duplicates
|