github.com/weaviate/weaviate@v1.24.6/modules/qna-openai/ask.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package modqnaopenai
    13  
    14  import (
    15  	"github.com/weaviate/weaviate/entities/modulecapabilities"
    16  	"github.com/weaviate/weaviate/modules/qna-openai/ask"
    17  )
    18  
    19  func (m *QnAModule) initAskSearcher() error {
    20  	m.searcher = ask.NewSearcher(m.nearTextDependencies)
    21  	return nil
    22  }
    23  
    24  func (m *QnAModule) initAskProvider() error {
    25  	m.graphqlProvider = ask.New(m.askTextTransformer)
    26  	return nil
    27  }
    28  
    29  func (m *QnAModule) Arguments() map[string]modulecapabilities.GraphQLArgument {
    30  	return m.graphqlProvider.Arguments()
    31  }
    32  
    33  func (m *QnAModule) VectorSearches() modulecapabilities.ModuleArgumentVectorForParams {
    34  	return m.searcher.VectorSearches()
    35  }
    36  
    37  var (
    38  	_ = modulecapabilities.GraphQLArguments(New())
    39  	_ = modulecapabilities.DependencySearcher(New())
    40  )