diff --git a/api/desc/inference/inference.api b/api/desc/inference/inference.api index f227a39f..c47fb20e 100644 --- a/api/desc/inference/inference.api +++ b/api/desc/inference/inference.api @@ -3,38 +3,33 @@ syntax = "v1" type ( InferOption { TaskName string `json:"taskName"` - // AdapterId string `json:"adapterId"` - // AiClusterIds []string `json:"aiClusterIds"` - // ResourceType string `json:"resourceType"` - // ComputeCard string `json:"card"` - // Tops float64 `json:"Tops,optional"` - // TaskType string `json:"taskType"` - // Datasets string `json:"datasets"` - // Algorithm string `json:"algorithm"` - // Strategy string `json:"strategy"` - // StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` - // Params []string `json:"params,optional"` - // Envs []string `json:"envs,optional"` - // Cmd string `json:"cmd,optional"` - // Replica int32 `json:"replicas"` + TaskType string `json:"taskType"` + AdapterId string `json:"adapterId"` + AiClusterIds []string `json:"aiClusterIds"` + ResourceType string `json:"resourceType"` + ComputeCard string `json:"card"` + Strategy string `json:"strategy"` + StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` + Params []string `json:"params,optional"` + Envs []string `json:"envs,optional"` + Cmd string `json:"cmd,optional"` + Replica int32 `json:"replicas,optional"` } /******************image inference*************************/ ImageInferenceReq { InferOption *InferOption `json:"inferOption,optional"` - Images []string `form:"images"` } ImageInferenceResp { + InferResults []*ImageResult `json:"result"` } -// InferResult { -// ClusterId string `json:"clusterId"` -// TaskId string `json:"taskId"` -// Card string `json:"card"` -// Strategy string `json:"strategy"` -// JobId string `json:"jobId"` -// Replica int32 `json:"replica"` -// Msg string `json:"msg"` -// } + ImageResult { + ClusterId string `json:"clusterId"` + ClusterName string `json:"clusterName"` + ImageName string `json:"imageName"` + Card string `json:"card"` + ImageResult string `json:"imageResult"` + } ) diff --git a/api/internal/types/types.go b/api/internal/types/types.go index c7048880..e45a6d7e 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -5880,13 +5880,32 @@ type Category struct { } type InferOption struct { - TaskName string `json:"taskName"` + TaskName string `json:"taskName"` + TaskType string `json:"taskType"` + AdapterId string `json:"adapterId"` + AiClusterIds []string `json:"aiClusterIds"` + ResourceType string `json:"resourceType"` + ComputeCard string `json:"card"` + Strategy string `json:"strategy"` + StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` + Params []string `json:"params,optional"` + Envs []string `json:"envs,optional"` + Cmd string `json:"cmd,optional"` + Replica int32 `json:"replicas,optional"` } type ImageInferenceReq struct { InferOption *InferOption `json:"inferOption,optional"` - Images []string `form:"images"` } type ImageInferenceResp struct { + InferResults []*ImageResult `json:"result"` +} + +type ImageResult struct { + ClusterId string `json:"clusterId"` + ClusterName string `json:"clusterName"` + ImageName string `json:"imageName"` + Card string `json:"card"` + ImageResult string `json:"imageResult"` }