github.com/weaviate/weaviate@v1.24.6/usecases/modulecomponents/additional/rank/rank_graphql_field.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 rank
    13  
    14  import (
    15  	"fmt"
    16  
    17  	"github.com/tailor-inc/graphql"
    18  )
    19  
    20  func (p *ReRankerProvider) additionalReRankerField(classname string) *graphql.Field {
    21  	return &graphql.Field{
    22  		Args: graphql.FieldConfigArgument{
    23  			"query": &graphql.ArgumentConfig{
    24  				Description:  "Properties which contains text",
    25  				Type:         graphql.String,
    26  				DefaultValue: nil,
    27  			},
    28  			"property": &graphql.ArgumentConfig{
    29  				Description:  "Property to rank from",
    30  				Type:         graphql.String,
    31  				DefaultValue: nil,
    32  			},
    33  		},
    34  		Type: graphql.NewList(graphql.NewObject(graphql.ObjectConfig{
    35  			Name: fmt.Sprintf("%sAdditionalReranker", classname),
    36  			Fields: graphql.Fields{
    37  				"score": &graphql.Field{Type: graphql.Float},
    38  			},
    39  		})),
    40  	}
    41  }