Spaces:
Sleeping
Sleeping
Update connections/pinecone.py
Browse files- connections/pinecone.py +5 -4
connections/pinecone.py
CHANGED
@@ -25,7 +25,7 @@ class PineconeConnector:
|
|
25 |
pc = PineconeGRPC(api_key=self.pinecone_api_key)
|
26 |
return pc
|
27 |
|
28 |
-
def create_pipeline(self): # , namespace
|
29 |
"""Create a pipeline given an index name"""
|
30 |
# Create your index if index does not exist
|
31 |
indexes = [i.name for i in self.pc.list_indexes()]
|
@@ -46,7 +46,8 @@ class PineconeConnector:
|
|
46 |
pinecone_index = self.pc.Index(self.vector_db)
|
47 |
|
48 |
# Initialize VectorStore
|
49 |
-
vector_store = PineconeVectorStore(pinecone_index=pinecone_index
|
|
|
50 |
|
51 |
# create pipeline (abstracts away the need to adaptively process and batch)
|
52 |
pipeline = IngestionPipeline(
|
@@ -64,9 +65,9 @@ class PineconeConnector:
|
|
64 |
|
65 |
return pipeline
|
66 |
|
67 |
-
def run(self): #
|
68 |
"""creates the pipeline, returns the connection and the embedder."""
|
69 |
-
pipeline = self.create_pipeline() # namespace
|
70 |
return {
|
71 |
"connection": self.pc,
|
72 |
"pipeline": pipeline,
|
|
|
25 |
pc = PineconeGRPC(api_key=self.pinecone_api_key)
|
26 |
return pc
|
27 |
|
28 |
+
def create_pipeline(self, namespace): # , namespace
|
29 |
"""Create a pipeline given an index name"""
|
30 |
# Create your index if index does not exist
|
31 |
indexes = [i.name for i in self.pc.list_indexes()]
|
|
|
46 |
pinecone_index = self.pc.Index(self.vector_db)
|
47 |
|
48 |
# Initialize VectorStore
|
49 |
+
vector_store = PineconeVectorStore(pinecone_index=pinecone_index,
|
50 |
+
namespace=namespace)
|
51 |
|
52 |
# create pipeline (abstracts away the need to adaptively process and batch)
|
53 |
pipeline = IngestionPipeline(
|
|
|
65 |
|
66 |
return pipeline
|
67 |
|
68 |
+
def run(self, namespace): #
|
69 |
"""creates the pipeline, returns the connection and the embedder."""
|
70 |
+
pipeline = self.create_pipeline(namespace) # namespace
|
71 |
return {
|
72 |
"connection": self.pc,
|
73 |
"pipeline": pipeline,
|