@@ -256,7 +256,6 @@ pub struct QueryResult {
256256
257257pub struct Service {
258258 content_endpoint : Option < String > ,
259- api_key : String ,
260259 path : PathBuf ,
261260 vector_store : VectorStore ,
262261 pending : Mutex < HashSet < String > > ,
@@ -370,16 +369,10 @@ impl Service {
370369 s
371370 }
372371
373- fn new < P : Into < PathBuf > > (
374- path : P ,
375- num_bufs : usize ,
376- key : String ,
377- content_endpoint : Option < String > ,
378- ) -> Self {
372+ fn new < P : Into < PathBuf > > ( path : P , num_bufs : usize , content_endpoint : Option < String > ) -> Self {
379373 let path = path. into ( ) ;
380374 Service {
381375 content_endpoint,
382- api_key : key,
383376 path : path. clone ( ) ,
384377 vector_store : VectorStore :: new ( path, num_bufs) ,
385378 pending : Mutex :: new ( HashSet :: new ( ) ) ,
@@ -691,7 +684,7 @@ impl Service {
691684 count : usize ,
692685 ) -> Result < Response < Body > , ResponseError > {
693686 let api_key = api_key?;
694- let vec = Box :: new ( ( embeddings_for ( & self . api_key , & [ q] ) . await . unwrap ( ) ) [ 0 ] ) ;
687+ let vec = Box :: new ( ( embeddings_for ( & api_key, & [ q] ) . await . unwrap ( ) ) [ 0 ] ) ;
695688 let qp = Point :: Mem { vec } ;
696689 let index_id = create_index_name ( & domain, & commit) ;
697690 // if None, then return 404
@@ -735,11 +728,10 @@ pub async fn serve<P: Into<PathBuf>>(
735728 directory : P ,
736729 port : u16 ,
737730 num_bufs : usize ,
738- key : String ,
739731 content_endpoint : Option < String > ,
740732) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync > > {
741733 let addr = SocketAddr :: new ( IpAddr :: V6 ( Ipv6Addr :: UNSPECIFIED ) , port) ;
742- let service = Arc :: new ( Service :: new ( directory, num_bufs, key , content_endpoint) ) ;
734+ let service = Arc :: new ( Service :: new ( directory, num_bufs, content_endpoint) ) ;
743735 let make_svc = make_service_fn ( move |_conn| {
744736 let s = service. clone ( ) ;
745737 async {
0 commit comments