@@ -89,7 +89,7 @@ def __init__(self):
8989
9090 # prompting wrapper
9191 @property
92- def chat (self ):
92+ def chat (self ) -> ChatOpenAI :
9393 """ChatOpenAI lazy read-only property."""
9494 if self ._chat is None :
9595 self ._chat = ChatOpenAI (
@@ -104,7 +104,7 @@ def chat(self):
104104
105105 # embeddings
106106 @property
107- def openai_embeddings (self ):
107+ def openai_embeddings (self ) -> OpenAIEmbeddings :
108108 """OpenAIEmbeddings lazy read-only property."""
109109 if self ._openai_embeddings is None :
110110 self ._openai_embeddings = OpenAIEmbeddings (
@@ -113,14 +113,14 @@ def openai_embeddings(self):
113113 return self ._openai_embeddings
114114
115115 @property
116- def pinecone_index (self ):
116+ def pinecone_index (self ) -> pinecone . Index :
117117 """pinecone.Index lazy read-only property."""
118118 if self ._pinecone_index is None :
119119 self ._pinecone_index = pinecone .Index (index_name = Config .PINECONE_INDEX_NAME )
120120 return self ._pinecone_index
121121
122122 @property
123- def vector_store (self ):
123+ def vector_store (self ) -> Pinecone :
124124 """Pinecone lazy read-only property."""
125125 if self ._vector_store is None :
126126 self ._vector_store = Pinecone (
@@ -131,14 +131,14 @@ def vector_store(self):
131131 return self ._vector_store
132132
133133 @property
134- def text_splitter (self ):
134+ def text_splitter (self ) -> TextSplitter :
135135 """TextSplitter lazy read-only property."""
136136 if self ._text_splitter is None :
137137 self ._text_splitter = TextSplitter ()
138138 return self ._text_splitter
139139
140140 @property
141- def bm25_encoder (self ):
141+ def bm25_encoder (self ) -> BM25Encoder :
142142 """BM25Encoder lazy read-only property."""
143143 if self ._b25_encoder is None :
144144 self ._b25_encoder = BM25Encoder ().default ()
@@ -193,7 +193,10 @@ def load(self, filepath: str):
193193 }
194194 logging .debug ("Creating index. This may take a few minutes..." )
195195 pinecone .create_index (
196- Config .PINECONE_INDEX_NAME , dimension = 1536 , metric = "dotproduct" , metadata_config = metadata_config
196+ Config .PINECONE_INDEX_NAME ,
197+ dimension = Config .PINECONE_DIMENSIONS ,
198+ metric = Config .PINECONE_METRIC ,
199+ metadata_config = metadata_config ,
197200 )
198201
199202 pdf_files = glob .glob (os .path .join (filepath , "*.pdf" ))
0 commit comments