CreateCommands - 创建自定义指令

创建自定义指令。

服务接入点与授权信息

产品 资源 所需权限
通义灵码 自定义指令 读写

请求语法

POST https://{domain}/oapi/v1/lingma/organizations/{organizationId}/commands

请求头

参数 类型 是否必填 描述 示例值
x-yunxiao-token string 个人访问令牌。 pt-0fh3****0fbG_35af****0484

请求参数

参数 类型 位置 是否必填 描述 示例值
organizationId string path 所属企业 ID。
- object body
      operatorId string body 指令操作人id
      commands array[] body
            - object body 自定义指令详情
                  displayName string body 指令名称。
                  name string body 指令英文名称。
                  description string body 指令描述。
                  imageUrl string body 指令图标。
                  type string body 指令类型。 prompt
                  visibility string body 可见性。 public/private
                  contexts array[] body 指令上下文。
                        - object body
                              identifier string body 上下文id。
                              optional string body 是否必选。 N/Y
                  config string body 指令配置(prompt对应JSON字符串)。

请求示例

curl -X 'POST' \
  'https://test.rdc.aliyuncs.com/oapi/v1/lingma/organizations/{organizationId}/commands' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '{
          "operatorId": "",
          "commands": [
            {
                "displayName": "",
                "name": "",
                "description": "",
                "imageUrl": "",
                "type": "",
                "visibility": "",
                "contexts": [
                    {
                        "identifier": "",
                        "optional": ""
                    }
                ],
                "config": ""
            }
          ]
        }'

返回参数

参数 类型 描述 示例值
- array[]
      - string 自定义指令id。

返回示例

[
    "commandId1",
    "commandId2"
]

错误码

访问错误码中心查看 API 相关错误码。

results matching ""

    No results matching ""