github.com/weaviate/weaviate@v1.24.6/usecases/modulecomponents/arguments/nearText/graphql_provider.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 nearText
    13  
    14  import (
    15  	"github.com/weaviate/weaviate/entities/modulecapabilities"
    16  )
    17  
    18  const NAME = "nearText"
    19  
    20  type GraphQLArgumentsProvider struct {
    21  	nearTextTransformer modulecapabilities.TextTransform
    22  }
    23  
    24  func New(nearTextTransformer modulecapabilities.TextTransform) *GraphQLArgumentsProvider {
    25  	return &GraphQLArgumentsProvider{nearTextTransformer}
    26  }
    27  
    28  func (g *GraphQLArgumentsProvider) Arguments() map[string]modulecapabilities.GraphQLArgument {
    29  	arguments := map[string]modulecapabilities.GraphQLArgument{}
    30  	arguments[NAME] = g.getNearText()
    31  	return arguments
    32  }
    33  
    34  func (g *GraphQLArgumentsProvider) getNearText() modulecapabilities.GraphQLArgument {
    35  	return modulecapabilities.GraphQLArgument{
    36  		GetArgumentsFunction:       g.getNearTextArgumentFn,
    37  		AggregateArgumentsFunction: g.aggregateNearTextArgumentFn,
    38  		ExploreArgumentsFunction:   g.exploreNearTextArgumentFn,
    39  		ExtractFunction:            g.extractNearTextFn,
    40  		ValidateFunction:           g.validateNearTextFn,
    41  	}
    42  }