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