@@ -2,6 +2,7 @@ use crate::pinecone::PineconeClient;
22use crate :: protos:: vector_service_client:: VectorServiceClient ;
33use crate :: utils:: errors:: PineconeError ;
44use once_cell:: sync:: Lazy ;
5+ use std:: sync:: Arc ;
56use tonic:: metadata:: { Ascii , MetadataValue as TonicMetadataVal } ;
67use tonic:: service:: interceptor:: InterceptedService ;
78use tonic:: service:: Interceptor ;
@@ -12,6 +13,7 @@ use crate::models::{
1213 DescribeIndexStatsResponse , FetchResponse , ListResponse , Metadata , Namespace , QueryResponse ,
1314 SparseValues , UpdateResponse , UpsertResponse , Vector ,
1415} ;
16+ use crate :: openapi:: apis:: vector_operations_api;
1517use crate :: protos;
1618
1719#[ derive( Debug , Clone ) ]
@@ -38,6 +40,7 @@ pub struct Index {
3840 /// The name of the index.
3941 host : String ,
4042 connection : VectorServiceClient < InterceptedService < Channel , ApiKeyInterceptor > > ,
43+ client : Arc < PineconeClient > ,
4144}
4245
4346impl Index {
@@ -623,6 +626,7 @@ impl PineconeClient {
623626 let index = Index {
624627 host : endpoint. clone ( ) ,
625628 connection : self . new_index_connection ( endpoint) . await ?,
629+ client : Arc :: new ( self . clone ( ) ) ,
626630 } ;
627631
628632 Ok ( index)
0 commit comments