github.com/weaviate/weaviate@v1.24.6/modules/text2vec-palm/config.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 modpalm
    13  
    14  import (
    15  	"context"
    16  
    17  	"github.com/weaviate/weaviate/modules/qna-openai/config"
    18  	"github.com/weaviate/weaviate/modules/text2vec-palm/vectorizer"
    19  
    20  	"github.com/weaviate/weaviate/entities/models"
    21  	"github.com/weaviate/weaviate/entities/modulecapabilities"
    22  	"github.com/weaviate/weaviate/entities/moduletools"
    23  	"github.com/weaviate/weaviate/entities/schema"
    24  )
    25  
    26  func (m *PalmModule) ClassConfigDefaults() map[string]interface{} {
    27  	return map[string]interface{}{
    28  		"vectorizeClassName": vectorizer.DefaultVectorizeClassName,
    29  	}
    30  }
    31  
    32  func (m *PalmModule) PropertyConfigDefaults(
    33  	dt *schema.DataType,
    34  ) map[string]interface{} {
    35  	return map[string]interface{}{
    36  		"skip":                  !vectorizer.DefaultPropertyIndexed,
    37  		"vectorizePropertyName": vectorizer.DefaultVectorizePropertyName,
    38  	}
    39  }
    40  
    41  func (m *PalmModule) ValidateClass(ctx context.Context,
    42  	class *models.Class, cfg moduletools.ClassConfig,
    43  ) error {
    44  	settings := config.NewClassSettings(cfg)
    45  	return settings.Validate(class)
    46  }
    47  
    48  var _ = modulecapabilities.ClassConfigurator(New())