github.com/weaviate/weaviate@v1.24.6/modules/text2vec-contextionary/additional/interpretation/interpretation.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 interpretation
    13  
    14  import (
    15  	"context"
    16  
    17  	"github.com/tailor-inc/graphql/language/ast"
    18  	"github.com/weaviate/weaviate/entities/moduletools"
    19  	"github.com/weaviate/weaviate/entities/search"
    20  )
    21  
    22  type Interpretation struct{}
    23  
    24  func New() *Interpretation {
    25  	return &Interpretation{}
    26  }
    27  
    28  func (e *Interpretation) AdditionalPropertyDefaultValue() interface{} {
    29  	return true
    30  }
    31  
    32  func (e *Interpretation) AdditionalPropertyFn(ctx context.Context,
    33  	in []search.Result, params interface{}, limit *int,
    34  	argumentModuleParams map[string]interface{}, cfg moduletools.ClassConfig,
    35  ) ([]search.Result, error) {
    36  	// this is a special case additional value
    37  	// this value is being added to storage object in vectorization process
    38  	// interpretation is being saved in DB when making vectorization
    39  	// interpretation is being extracted and added to the result
    40  	// when it's being read from DB (see storage_object.go)
    41  	return in, nil
    42  }
    43  
    44  func (e *Interpretation) ExtractAdditionalFn(param []*ast.Argument) interface{} {
    45  	return true
    46  }