package inference

import (
	"context"
	"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option"
	"mime/multipart"
)

const (
	FORWARD_SLASH = "/"
)

type ICluster interface {
	GetClusterInferUrl(ctx context.Context, option *option.InferOption) (*ClusterInferUrl, error)
	GetInferDeployInstanceList(ctx context.Context) ([]*DeployInstance, error)
	StartInferDeployInstance(ctx context.Context, id string) bool
	StopInferDeployInstance(ctx context.Context, id string) bool
	GetInferDeployInstance(ctx context.Context, id string) (*DeployInstance, error)
	CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error)
	CheckModelExistence(ctx context.Context, modelName string, modelType string) bool
	InferResult
}

type InferResult interface {
	GetImageInferResult(ctx context.Context, url string, file multipart.File, fileName string) (string, error)
}

type IInference interface {
	CreateTask() (int64, error)
	InferTask(id int64) error
}

type Inference struct {
	In IInference
}

type ClusterInferUrl struct {
	ClusterName string
	ClusterType string
	InferUrls   []*InferUrl
}

type InferUrl struct {
	Url  string
	Card string
}

type DeployInstance struct {
	InstanceName string
	InstanceId   string
	ModelName    string
	ModelType    string
	InferCard    string
	InferUrl     string
	ClusterName  string
	ClusterType  string
	Status       string
	CreatedTime  string
}
