models

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortOrderAsc  = "ASC"
	SortOrderDesc = "DESC"
	OrderByID     = "id"
)
View Source
const DataSetType = "dataset-artifact"
View Source
const DocArtifactType = "doc-artifact"
View Source
const MetricHistoryType = "metric-history"
View Source
const MetricType = "metric"
View Source
const ModelArtifactType = "model-artifact"
View Source
const ParameterType = "parameter"

Variables

View Source
var (
	// Use centralized state mappings from constants package
	Artifact_State_name  = constants.ArtifactStateNames
	Artifact_State_value = constants.ArtifactStateMapping
)
View Source
var (
	DefaultSortOrder = SortOrderAsc
	DefaultPageSize  = int32(0)
	DefaultOrderBy   = OrderByID
)
View Source
var (
	// Use centralized state mappings from constants package
	Execution_State_name  = constants.ExecutionStateNames
	Execution_State_value = constants.ExecutionStateMapping
)

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ModelArtifact *ModelArtifact
	DocArtifact   *DocArtifact
	DataSet       *DataSet
	Metric        *Metric
	Parameter     *Parameter
}

type ArtifactListOptions

type ArtifactListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
	ArtifactType     *string
}

func (*ArtifactListOptions) GetRestEntityType added in v0.3.0

func (a *ArtifactListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface This enables advanced filtering support for artifacts

type ArtifactRepository

type ArtifactRepository interface {
	GetByID(id int32) (Artifact, error)
	List(listOptions ArtifactListOptions) (*ListWrapper[Artifact], error)
}

type BaseEntity

type BaseEntity[T any] struct {
	ID               *int32
	TypeID           *int32
	Attributes       *T
	Properties       *[]Properties
	CustomProperties *[]Properties
}

func (*BaseEntity[T]) GetAttributes

func (r *BaseEntity[T]) GetAttributes() *T

func (*BaseEntity[T]) GetCustomProperties

func (r *BaseEntity[T]) GetCustomProperties() *[]Properties

func (*BaseEntity[T]) GetID

func (r *BaseEntity[T]) GetID() *int32

func (*BaseEntity[T]) GetProperties

func (r *BaseEntity[T]) GetProperties() *[]Properties

func (*BaseEntity[T]) GetTypeID

func (r *BaseEntity[T]) GetTypeID() *int32

func (*BaseEntity[T]) SetID added in v0.3.2

func (r *BaseEntity[T]) SetID(n int32)

func (*BaseEntity[T]) SetTypeID added in v0.3.2

func (r *BaseEntity[T]) SetTypeID(n int32)

type DataSet added in v0.3.0

type DataSet interface {
	Entity[DataSetAttributes]
}

type DataSetAttributes added in v0.3.0

type DataSetAttributes struct {
	Name                     *string
	URI                      *string
	State                    *string
	ArtifactType             *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type DataSetImpl added in v0.3.0

type DataSetImpl = BaseEntity[DataSetAttributes]

type DataSetListOptions added in v0.3.0

type DataSetListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
}

type DataSetRepository added in v0.3.0

type DataSetRepository interface {
	GetByID(id int32) (DataSet, error)
	List(listOptions DataSetListOptions) (*ListWrapper[DataSet], error)
	Save(dataSet DataSet, parentResourceID *int32) (DataSet, error)
}

type DocArtifact

type DocArtifact interface {
	Entity[DocArtifactAttributes]
}

type DocArtifactAttributes

type DocArtifactAttributes struct {
	Name                     *string
	URI                      *string
	State                    *string
	ArtifactType             *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type DocArtifactImpl

type DocArtifactImpl = BaseEntity[DocArtifactAttributes]

type DocArtifactListOptions

type DocArtifactListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
}

type DocArtifactRepository

type DocArtifactRepository interface {
	GetByID(id int32) (DocArtifact, error)
	List(listOptions DocArtifactListOptions) (*ListWrapper[DocArtifact], error)
	Save(docArtifact DocArtifact, parentResourceID *int32) (DocArtifact, error)
}

type Entity

type Entity[T any] interface {
	GetID() *int32
	SetID(int32)
	GetTypeID() *int32
	SetTypeID(int32)
	GetAttributes() *T
	GetProperties() *[]Properties
	GetCustomProperties() *[]Properties
}

type Experiment added in v0.3.0

type Experiment interface {
	Entity[ExperimentAttributes]
}

type ExperimentAttributes added in v0.3.0

type ExperimentAttributes struct {
	Name                     *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ExperimentImpl added in v0.3.0

type ExperimentImpl = BaseEntity[ExperimentAttributes]

type ExperimentListOptions added in v0.3.0

type ExperimentListOptions struct {
	Pagination
	Name       *string
	ExternalID *string
}

func (*ExperimentListOptions) GetRestEntityType added in v0.3.0

func (e *ExperimentListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type ExperimentRepository added in v0.3.0

type ExperimentRepository interface {
	GetByID(id int32) (Experiment, error)
	List(listOptions ExperimentListOptions) (*ListWrapper[Experiment], error)
	Save(experiment Experiment) (Experiment, error)
}

type ExperimentRun added in v0.3.0

type ExperimentRun interface {
	Entity[ExperimentRunAttributes]
}

type ExperimentRunAttributes added in v0.3.0

type ExperimentRunAttributes struct {
	Name                     *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ExperimentRunImpl added in v0.3.0

type ExperimentRunImpl = BaseEntity[ExperimentRunAttributes]

type ExperimentRunListOptions added in v0.3.0

type ExperimentRunListOptions struct {
	Pagination
	Name         *string
	ExternalID   *string
	ExperimentID *int32
}

func (*ExperimentRunListOptions) GetRestEntityType added in v0.3.0

func (e *ExperimentRunListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type ExperimentRunRepository added in v0.3.0

type ExperimentRunRepository interface {
	GetByID(id int32) (ExperimentRun, error)
	List(listOptions ExperimentRunListOptions) (*ListWrapper[ExperimentRun], error)
	Save(experimentRun ExperimentRun, experimentID *int32) (ExperimentRun, error)
}

type InferenceService

type InferenceService interface {
	Entity[InferenceServiceAttributes]
}

type InferenceServiceAttributes

type InferenceServiceAttributes struct {
	Name                     *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type InferenceServiceImpl

type InferenceServiceImpl = BaseEntity[InferenceServiceAttributes]

type InferenceServiceListOptions

type InferenceServiceListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
	Runtime          *string
}

type InferenceServiceRepository

type InferenceServiceRepository interface {
	GetByID(id int32) (InferenceService, error)
	List(listOptions InferenceServiceListOptions) (*ListWrapper[InferenceService], error)
	Save(model InferenceService) (InferenceService, error)
}

type ListWrapper

type ListWrapper[T any] struct {
	Items         []T
	NextPageToken string
	PageSize      int32
	Size          int32
}

type Metric added in v0.3.0

type Metric interface {
	Entity[MetricAttributes]
}

type MetricAttributes added in v0.3.0

type MetricAttributes struct {
	Name                     *string
	URI                      *string
	State                    *string
	ArtifactType             *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type MetricHistory added in v0.3.0

type MetricHistory interface {
	Entity[MetricHistoryAttributes]
}

type MetricHistoryAttributes added in v0.3.0

type MetricHistoryAttributes struct {
	Name                     *string
	URI                      *string
	State                    *string
	ArtifactType             *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type MetricHistoryImpl added in v0.3.0

type MetricHistoryImpl = BaseEntity[MetricHistoryAttributes]

type MetricHistoryListOptions added in v0.3.0

type MetricHistoryListOptions struct {
	Pagination
	Name            *string
	ExternalID      *string
	ExperimentRunID *int32
	StepIds         *string
}

func (*MetricHistoryListOptions) GetRestEntityType added in v0.3.1

func (m *MetricHistoryListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type MetricHistoryRepository added in v0.3.0

type MetricHistoryRepository interface {
	GetByID(id int32) (MetricHistory, error)
	List(listOptions MetricHistoryListOptions) (*ListWrapper[MetricHistory], error)
	Save(metricHistory MetricHistory, experimentRunID *int32) (MetricHistory, error)
}

type MetricImpl added in v0.3.0

type MetricImpl = BaseEntity[MetricAttributes]

type MetricListOptions added in v0.3.0

type MetricListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
}

type MetricRepository added in v0.3.0

type MetricRepository interface {
	GetByID(id int32) (Metric, error)
	List(listOptions MetricListOptions) (*ListWrapper[Metric], error)
	Save(metric Metric, parentResourceID *int32) (Metric, error)
}

type ModelArtifact

type ModelArtifact interface {
	Entity[ModelArtifactAttributes]
}

type ModelArtifactAttributes

type ModelArtifactAttributes struct {
	Name                     *string
	URI                      *string
	State                    *string
	ArtifactType             *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ModelArtifactImpl

type ModelArtifactImpl = BaseEntity[ModelArtifactAttributes]

type ModelArtifactListOptions

type ModelArtifactListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
}

func (*ModelArtifactListOptions) GetRestEntityType added in v0.3.0

func (m *ModelArtifactListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type ModelArtifactRepository

type ModelArtifactRepository interface {
	GetByID(id int32) (ModelArtifact, error)
	List(listOptions ModelArtifactListOptions) (*ListWrapper[ModelArtifact], error)
	Save(modelArtifact ModelArtifact, parentResourceID *int32) (ModelArtifact, error)
}

type ModelVersion

type ModelVersion interface {
	Entity[ModelVersionAttributes]
}

type ModelVersionAttributes

type ModelVersionAttributes struct {
	Name                     *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ModelVersionImpl

type ModelVersionImpl = BaseEntity[ModelVersionAttributes]

type ModelVersionListOptions

type ModelVersionListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
}

func (*ModelVersionListOptions) GetRestEntityType added in v0.3.0

func (m *ModelVersionListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type ModelVersionRepository

type ModelVersionRepository interface {
	GetByID(id int32) (ModelVersion, error)
	List(listOptions ModelVersionListOptions) (*ListWrapper[ModelVersion], error)
	Save(model ModelVersion) (ModelVersion, error)
}

type Pagination

type Pagination struct {
	PageSize      *int32  `json:"pageSize,omitempty"`
	OrderBy       *string `json:"orderBy,omitempty"`
	SortOrder     *string `json:"sortOrder,omitempty"`
	NextPageToken *string `json:"nextPageToken,omitempty"`
	FilterQuery   *string `json:"filterQuery,omitempty"`
}

func (*Pagination) GetFilterQuery added in v0.3.0

func (p *Pagination) GetFilterQuery() string

func (*Pagination) GetNextPageToken

func (p *Pagination) GetNextPageToken() string

func (*Pagination) GetOrderBy

func (p *Pagination) GetOrderBy() string

func (*Pagination) GetPageSize

func (p *Pagination) GetPageSize() int32

func (*Pagination) GetSortOrder

func (p *Pagination) GetSortOrder() string

func (*Pagination) SetNextPageToken added in v0.3.0

func (p *Pagination) SetNextPageToken(token *string)

type Parameter added in v0.3.0

type Parameter interface {
	Entity[ParameterAttributes]
}

type ParameterAttributes added in v0.3.0

type ParameterAttributes struct {
	Name                     *string
	URI                      *string
	State                    *string
	ArtifactType             *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ParameterImpl added in v0.3.0

type ParameterImpl = BaseEntity[ParameterAttributes]

type ParameterListOptions added in v0.3.0

type ParameterListOptions struct {
	Pagination
	Name             *string
	ExternalID       *string
	ParentResourceID *int32
}

type ParameterRepository added in v0.3.0

type ParameterRepository interface {
	GetByID(id int32) (Parameter, error)
	List(listOptions ParameterListOptions) (*ListWrapper[Parameter], error)
	Save(parameter Parameter, parentResourceID *int32) (Parameter, error)
}

type Properties

type Properties struct {
	Name             string
	IsCustomProperty bool
	IntValue         *int32
	DoubleValue      *float64
	StringValue      *string
	BoolValue        *bool
	ByteValue        *[]byte
	ProtoValue       *[]byte
}

func NewBoolProperty added in v0.3.2

func NewBoolProperty(name string, value bool, isCustom bool) Properties

NewBoolProperty creates a bool property

func NewByteProperty added in v0.3.2

func NewByteProperty(name string, value []byte, isCustom bool) Properties

NewByteProperty creates a byte property

func NewDoubleProperty added in v0.3.2

func NewDoubleProperty(name string, value float64, isCustom bool) Properties

NewDoubleProperty creates a double property

func NewIntProperty added in v0.3.2

func NewIntProperty(name string, value int32, isCustom bool) Properties

NewIntProperty creates an int property

func NewStringProperty added in v0.3.2

func NewStringProperty(name string, value string, isCustom bool) Properties

NewStringProperty creates a string property

func (*Properties) SetInt64Value added in v0.3.2

func (p *Properties) SetInt64Value(n int64)

type RegisteredModel

type RegisteredModel interface {
	Entity[RegisteredModelAttributes]
}

type RegisteredModelAttributes

type RegisteredModelAttributes struct {
	Name                     *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type RegisteredModelImpl

type RegisteredModelImpl = BaseEntity[RegisteredModelAttributes]

type RegisteredModelListOptions

type RegisteredModelListOptions struct {
	Pagination
	Name       *string
	ExternalID *string
}

func (*RegisteredModelListOptions) GetRestEntityType added in v0.3.0

func (r *RegisteredModelListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type RegisteredModelRepository

type RegisteredModelRepository interface {
	GetByID(id int32) (RegisteredModel, error)
	List(listOptions RegisteredModelListOptions) (*ListWrapper[RegisteredModel], error)
	Save(model RegisteredModel) (RegisteredModel, error)
}

type ServeModel

type ServeModel interface {
	Entity[ServeModelAttributes]
}

type ServeModelAttributes

type ServeModelAttributes struct {
	Name                     *string
	ExternalID               *string
	LastKnownState           *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ServeModelImpl

type ServeModelImpl = BaseEntity[ServeModelAttributes]

type ServeModelListOptions

type ServeModelListOptions struct {
	Pagination
	Name               *string
	ExternalID         *string
	InferenceServiceID *int32
}

func (*ServeModelListOptions) GetRestEntityType added in v0.3.0

func (s *ServeModelListOptions) GetRestEntityType() filter.RestEntityType

GetRestEntityType implements the FilterApplier interface

type ServeModelRepository

type ServeModelRepository interface {
	GetByID(id int32) (ServeModel, error)
	List(listOptions ServeModelListOptions) (*ListWrapper[ServeModel], error)
	Save(serveModel ServeModel, inferenceServiceID *int32) (ServeModel, error)
}

type ServingEnvironment

type ServingEnvironment interface {
	Entity[ServingEnvironmentAttributes]
}

type ServingEnvironmentAttributes

type ServingEnvironmentAttributes struct {
	Name                     *string
	ExternalID               *string
	CreateTimeSinceEpoch     *int64
	LastUpdateTimeSinceEpoch *int64
}

type ServingEnvironmentListOptions

type ServingEnvironmentListOptions struct {
	Pagination
	Name       *string
	ExternalID *string
}

type ServingEnvironmentRepository

type ServingEnvironmentRepository interface {
	GetByID(id int32) (ServingEnvironment, error)
	List(listOptions ServingEnvironmentListOptions) (*ListWrapper[ServingEnvironment], error)
	Save(model ServingEnvironment) (ServingEnvironment, error)
}

type Type

type Type interface {
	GetID() *int32
	GetAttributes() *TypeAttributes
}

type TypeAttributes

type TypeAttributes struct {
	Name        *string
	Version     *string
	TypeKind    *int32
	Description *string
	InputType   *string
	OutputType  *string
	ExternalID  *string
}

type TypeImpl

type TypeImpl struct {
	ID         *int32
	Attributes *TypeAttributes
}

func (*TypeImpl) GetAttributes

func (t *TypeImpl) GetAttributes() *TypeAttributes

func (*TypeImpl) GetID

func (t *TypeImpl) GetID() *int32

type TypeProperty added in v0.3.2

type TypeProperty interface {
	GetTypeID() int32
	GetName() string
	GetDataType() *int32
}

type TypePropertyImpl added in v0.3.2

type TypePropertyImpl struct {
	TypeID   int32
	Name     string
	DataType *int32
}

func (*TypePropertyImpl) GetDataType added in v0.3.2

func (tp *TypePropertyImpl) GetDataType() *int32

func (*TypePropertyImpl) GetName added in v0.3.2

func (tp *TypePropertyImpl) GetName() string

func (*TypePropertyImpl) GetTypeID added in v0.3.2

func (tp *TypePropertyImpl) GetTypeID() int32

type TypePropertyRepository added in v0.3.2

type TypePropertyRepository interface {
	// Save stores a type property if it doesn't exist.
	Save(tp TypeProperty) (TypeProperty, error)
}

type TypeRepository

type TypeRepository interface {
	// GetAll returns every registered type.
	GetAll() ([]Type, error)

	// Save updates a type, if the definition differs from what's stored.
	Save(t Type) (Type, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL