File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11package  vectorstores
22
3+ import  "github.com/tmc/langchaingo/embeddings" 
4+ 
35// Option is a function that configures an Options. 
46type  Option  func (* Options )
57
@@ -8,6 +10,7 @@ type Options struct {
810	NameSpace       string 
911	ScoreThreshold  float64 
1012	Filters         any 
13+ 	Embedder        embeddings.Embedder 
1114}
1215
1316// WithNameSpace returns an Option for setting the name space. 
@@ -32,3 +35,12 @@ func WithFilters(filters any) Option {
3235		o .Filters  =  filters 
3336	}
3437}
38+ 
39+ // WithEmbedder returns an Option for setting the embedder that could be used when 
40+ // adding documents or doing similarity search (instead the embedder from the Store context) 
41+ // this is useful when we are using multiple LLMs with single vectorstore. 
42+ func  WithEmbedder (embedder  embeddings.Embedder ) Option  {
43+ 	return  func (o  * Options ) {
44+ 		o .Embedder  =  embedder 
45+ 	}
46+ }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments