@@ -111,6 +111,7 @@ export const pineconeIndexerRef = (params: {
111
111
PINECONE_API_KEY. If not set, the PINECONE_API_KEY environment variable will
112
112
be used instead.
113
113
* @param params.indexId The name of the index
114
+ * @param params.indexHostUrl The host url for the index. If not set, only indexId will be used to target the index
114
115
* @param params.embedder The embedder to use for the indexer and retriever
115
116
* @param params.embedderOptions Options to customize the embedder
116
117
* @returns The Pinecone Genkit plugin
@@ -119,6 +120,7 @@ export function pinecone<EmbedderCustomOptions extends z.ZodTypeAny>(
119
120
params : {
120
121
clientParams ?: PineconeConfiguration ;
121
122
indexId : string ;
123
+ indexHostUrl ?: string ;
122
124
contentKey ?: string ;
123
125
embedder : EmbedderArgument < EmbedderCustomOptions > ;
124
126
embedderOptions ?: z . infer < EmbedderCustomOptions > ;
@@ -137,6 +139,7 @@ export default pinecone;
137
139
* @param ai A Genkit instance
138
140
* @param params The params for the retriever
139
141
* @param params.indexId The name of the retriever
142
+ * @param params.indexHostUrl The host url for the index. If not set, only the indexId will be used to target the index
140
143
* @param params.clientParams PineconeConfiguration containing the
141
144
PINECONE_API_KEY. If not set, the PINECONE_API_KEY environment variable will
142
145
be used instead.
@@ -153,6 +156,7 @@ export function configurePineconeRetriever<
153
156
ai : Genkit ,
154
157
params : {
155
158
indexId : string ;
159
+ indexHostUrl ?: string ;
156
160
clientParams ?: PineconeConfiguration ;
157
161
/**
158
162
* @deprecated use contentKey instead.
@@ -163,13 +167,13 @@ export function configurePineconeRetriever<
163
167
embedderOptions ?: z . infer < EmbedderCustomOptions > ;
164
168
}
165
169
) {
166
- const { indexId, embedder, embedderOptions } = {
170
+ const { indexId, indexHostUrl , embedder, embedderOptions } = {
167
171
...params ,
168
172
} ;
169
173
const pineconeConfig = params . clientParams ?? getDefaultConfig ( ) ;
170
174
const contentKey = params . contentKey ?? params . textKey ?? CONTENT_KEY ;
171
175
const pinecone = new Pinecone ( pineconeConfig ) ;
172
- const index = pinecone . index ( indexId ) ;
176
+ const index = pinecone . index ( indexId , indexHostUrl ) ;
173
177
174
178
return ai . defineRetriever (
175
179
{
@@ -216,6 +220,7 @@ export function configurePineconeRetriever<
216
220
* @param ai A Genkit instance
217
221
* @param params The params for the indexer
218
222
* @param params.indexId The name of the indexer
223
+ * @param params.indexHostUrl The host url for the index. If not set, only the indexId will be used to target the index
219
224
* @param params.clientParams PineconeConfiguration containing the
220
225
PINECONE_API_KEY. If not set, the PINECONE_API_KEY environment variable will
221
226
be used instead.
@@ -232,6 +237,7 @@ export function configurePineconeIndexer<
232
237
ai : Genkit ,
233
238
params : {
234
239
indexId : string ;
240
+ indexHostUrl ?: string ;
235
241
clientParams ?: PineconeConfiguration ;
236
242
/**
237
243
* @deprecated use contentKey instead.
@@ -242,13 +248,13 @@ export function configurePineconeIndexer<
242
248
embedderOptions ?: z . infer < EmbedderCustomOptions > ;
243
249
}
244
250
) {
245
- const { indexId, embedder, embedderOptions } = {
251
+ const { indexId, indexHostUrl , embedder, embedderOptions } = {
246
252
...params ,
247
253
} ;
248
254
const pineconeConfig = params . clientParams ?? getDefaultConfig ( ) ;
249
255
const contentKey = params . contentKey ?? params . textKey ?? CONTENT_KEY ;
250
256
const pinecone = new Pinecone ( pineconeConfig ) ;
251
- const index = pinecone . index ( indexId ) ;
257
+ const index = pinecone . index ( indexId , indexHostUrl ) ;
252
258
253
259
return ai . defineIndexer (
254
260
{
0 commit comments