@@ -75,7 +75,7 @@ var index = await pinecone.CreateIndexAsync(new CreateIndexRequest
7575 Serverless = new ServerlessSpec
7676 {
7777 Cloud = ServerlessSpecCloud .Aws ,
78- Region = " us-east-1"
78+ Region = " us-east-1" ,
7979 }
8080 },
8181 DeletionProtection = DeletionProtection .Enabled
@@ -104,7 +104,7 @@ var index = await pinecone.CreateIndexAsync(new CreateIndexRequest
104104 PodType = " p1.x1" ,
105105 Pods = 1 ,
106106 Replicas = 1 ,
107- Shards = 1
107+ Shards = 1 ,
108108 }
109109 },
110110 DeletionProtection = DeletionProtection .Enabled
@@ -163,7 +163,7 @@ var indexMetadata = await pinecone.ConfigureIndexAsync("example-index", new Conf
163163 Pod = new ConfigureIndexRequestSpecPod
164164 {
165165 Replicas = 2 ,
166- PodType = " p1.x1"
166+ PodType = " p1.x1" ,
167167 }
168168 }
169169});
@@ -206,31 +206,31 @@ float[][] values =
206206[
207207 [1 . 0 f , 2 . 0 f , 3 . 0 f ],
208208 [4 . 0 f , 5 . 0 f , 6 . 0 f ],
209- [7 . 0 f , 8 . 0 f , 9 . 0 f ]
209+ [7 . 0 f , 8 . 0 f , 9 . 0 f ],
210210];
211211
212212// List of sparse indices to be upserted
213213uint [][] sparseIndices =
214214[
215215 [1 , 2 , 3 ],
216216 [4 , 5 , 6 ],
217- [7 , 8 , 9 ]
217+ [7 , 8 , 9 ],
218218];
219219
220220// List of sparse values to be upserted
221221float [][] sparseValues =
222222[
223223 [1000 f , 2000 f , 3000 f ],
224224 [4000 f , 5000 f , 6000 f ],
225- [7000 f , 8000 f , 9000 f ]
225+ [7000 f , 8000 f , 9000 f ],
226226];
227227
228228// Metadata to be upserted
229229var metadataStructArray = new []
230230{
231231 new Metadata { [" genre" ] = " action" , [" year" ] = 2019 },
232232 new Metadata { [" genre" ] = " thriller" , [" year" ] = 2020 },
233- new Metadata { [" genre" ] = " comedy" , [" year" ] = 2021 }
233+ new Metadata { [" genre" ] = " comedy" , [" year" ] = 2021 },
234234};
235235
236236var vectors = new List <Vector >();
@@ -244,9 +244,9 @@ for (var i = 0; i <= 2; i++)
244244 SparseValues = new SparseValues
245245 {
246246 Indices = sparseIndices [i ],
247- Values = sparseValues [i ]
247+ Values = sparseValues [i ],
248248 },
249- Metadata = metadataStructArray [i ]
249+ Metadata = metadataStructArray [i ],
250250 }
251251 );
252252}
@@ -273,12 +273,12 @@ var queryResponse = await index.QueryAsync(
273273 TopK = 10 ,
274274 IncludeValues = true ,
275275 IncludeMetadata = true ,
276- Filter = new Metadata
276+ Filter = new Metadata ,
277277 {
278278 [" genre" ] =
279279 new Metadata
280280 {
281- [" $in" ] = new [] { " comedy" , " documentary" , " drama" }
281+ [" $in" ] = new [] { " comedy" , " documentary" , " drama" },
282282 }
283283 }
284284 });
@@ -299,10 +299,10 @@ var queryResponse = await index.QueryAsync(
299299 {
300300 TopK = 10 ,
301301 Vector = [0 . 1 f , 0 . 2 f , 0 . 3 f ],
302- SparseVector = new SparseValues
302+ SparseVector = new SparseValues ,
303303 {
304304 Indices = [10 , 45 , 16 ],
305- Values = [0 . 5 f , 0 . 5 f , 0 . 2 f ]
305+ Values = [0 . 5 f , 0 . 5 f , 0 . 2 f ],
306306 }
307307 }
308308);
@@ -322,7 +322,7 @@ var index = pinecone.Index("example-index");
322322var deleteResponse = await index .DeleteAsync (new DeleteRequest
323323{
324324 Ids = new [] { " v1" },
325- Namespace = " example-namespace"
325+ Namespace = " example-namespace" ,
326326});
327327```
328328
@@ -394,7 +394,7 @@ var updateResponse = await index.UpdateAsync(new UpdateRequest
394394 Id = " vec1" ,
395395 Values = new [] { 0 . 1 f , 0 . 2 f , 0 . 3 f , 0 . 4 f },
396396 SetMetadata = new Metadata { [" genre" ] = " drama" },
397- Namespace = " example-namespace"
397+ Namespace = " example-namespace" ,
398398});
399399```
400400
0 commit comments