@@ -89,7 +89,7 @@ def __init__(self):
89
89
90
90
# prompting wrapper
91
91
@property
92
- def chat (self ):
92
+ def chat (self ) -> ChatOpenAI :
93
93
"""ChatOpenAI lazy read-only property."""
94
94
if self ._chat is None :
95
95
self ._chat = ChatOpenAI (
@@ -104,7 +104,7 @@ def chat(self):
104
104
105
105
# embeddings
106
106
@property
107
- def openai_embeddings (self ):
107
+ def openai_embeddings (self ) -> OpenAIEmbeddings :
108
108
"""OpenAIEmbeddings lazy read-only property."""
109
109
if self ._openai_embeddings is None :
110
110
self ._openai_embeddings = OpenAIEmbeddings (
@@ -113,14 +113,14 @@ def openai_embeddings(self):
113
113
return self ._openai_embeddings
114
114
115
115
@property
116
- def pinecone_index (self ):
116
+ def pinecone_index (self ) -> pinecone . Index :
117
117
"""pinecone.Index lazy read-only property."""
118
118
if self ._pinecone_index is None :
119
119
self ._pinecone_index = pinecone .Index (index_name = Config .PINECONE_INDEX_NAME )
120
120
return self ._pinecone_index
121
121
122
122
@property
123
- def vector_store (self ):
123
+ def vector_store (self ) -> Pinecone :
124
124
"""Pinecone lazy read-only property."""
125
125
if self ._vector_store is None :
126
126
self ._vector_store = Pinecone (
@@ -131,14 +131,14 @@ def vector_store(self):
131
131
return self ._vector_store
132
132
133
133
@property
134
- def text_splitter (self ):
134
+ def text_splitter (self ) -> TextSplitter :
135
135
"""TextSplitter lazy read-only property."""
136
136
if self ._text_splitter is None :
137
137
self ._text_splitter = TextSplitter ()
138
138
return self ._text_splitter
139
139
140
140
@property
141
- def bm25_encoder (self ):
141
+ def bm25_encoder (self ) -> BM25Encoder :
142
142
"""BM25Encoder lazy read-only property."""
143
143
if self ._b25_encoder is None :
144
144
self ._b25_encoder = BM25Encoder ().default ()
@@ -193,7 +193,10 @@ def load(self, filepath: str):
193
193
}
194
194
logging .debug ("Creating index. This may take a few minutes..." )
195
195
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 ,
197
200
)
198
201
199
202
pdf_files = glob .glob (os .path .join (filepath , "*.pdf" ))
0 commit comments