github.com/weaviate/weaviate@v1.24.6/entities/modulecapabilities/module.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 modulecapabilities
    13  
    14  import (
    15  	"context"
    16  	"net/http"
    17  
    18  	"github.com/weaviate/weaviate/entities/moduletools"
    19  )
    20  
    21  type ModuleType string
    22  
    23  const (
    24  	Backup              ModuleType = "Backup"
    25  	Extension           ModuleType = "Extension"
    26  	Img2Vec             ModuleType = "Img2Vec"
    27  	Multi2Vec           ModuleType = "Multi2Vec"
    28  	Ref2Vec             ModuleType = "Ref2Vec"
    29  	Text2MultiVec       ModuleType = "Text2MultiVec"
    30  	Text2TextGenerative ModuleType = "Text2TextGenerative"
    31  	Text2TextSummarize  ModuleType = "Text2TextSummarize"
    32  	Text2TextReranker   ModuleType = "Text2TextReranker"
    33  	Text2TextNER        ModuleType = "Text2TextNER"
    34  	Text2TextQnA        ModuleType = "Text2TextQnA"
    35  	Text2Vec            ModuleType = "Text2Vec"
    36  )
    37  
    38  type Module interface {
    39  	Name() string
    40  	Init(ctx context.Context, params moduletools.ModuleInitParams) error
    41  	RootHandler() http.Handler // TODO: remove from overall module, this is a capability
    42  	Type() ModuleType
    43  }
    44  
    45  type ModuleExtension interface {
    46  	Module
    47  	InitExtension(modules []Module) error
    48  }
    49  
    50  type ModuleDependency interface {
    51  	Module
    52  	InitDependency(modules []Module) error
    53  }
    54  
    55  type Dependency interface {
    56  	ModuleName() string
    57  	Argument() string
    58  	GraphQLArgument() GraphQLArgument
    59  	VectorSearch() VectorForParams
    60  }
    61  
    62  type ModuleHasAltNames interface {
    63  	AltNames() []string
    64  }