Skip to content

Commit 0ce0067

Browse files
committed
fix(ai): allow empty bizTags to clear all tags for Prompt, Skill and AgentSpec
Remove the bizTags non-blank validation in PromptBizTagsUpdateForm, SkillBizTagsUpdateForm, and AgentSpecBizTagsUpdateForm. Passing empty or null bizTags is a valid operation that means clearing all tags, and the service layer already handles this correctly. 🤖 Generated with [Qoder][https://qoder.com]
1 parent 35117f8 commit 0ce0067

3 files changed

Lines changed: 0 additions & 15 deletions

File tree

ai/src/main/java/com/alibaba/nacos/ai/form/agentspecs/admin/AgentSpecBizTagsUpdateForm.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ public void validate() throws NacosApiException {
4545
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
4646
"Request parameter `agentSpecName` should not be blank.");
4747
}
48-
if (StringUtils.isBlank(bizTags)) {
49-
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
50-
"Request parameter `bizTags` should not be blank.");
51-
}
5248
}
5349

5450
public String getBizTags() {

ai/src/main/java/com/alibaba/nacos/ai/form/prompt/PromptBizTagsUpdateForm.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616

1717
package com.alibaba.nacos.ai.form.prompt;
1818

19-
import com.alibaba.nacos.api.exception.NacosException;
2019
import com.alibaba.nacos.api.exception.api.NacosApiException;
21-
import com.alibaba.nacos.api.model.v2.ErrorCode;
22-
import com.alibaba.nacos.common.utils.StringUtils;
2320

2421
import java.io.Serial;
2522

@@ -41,10 +38,6 @@ public class PromptBizTagsUpdateForm extends PromptForm {
4138
@Override
4239
public void validate() throws NacosApiException {
4340
super.validate();
44-
if (StringUtils.isBlank(bizTags)) {
45-
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
46-
"Required parameter 'bizTags' type String is not present");
47-
}
4841
}
4942

5043
public String getBizTags() {

ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillBizTagsUpdateForm.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ public void validate() throws NacosApiException {
4545
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
4646
"Request parameter `skillName` should not be blank.");
4747
}
48-
if (StringUtils.isBlank(bizTags)) {
49-
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
50-
"Request parameter `bizTags` should not be blank.");
51-
}
5248
}
5349

5450
public String getBizTags() {

0 commit comments

Comments
 (0)