| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| package modulecapabilities |
|
|
| import ( |
| "context" |
|
|
| "github.com/tailor-inc/graphql" |
| "github.com/tailor-inc/graphql/language/ast" |
| "github.com/weaviate/weaviate/entities/moduletools" |
| ) |
|
|
| |
| type GraphQLInputFieldFn = func(classname string) *graphql.InputObjectFieldConfig |
|
|
| |
| type ExtractRequestParamsFn = func(field *ast.ObjectField) interface{} |
|
|
| |
| type GenerateDebugInformation struct { |
| Prompt string |
| } |
|
|
| |
| |
| type GenerateResponse struct { |
| Result *string |
| Params map[string]interface{} |
| Debug *GenerateDebugInformation |
| } |
|
|
| |
| |
| type GenerateProperties struct { |
| Text map[string]string |
| Blob map[string]*string |
| } |
|
|
| |
| type GenerativeClient interface { |
| GenerateSingleResult(ctx context.Context, |
| properties *GenerateProperties, prompt string, requestParams interface{}, debug bool, cfg moduletools.ClassConfig, |
| ) (*GenerateResponse, error) |
| GenerateAllResults(ctx context.Context, |
| properties []*GenerateProperties, task string, requestParams interface{}, debug bool, cfg moduletools.ClassConfig, |
| ) (*GenerateResponse, error) |
| } |
|
|
| |
| |
| |
| type GenerativeProperty struct { |
| Client GenerativeClient |
| RequestParamsFunction GraphQLInputFieldFn |
| ResponseParamsFunction GraphQLFieldFn |
| ExtractRequestParamsFunction ExtractRequestParamsFn |
| } |
|
|
| |
| |
| type AdditionalGenerativeProperties interface { |
| AdditionalGenerativeProperties() map[string]GenerativeProperty |
| } |
|
|