Skip to content
Snippets Groups Projects
Commit 22f98399 authored by James Briggs's avatar James Briggs
Browse files

fix: optimize init logic for pinecone index

parent c0cce859
No related branches found
No related tags found
No related merge requests found
......@@ -397,7 +397,9 @@ class BaseRouter(BaseModel):
self.index.dimensions = dims
# now init index
if isinstance(self.index, PineconeIndex):
self.index.index = self.index._init_index(force_create=True)
# no need to init index if already initialized
if self.index.index is None:
self.index.index = self.index._init_index(force_create=True)
# run auto sync if active
if self.auto_sync:
local_utterances = self.to_config().to_utterances()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment