core端创建算法查询算法
This commit is contained in:
parent
65157f3739
commit
1762f23ab3
|
@ -373,7 +373,7 @@ type I18NDescription {
|
|||
Description string `json:"description,optional"`
|
||||
}
|
||||
type ConstraintAlRq {
|
||||
Type string `son:"type,optional"`
|
||||
Type string `json:"type,optional"`
|
||||
Editable bool `json:"editable,optional"`
|
||||
Required bool `json:"required,optional"`
|
||||
Sensitive bool `json:"sensitive,optional"`
|
||||
|
@ -403,27 +403,32 @@ type ResourceRequirements {
|
|||
Value []string `json:"value,optional"`
|
||||
Operator string `json:"operator,optional"`
|
||||
}
|
||||
type ResourceRequirementsAlRq {
|
||||
Key string `json:"key,optional"`
|
||||
Value []string `json:"value,optional"`
|
||||
Operator string `json:"operator,optional"`
|
||||
}
|
||||
|
||||
type AdvancedConfigAl {
|
||||
AutoSearch AutoSearch `json:"auto_search,optional"`
|
||||
}
|
||||
|
||||
type AutoSearch {
|
||||
SkipSearchParams string `json:"skip_search_params,optional"`
|
||||
RewardAttrs []RewardAttrs `json:"reward_attrs,optional"`
|
||||
SearchParams []SearchParams `json:"search_params,optional"`
|
||||
AlgoConfigs []AlgoConfigs `json:"algo_configs,optional"`
|
||||
SkipSearchParams string `json:"skip_search_params,omitempty"`
|
||||
RewardAttrs []RewardAttrs `json:"reward_attrs,omitempty"`
|
||||
SearchParams []SearchParams `json:"search_params,omitempty"`
|
||||
AlgoConfigs []AlgoConfigs `json:"algo_configs,omitempty"`
|
||||
}
|
||||
|
||||
type AlgoConfigs {
|
||||
Name string `json:"name,optional"`
|
||||
AutoSearchAlgoConfigParameterAlRp []AutoSearchAlgoConfigParameterAlRp `json:"params,optional"`
|
||||
Name string `json:"name,omitempty"`
|
||||
AutoSearchAlgoConfigParameterAlRp []AutoSearchAlgoConfigParameterAlRp `json:"params,omitempty"`
|
||||
}
|
||||
|
||||
type AutoSearchAlgoConfigParameterAlRp {
|
||||
Key string `json:"key,optional"`
|
||||
Value string `json:"value,optional"`
|
||||
Type string `json:"type,optional"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type RewardAttrs {
|
||||
|
@ -604,16 +609,16 @@ type ShareInfo {
|
|||
|
||||
type (
|
||||
CreateAlgorithmReq {
|
||||
MetadataCARq MetadataAlRq `json:"metadata,optional"`
|
||||
JobConfigCARq JobConfigAl `json:"job_config,optional"`
|
||||
ResourceRequirementsCARq []ResourceRequirements `json:"resource_requirements,optional"`
|
||||
AdvancedConfigCARq AdvancedConfigAl `json:"advanced_config,optional"`
|
||||
ProjectIdCARq string `json:"project_id"`
|
||||
ProjectIdCARq string `json:"project_id"`
|
||||
MetadataCARq MetadataAlRq `json:"metadata,optional"`
|
||||
JobConfigCARq JobConfigAl `json:"job_config,optional"`
|
||||
ResourceRequirementsCARq []ResourceRequirementsAlRq `json:"resource_requirements,omitempty"` //?
|
||||
AdvancedConfigCARq AdvancedConfigAl `json:"advanced_config,omitempty"`
|
||||
}
|
||||
CreateAlgorithmResp {
|
||||
MetadataCARp MetadataAlRp `json:"metadata,optional"`
|
||||
Share_infoCARp ShareInfo `json:"share_info,optional"`
|
||||
JobConfigCARp JobConfigAl `json:"job_config,optional"`
|
||||
MetadataCARp MetadataAlRp `json:"metadata"`
|
||||
ShareInfoCARp ShareInfo `json:"share_info"`
|
||||
JobConfigCARp JobConfigAl `json:"job_config"`
|
||||
ResourceRequirementsCARp []ResourceRequirements `json:"resource_requirements,optional"`
|
||||
AdvancedConfigCARp AdvancedConfigAl `json:"advanced_config,optional"`
|
||||
}
|
||||
|
|
|
@ -30,13 +30,13 @@ func NewCreateAlgorithmLogic(ctx context.Context, svcCtx *svc.ServiceContext) *C
|
|||
|
||||
func (l *CreateAlgorithmLogic) CreateAlgorithm(req *types.CreateAlgorithmReq) (resp *types.CreateAlgorithmResp, err error) {
|
||||
modelartsReq := &modelarts.CreateAlgorithmReq{}
|
||||
err = copier.CopyWithOption(modelartsReq, req, copier.Option{Converters: tool.Converters})
|
||||
err = copier.CopyWithOption(modelartsReq, req, copier.Option{IgnoreEmpty: true, DeepCopy: true, Converters: tool.Converters})
|
||||
ListAlgorithmsResp, err := l.svcCtx.ModelArtsRpc.CreateAlgorithm(l.ctx, modelartsReq)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db DataSet list"), "Failed to get db DataSet list err : %v ,req:%+v", err, req)
|
||||
}
|
||||
resp = &types.CreateAlgorithmResp{}
|
||||
err = copier.CopyWithOption(&resp, &ListAlgorithmsResp, copier.Option{Converters: tool.Converters})
|
||||
err = copier.CopyWithOption(&resp, &ListAlgorithmsResp, copier.Option{IgnoreEmpty: true, DeepCopy: true, Converters: tool.Converters})
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db DataSet list"), "Failed to get db DataSet list err : %v ,req:%+v", err, req)
|
||||
}
|
||||
|
|
|
@ -626,28 +626,28 @@ message AdvancedConfigAl {
|
|||
}
|
||||
|
||||
message MetadataAlRq {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
string workspace_id = 4;
|
||||
string ai_project = 5;
|
||||
string id = 1; // @gotags: copier:"Id"
|
||||
string name = 2; // @gotags: copier:"Name"
|
||||
string description = 3; // @gotags: copier:"Description"
|
||||
string workspace_id = 4; // @gotags: copier:"WorkspaceId"
|
||||
string ai_project = 5; // @gotags: copier:"AiProject"
|
||||
}
|
||||
|
||||
message ConstraintAlRq {
|
||||
string type = 1;
|
||||
bool editable = 2;
|
||||
bool required = 3;
|
||||
bool sensitive = 4;
|
||||
string valid_type = 5;
|
||||
repeated string valid_range= 6;
|
||||
string type = 1; // @gotags: copier:"Type"
|
||||
bool editable = 2; // @gotags: copier:"Editable"
|
||||
bool required = 3; // @gotags: copier:"Required"
|
||||
bool sensitive = 4; // @gotags: copier:"Sensitive"
|
||||
string valid_type = 5; // @gotags: copier:"ValidType"
|
||||
repeated string valid_range= 6; // @gotags: copier:"ValidRange"
|
||||
}
|
||||
|
||||
message ParametersAlRq {
|
||||
string name = 1;
|
||||
string description = 2;
|
||||
i18n_description i18n_description = 3;
|
||||
string value = 4;
|
||||
ConstraintAlRq constraint = 5;
|
||||
string name = 1; // @gotags: copier:"Name"
|
||||
string description = 2; // @gotags: copier:"Description"
|
||||
i18n_description i18n_description = 3;// @gotags: copier:"I18NDescription"
|
||||
string value = 4;// @gotags: copier:"Value"
|
||||
ConstraintAlRq constraint = 5;// @gotags: copier:"Constraint"
|
||||
}
|
||||
|
||||
message InputsAlRq {
|
||||
|
@ -701,30 +701,30 @@ message JobConfigAl {
|
|||
//出参
|
||||
message CreateAlgorithmResp{
|
||||
MetadataCrAl metadata = 1; // @gotags: copier:"MetadataCARp"
|
||||
ShareInfo share_info = 2; // @gotags: copier:"Share_infoCARp"
|
||||
ShareInfo share_info = 2; // @gotags: copier:"ShareInfoCARp"
|
||||
JobConfigAl job_config = 3; // @gotags: copier:"JobConfigCARp"
|
||||
repeated ResourceRequirements resource_requirements= 4;// @gotags: copier:"ResourceRequirementsCARp"
|
||||
AdvancedConfigAl advanced_config = 5;// @gotags: copier:"AdvancedConfigCARp"
|
||||
}
|
||||
message ShareInfo{}
|
||||
message MetadataCrAl {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
int32 create_time = 4;
|
||||
string workspace_id = 5;
|
||||
string ai_project = 6;
|
||||
string user_name = 7;
|
||||
string domain_id = 8;
|
||||
string source = 9;
|
||||
string api_version = 10;
|
||||
bool is_valid = 11;
|
||||
string state = 12;
|
||||
int32 size = 13;
|
||||
repeated TagsAlRp tags = 14;
|
||||
repeated string attr_list = 15;
|
||||
int32 version_num = 16;
|
||||
int32 update_time = 17;
|
||||
string id = 1; // @gotags: copier:"Id"
|
||||
string name = 2; // @gotags: copier:"Name"
|
||||
string description = 3; // @gotags: copier:"Description"
|
||||
int32 create_time = 4; // @gotags: copier:"CreateTime"
|
||||
string workspace_id = 5; // @gotags: copier:"WorkspaceId"
|
||||
string ai_project = 6; // @gotags: copier:"AiProject"
|
||||
string user_name = 7; // @gotags: copier:"UserName"
|
||||
string domain_id = 8; // @gotags: copier:"DomainId"
|
||||
string source = 9; // @gotags: copier:"Source"
|
||||
string api_version = 10; // @gotags: copier:"ApiVersion"
|
||||
bool is_valid = 11; // @gotags: copier:"IsValid"
|
||||
string state = 12; // @gotags: copier:"State"
|
||||
int32 size = 13; // @gotags: copier:"Size"
|
||||
repeated TagsAlRp tags = 14; // @gotags: copier:"Tags"
|
||||
repeated string attr_list = 15; // @gotags: copier:"AttrList"
|
||||
int32 version_num = 16; // @gotags: copier:"VersionNum"
|
||||
int32 update_time = 17; // @gotags: copier:"UpdateTime"
|
||||
}
|
||||
message MetadataAlRp {
|
||||
string id = 1;
|
||||
|
|
Loading…
Reference in New Issue