github.com/weaviate/weaviate@v1.24.6/modules/qna-openai/ask/grapqhl_extract.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 ask
    13  
    14  func (g *GraphQLArgumentsProvider) extractAskFn(source map[string]interface{}) interface{} {
    15  	var args AskParams
    16  
    17  	question, ok := source["question"].(string)
    18  	if ok {
    19  		args.Question = question
    20  	}
    21  
    22  	properties, ok := source["properties"].([]interface{})
    23  	if ok {
    24  		args.Properties = make([]string, len(properties))
    25  		for i, value := range properties {
    26  			args.Properties[i] = value.(string)
    27  		}
    28  	}
    29  
    30  	return &args
    31  }