AI-ANK commited on
Commit
d998065
1 Parent(s): a53bc87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -254,12 +254,10 @@ def generate_code_snippet(llm_choice, embed_model_choice, node_parser_choice, re
254
  code_snippet += f"response_mode = '{response_mode}'\n\n"
255
 
256
  # Vector store initialization
257
- if vector_store_choice == "Faiss":
258
- code_snippet += "d = 1536\n"
259
- code_snippet += "faiss_index = faiss.IndexFlatL2(d)\n"
260
- code_snippet += "vector_store = FaissVectorStore(faiss_index=faiss_index)\n"
261
- elif vector_store_choice == "Milvus":
262
- code_snippet += "vector_store = MilvusVectorStore(dim=1536, overwrite=True)\n"
263
  elif vector_store_choice == "Qdrant":
264
  code_snippet += "client = qdrant_client.QdrantClient(location=':memory:')\n"
265
  code_snippet += "vector_store = QdrantVectorStore(client=client, collection_name='sampledata')\n"
 
254
  code_snippet += f"response_mode = '{response_mode}'\n\n"
255
 
256
  # Vector store initialization
257
+ if vector_store_choice == "Pinecone":
258
+ code_snippet += "pc = Pinecone(api_key=os.environ['PINECONE_API_KEY'])\n"
259
+ code_snippet += "index = pc.Index('test')\n"
260
+ code_snippet += "vector_store = PineconeVectorStore(pinecone_index=index)\n"
 
 
261
  elif vector_store_choice == "Qdrant":
262
  code_snippet += "client = qdrant_client.QdrantClient(location=':memory:')\n"
263
  code_snippet += "vector_store = QdrantVectorStore(client=client, collection_name='sampledata')\n"