UpdateVocab - 修改热词

根据词表的ID可以更新对应的词表信息,包括词表名称、词表描述信息、词表的词和权重。

接口说明

请确保在使用该接口前,已充分了解通义晓蜜 CCAI-对话分析 AIO 产品的收费方式和价格。

前提条件

  • 已开通通义晓蜜 CCAI-对话分析 AIO 服务。
  • 已创建应用:应用中心完成通义晓蜜 CCAI-对话分析 AIO 应用创建,并获取到 APP-ID 和 WORKSPACE-ID:获取 APP-ID 和 WORKSPACE-ID

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

POST /vocab/updateVocab HTTP/1.1

请求参数

名称类型必填描述示例值
bodyobject

请求 Body

vocabularyIdstring

热词 id

dsvsv***dsvv
namestring

名称

热词1
descriptionstring

描述

销售热词
wordWeightListarray<object>

热词组

object

热词组

wordstring

单词

虹桥
weightinteger

权重

2
workspaceIdstring

业务空间 ID

llm-jhfr****w8v

请求代码示例


import com.alibaba.fastjson.JSONObject;
import com.aliyun.contactcenterai20240603.Client;
import com.aliyun.contactcenterai20240603.models.*;
import com.aliyun.teaopenapi.models.Config;

import java.util.ArrayList;
import java.util.List;

public class Vocab {

    private static String accessKeyId = "YOUR_ACCESS_KEY_ID";
    private static String accessKeySecret = "YOUR_ACCESS_KEY_SECRET";


    private static String workspaceId = "YOUR_WORKSPACE_ID";

    private static Config config = new Config();

    static {
        config.setAccessKeyId(accessKeyId).setAccessKeySecret(accessKeySecret).setEndpoint("contactcenterai.cn-shanghai.aliyuncs.com")
                .setReadTimeout(30000).setConnectTimeout(300000).setRegionId("cn-shanghai").setProtocol("HTTPS");
    }

    public static void main(String[] args) throws Exception {
        Client client = new Client(config);

        UpdateVocabRequest request = new UpdateVocabRequest();
        request.setVocabularyId("f3d82e0d********d23bd7");
        request.setName("销售热词");
        request.setDescription("南方一区销售热词");
        request.setWorkspaceId(workspaceId);

        List<UpdateVocabRequest.UpdateVocabRequestWordWeightList> wordWeightList = new ArrayList<>();
        UpdateVocabRequest.UpdateVocabRequestWordWeightList word1 = new UpdateVocabRequest.UpdateVocabRequestWordWeightList();
        word1.setWord("欧洲");
        word1.setWeight(4);
        wordWeightList.add(word1);

        UpdateVocabRequest.UpdateVocabRequestWordWeightList word2 = new UpdateVocabRequest.UpdateVocabRequestWordWeightList();
        word2.setWord("耳痛");
        word2.setWeight(2);
        wordWeightList.add(word2);

        request.setWordWeightList(wordWeightList);

        UpdateVocabResponse response = client.updateVocab(request);
        System.out.println(JSONObject.toJSONString(response));
    }
}

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

请求 id

968A8634-FA2C-5381-9B3E-*******F
successstring

请求是否成功

true
datastring

返回数据

true

示例

正常返回示例

JSON格式

{
  "requestId": "968A8634-FA2C-5381-9B3E-*******F",
  "success": "true",
  "data": "true"
}

错误码

HTTP status code错误码错误信息描述
400CCAI.InvalidParam.NotExistThe specified parameter %s is not valid.请求API的参数不存在
400CCAI.ParamInvalid.IllegalParamValueThe parameter value of the request API is illegal %s.请求API的参数不合法
400CCAI.Throttling.QpmTrigger QPM flow restriction. Please purchase higher QPM for paid API. If free API has special requirements, please contact us through DingTalk group (62730018475).触发QPM限流,付费API请购买更高QPM,免费API如有特殊需求,请通过钉钉群(62730018475)联系我们。
400CCAI.Throttling.QpsTrigger current QPS limit, pay API please buy higher QPS, the free API if you have special requirements, please contact us through the DingTalk group (62730018475).触发限流,付费API请购买更高QPS,免费API如有特殊需求,请通过钉钉群(62730018475)联系我们。
403CCAI.IllegalPermission.NoAuthUser not authorized to operate on the specified resource.该用户未被授权可操作指定资源
403CCAI.ParamNotfound.MissParamParameter verification failed, The specified parameter %s is missing.参数校验失败,指定参数缺失。
403CCAI.TenantPermission.NoAuthThe current account does not have the permission to specify the business space. Please authorize the business space permission.当前账号没有指定业务空间的权限,请进行业务空间权限授权。
500CCAI.InternalErrorThe request processing has failed due to some unknown error, exception or failure.系统内部错误,请稍后重试

访问错误中心查看更多错误码。