github.com/weaviate/weaviate@v1.24.6/usecases/modulecomponents/arguments/nearThermal/graphql_argument.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 nearThermal 13 14 import ( 15 "fmt" 16 17 "github.com/tailor-inc/graphql" 18 "github.com/weaviate/weaviate/adapters/handlers/graphql/descriptions" 19 ) 20 21 func getNearThermalArgumentFn(classname string) *graphql.ArgumentConfig { 22 return nearThermalArgument("GetObjects", classname) 23 } 24 25 func exploreNearThermalArgumentFn() *graphql.ArgumentConfig { 26 return nearThermalArgument("Explore", "") 27 } 28 29 func aggregateNearThermalArgumentFn(classname string) *graphql.ArgumentConfig { 30 return nearThermalArgument("Aggregate", classname) 31 } 32 33 func nearThermalArgument(prefix, className string) *graphql.ArgumentConfig { 34 prefixName := fmt.Sprintf("Multi2VecBind%s%s", prefix, className) 35 return &graphql.ArgumentConfig{ 36 Type: graphql.NewInputObject( 37 graphql.InputObjectConfig{ 38 Name: fmt.Sprintf("%sNearThermalInpObj", prefixName), 39 Fields: nearThermalFields(prefixName), 40 Description: descriptions.GetWhereInpObj, 41 }, 42 ), 43 } 44 } 45 46 func nearThermalFields(prefix string) graphql.InputObjectConfigFieldMap { 47 return graphql.InputObjectConfigFieldMap{ 48 "thermal": &graphql.InputObjectFieldConfig{ 49 Description: "Base64 encoded thermal data", 50 Type: graphql.NewNonNull(graphql.String), 51 }, 52 "certainty": &graphql.InputObjectFieldConfig{ 53 Description: descriptions.Certainty, 54 Type: graphql.Float, 55 }, 56 "distance": &graphql.InputObjectFieldConfig{ 57 Description: descriptions.Distance, 58 Type: graphql.Float, 59 }, 60 "targetVectors": &graphql.InputObjectFieldConfig{ 61 Description: "Target vectors", 62 Type: graphql.NewList(graphql.String), 63 }, 64 } 65 }