Documentation ¶
Overview ¶
Creates an inference trained model.
Index ¶
- Variables
- type NewPutTrainedModel
- type PutTrainedModel
- func (r *PutTrainedModel) CompressedDefinition(compresseddefinition string) *PutTrainedModel
- func (r *PutTrainedModel) DeferDefinitionDecompression(deferdefinitiondecompression bool) *PutTrainedModel
- func (r *PutTrainedModel) Definition(definition *types.Definition) *PutTrainedModel
- func (r *PutTrainedModel) Description(description string) *PutTrainedModel
- func (r PutTrainedModel) Do(providedCtx context.Context) (*Response, error)
- func (r *PutTrainedModel) ErrorTrace(errortrace bool) *PutTrainedModel
- func (r *PutTrainedModel) FilterPath(filterpaths ...string) *PutTrainedModel
- func (r *PutTrainedModel) Header(key, value string) *PutTrainedModel
- func (r *PutTrainedModel) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *PutTrainedModel) Human(human bool) *PutTrainedModel
- func (r *PutTrainedModel) InferenceConfig(inferenceconfig *types.InferenceConfigCreateContainer) *PutTrainedModel
- func (r *PutTrainedModel) Input(input *types.Input) *PutTrainedModel
- func (r *PutTrainedModel) Metadata(metadata any) *PutTrainedModel
- func (r *PutTrainedModel) ModelSizeBytes(modelsizebytes int64) *PutTrainedModel
- func (r *PutTrainedModel) ModelType(modeltype trainedmodeltype.TrainedModelType) *PutTrainedModel
- func (r PutTrainedModel) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *PutTrainedModel) PlatformArchitecture(platformarchitecture string) *PutTrainedModel
- func (r *PutTrainedModel) PrefixStrings(prefixstrings *types.TrainedModelPrefixStrings) *PutTrainedModel
- func (r *PutTrainedModel) Pretty(pretty bool) *PutTrainedModel
- func (r *PutTrainedModel) Raw(raw io.Reader) *PutTrainedModel
- func (r *PutTrainedModel) Request(req *Request) *PutTrainedModel
- func (r *PutTrainedModel) Tags(tags ...string) *PutTrainedModel
- func (r *PutTrainedModel) WaitForCompletion(waitforcompletion bool) *PutTrainedModel
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewPutTrainedModel ¶
type NewPutTrainedModel func(modelid string) *PutTrainedModel
NewPutTrainedModel type alias for index.
func NewPutTrainedModelFunc ¶
func NewPutTrainedModelFunc(tp elastictransport.Interface) NewPutTrainedModel
NewPutTrainedModelFunc returns a new instance of PutTrainedModel with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PutTrainedModel ¶
type PutTrainedModel struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PutTrainedModel
Creates an inference trained model.
https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html
func (*PutTrainedModel) CompressedDefinition ¶ added in v8.9.0
func (r *PutTrainedModel) CompressedDefinition(compresseddefinition string) *PutTrainedModel
CompressedDefinition The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified. API name: compressed_definition
func (*PutTrainedModel) DeferDefinitionDecompression ¶
func (r *PutTrainedModel) DeferDefinitionDecompression(deferdefinitiondecompression bool) *PutTrainedModel
DeferDefinitionDecompression If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. API name: defer_definition_decompression
func (*PutTrainedModel) Definition ¶ added in v8.9.0
func (r *PutTrainedModel) Definition(definition *types.Definition) *PutTrainedModel
Definition The inference definition for the model. If definition is specified, then compressed_definition cannot be specified. API name: definition
func (*PutTrainedModel) Description ¶ added in v8.9.0
func (r *PutTrainedModel) Description(description string) *PutTrainedModel
Description A human-readable description of the inference trained model. API name: description
func (PutTrainedModel) Do ¶
func (r PutTrainedModel) Do(providedCtx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a puttrainedmodel.Response
func (*PutTrainedModel) ErrorTrace ¶ added in v8.14.0
func (r *PutTrainedModel) ErrorTrace(errortrace bool) *PutTrainedModel
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*PutTrainedModel) FilterPath ¶ added in v8.14.0
func (r *PutTrainedModel) FilterPath(filterpaths ...string) *PutTrainedModel
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*PutTrainedModel) Header ¶
func (r *PutTrainedModel) Header(key, value string) *PutTrainedModel
Header set a key, value pair in the PutTrainedModel headers map.
func (*PutTrainedModel) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*PutTrainedModel) Human ¶ added in v8.14.0
func (r *PutTrainedModel) Human(human bool) *PutTrainedModel
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human
func (*PutTrainedModel) InferenceConfig ¶ added in v8.9.0
func (r *PutTrainedModel) InferenceConfig(inferenceconfig *types.InferenceConfigCreateContainer) *PutTrainedModel
InferenceConfig The default configuration for inference. This can be either a regression or classification configuration. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required. API name: inference_config
func (*PutTrainedModel) Input ¶ added in v8.9.0
func (r *PutTrainedModel) Input(input *types.Input) *PutTrainedModel
Input The input field names for the model definition. API name: input
func (*PutTrainedModel) Metadata ¶ added in v8.9.0
func (r *PutTrainedModel) Metadata(metadata any) *PutTrainedModel
Metadata An object map that contains metadata about the model. API name: metadata
metadata should be a json.RawMessage or a structure if a structure is provided, the client will defer a json serialization prior to sending the payload to Elasticsearch.
func (*PutTrainedModel) ModelSizeBytes ¶ added in v8.9.0
func (r *PutTrainedModel) ModelSizeBytes(modelsizebytes int64) *PutTrainedModel
ModelSizeBytes The estimated memory usage in bytes to keep the trained model in memory. This property is supported only if defer_definition_decompression is true or the model definition is not supplied. API name: model_size_bytes
func (*PutTrainedModel) ModelType ¶ added in v8.9.0
func (r *PutTrainedModel) ModelType(modeltype trainedmodeltype.TrainedModelType) *PutTrainedModel
ModelType The model type. API name: model_type
func (PutTrainedModel) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PutTrainedModel) PlatformArchitecture ¶ added in v8.11.0
func (r *PutTrainedModel) PlatformArchitecture(platformarchitecture string) *PutTrainedModel
PlatformArchitecture The platform architecture (if applicable) of the trained mode. If the model only works on one platform, because it is heavily optimized for a particular processor architecture and OS combination, then this field specifies which. The format of the string must match the platform identifiers used by Elasticsearch, so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, `darwin-aarch64`, or `windows-x86_64`. For portable models (those that work independent of processor architecture or OS features), leave this field unset. API name: platform_architecture
func (*PutTrainedModel) PrefixStrings ¶ added in v8.13.0
func (r *PutTrainedModel) PrefixStrings(prefixstrings *types.TrainedModelPrefixStrings) *PutTrainedModel
PrefixStrings Optional prefix strings applied at inference API name: prefix_strings
func (*PutTrainedModel) Pretty ¶ added in v8.14.0
func (r *PutTrainedModel) Pretty(pretty bool) *PutTrainedModel
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*PutTrainedModel) Raw ¶
func (r *PutTrainedModel) Raw(raw io.Reader) *PutTrainedModel
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PutTrainedModel) Request ¶
func (r *PutTrainedModel) Request(req *Request) *PutTrainedModel
Request allows to set the request property with the appropriate payload.
func (*PutTrainedModel) Tags ¶ added in v8.9.0
func (r *PutTrainedModel) Tags(tags ...string) *PutTrainedModel
Tags An array of tags to organize the model. API name: tags
func (*PutTrainedModel) WaitForCompletion ¶ added in v8.13.0
func (r *PutTrainedModel) WaitForCompletion(waitforcompletion bool) *PutTrainedModel
WaitForCompletion Whether to wait for all child operations (e.g. model download) to complete. API name: wait_for_completion
type Request ¶
type Request struct { // CompressedDefinition The compressed (GZipped and Base64 encoded) inference definition of the // model. If compressed_definition is specified, then definition cannot be // specified. CompressedDefinition *string `json:"compressed_definition,omitempty"` // Definition The inference definition for the model. If definition is specified, then // compressed_definition cannot be specified. Definition *types.Definition `json:"definition,omitempty"` // Description A human-readable description of the inference trained model. Description *string `json:"description,omitempty"` // InferenceConfig The default configuration for inference. This can be either a regression // or classification configuration. It must match the underlying // definition.trained_model's target_type. For pre-packaged models such as // ELSER the config is not required. InferenceConfig *types.InferenceConfigCreateContainer `json:"inference_config,omitempty"` // Input The input field names for the model definition. Input *types.Input `json:"input,omitempty"` // Metadata An object map that contains metadata about the model. Metadata json.RawMessage `json:"metadata,omitempty"` // ModelSizeBytes The estimated memory usage in bytes to keep the trained model in memory. // This property is supported only if defer_definition_decompression is true // or the model definition is not supplied. ModelSizeBytes *int64 `json:"model_size_bytes,omitempty"` // ModelType The model type. ModelType *trainedmodeltype.TrainedModelType `json:"model_type,omitempty"` // PlatformArchitecture The platform architecture (if applicable) of the trained mode. If the model // only works on one platform, because it is heavily optimized for a particular // processor architecture and OS combination, then this field specifies which. // The format of the string must match the platform identifiers used by // Elasticsearch, // so one of, `linux-x86_64`, `linux-aarch64`, `darwin-x86_64`, // `darwin-aarch64`, // or `windows-x86_64`. For portable models (those that work independent of // processor // architecture or OS features), leave this field unset. PlatformArchitecture *string `json:"platform_architecture,omitempty"` // PrefixStrings Optional prefix strings applied at inference PrefixStrings *types.TrainedModelPrefixStrings `json:"prefix_strings,omitempty"` // Tags An array of tags to organize the model. Tags []string `json:"tags,omitempty"` }
Request holds the request body struct for the package puttrainedmodel
type Response ¶ added in v8.7.0
type Response struct { CompressedDefinition *string `json:"compressed_definition,omitempty"` // CreateTime The time when the trained model was created. CreateTime types.DateTime `json:"create_time,omitempty"` // CreatedBy Information on the creator of the trained model. CreatedBy *string `json:"created_by,omitempty"` // DefaultFieldMap Any field map described in the inference configuration takes precedence. DefaultFieldMap map[string]string `json:"default_field_map,omitempty"` // Description The free-text description of the trained model. Description *string `json:"description,omitempty"` // EstimatedHeapMemoryUsageBytes The estimated heap usage in bytes to keep the trained model in memory. EstimatedHeapMemoryUsageBytes *int `json:"estimated_heap_memory_usage_bytes,omitempty"` // EstimatedOperations The estimated number of operations to use the trained model. EstimatedOperations *int `json:"estimated_operations,omitempty"` // FullyDefined True if the full model definition is present. FullyDefined *bool `json:"fully_defined,omitempty"` // InferenceConfig The default configuration for inference. This can be either a regression, // classification, or one of the many NLP focused configurations. It must match // the underlying definition.trained_model's target_type. For pre-packaged // models such as ELSER the config is not required. InferenceConfig *types.InferenceConfigCreateContainer `json:"inference_config,omitempty"` // Input The input field names for the model definition. Input types.TrainedModelConfigInput `json:"input"` // LicenseLevel The license level of the trained model. LicenseLevel *string `json:"license_level,omitempty"` Location *types.TrainedModelLocation `json:"location,omitempty"` // Metadata An object containing metadata about the trained model. For example, models // created by data frame analytics contain analysis_config and input objects. Metadata *types.TrainedModelConfigMetadata `json:"metadata,omitempty"` // ModelId Identifier for the trained model. ModelId string `json:"model_id"` ModelSizeBytes types.ByteSize `json:"model_size_bytes,omitempty"` // ModelType The model type ModelType *trainedmodeltype.TrainedModelType `json:"model_type,omitempty"` PrefixStrings *types.TrainedModelPrefixStrings `json:"prefix_strings,omitempty"` // Tags A comma delimited string of tags. A trained model can have many tags, or // none. Tags []string `json:"tags"` // Version The Elasticsearch version number in which the trained model was created. Version *string `json:"version,omitempty"` }
Response holds the response body struct for the package puttrainedmodel