Update app.py
Browse files
app.py
CHANGED
@@ -189,16 +189,16 @@ from pinecone import Pinecone
|
|
189 |
pc = Pinecone(api_key=pinecone_api_key)
|
190 |
|
191 |
|
192 |
-
#
|
193 |
-
|
194 |
|
195 |
-
#
|
196 |
-
|
197 |
-
|
198 |
|
199 |
-
#
|
200 |
-
|
201 |
-
|
202 |
|
203 |
# def ask_with_memory(vector_store, query, chat_history=[]):
|
204 |
# from langchain_openai import ChatOpenAI
|
|
|
189 |
pc = Pinecone(api_key=pinecone_api_key)
|
190 |
|
191 |
|
192 |
+
# Define the name of the Pinecone index
|
193 |
+
index_name = 'mimtssinkqa'
|
194 |
|
195 |
+
# Initialize the OpenAI embeddings object
|
196 |
+
from langchain_openai import OpenAIEmbeddings
|
197 |
+
embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)
|
198 |
|
199 |
+
# LOAD VECTOR STORE FROM EXISTING INDEX
|
200 |
+
from langchain_community.vectorstores import Pinecone
|
201 |
+
vector_store = Pinecone.from_existing_index(index_name='mimtssinkqa', embedding=embeddings)
|
202 |
|
203 |
# def ask_with_memory(vector_store, query, chat_history=[]):
|
204 |
# from langchain_openai import ChatOpenAI
|