mlflow-client-go/experiment_types.go

70 lines
1.7 KiB
Go

package mlflow
import (
"bytes"
"encoding/json"
)
type ExperimentSearchReply struct {
Experiments []Experiment `json:"experiments"`
NextPageToken string `json:"next_page_token,omitempty"`
}
type ExperimentGetReply struct {
Experiment Experiment `json:"experiment"`
}
type ExperimentCreateReply struct {
ExperimentId string `json:"experiment_id"`
}
type Experiment struct {
Id string `json:"experiment_id,omitempty"`
Name string `json:"name,omitempty"`
ArtifactLocation string `json:"artifact_location,omitempty"`
LifecycleStage string `json:"lifecycle_stage,omitempty"`
LastUpdate Timestamp `json:"last_update_time,omitempty"`
CreationTime Timestamp `json:"creation_time,omitempty"`
Tage []ExperimentTag `json:"tags,omitempty"`
}
func (e *Experiment) serialize() []byte {
j, _ := json.Marshal(e)
return j
}
type ExperimentTag struct {
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
}
type ExperimentSearchOptions struct {
MaxResults int64 `json:"max_results,omitempty"`
Filter string `json:"filter,omitempty"`
PageToken string `json:"page_token,omitempty"`
OrderBy string `json:"order_by,omitempty"`
ViewType ViewType `json:"view_type,omitempty"`
}
func (e *ExperimentSearchOptions) __init() *ExperimentSearchOptions {
if e.MaxResults == 0 {
e.MaxResults = 1000
}
return e
}
func (e *ExperimentSearchOptions) serialize() []byte {
j, _ := json.Marshal(e)
return j
}
func (e *ExperimentSearchOptions) getReader() *bytes.Reader {
return bytes.NewReader(e.__init().serialize())
}
type SetExperimentTagRequest struct {
ExperimentTag
ExperimentId string `json:"experiment_id,omitempty"`
}