|
14 | 14 | from dotenv import load_dotenv |
15 | 15 | from langfuse.langchain import CallbackHandler |
16 | 16 |
|
17 | | -import wiki_rag.index as index |
| 17 | +import wiki_rag.vector as vector |
18 | 18 |
|
19 | 19 | from wiki_rag import LOG_LEVEL, ROOT_DIR, __version__, server |
20 | 20 | from wiki_rag.search.util import ContextSchema, build_graph |
21 | 21 | from wiki_rag.util import setup_logging |
| 22 | +from wiki_rag.vector import load_vector_store |
22 | 23 |
|
23 | 24 |
|
24 | 25 | def main(): |
@@ -69,10 +70,10 @@ def main(): |
69 | 70 | sys.exit(1) |
70 | 71 | # TODO: Validate that only numbers, letters and underscores are used. |
71 | 72 |
|
72 | | - index.milvus_url = os.getenv("MILVUS_URL") |
73 | | - if not index.milvus_url: |
74 | | - logger.error("Milvus URL not found in environment. Exiting.") |
75 | | - sys.exit(1) |
| 73 | + index_vendor = os.getenv("INDEX_VENDOR") |
| 74 | + if not index_vendor: |
| 75 | + logger.warning("Index vendor (INDEX_VENDOR) not found in environment. Defaulting to 'milvus'.") |
| 76 | + index_vendor = "milvus" |
76 | 77 |
|
77 | 78 | # If LangSmith tracing is enabled, put a name for the project and verify that all required env vars are set. |
78 | 79 | if os.getenv("LANGSMITH_TRACING", "false") == "true": |
@@ -141,6 +142,8 @@ def main(): |
141 | 142 |
|
142 | 143 | contextualisation_model = os.getenv("CONTEXTUALISATION_MODEL") |
143 | 144 |
|
| 145 | + vector.store = load_vector_store(index_vendor) # Set up the global wiki_rag.vector.store to be used elsewhere. |
| 146 | + |
144 | 147 | wrapper_api_base = os.getenv("WRAPPER_API_BASE") |
145 | 148 | if not wrapper_api_base: |
146 | 149 | logger.error("Wrapper API base not found in environment. Exiting.") |
|
0 commit comments