更新时间:2025-03-12 gmt 08:00

创建执行动作-j9九游会登录

功能介绍

该接口用于为工具创建执行动作。

调用方法

请参见。

uri

post https://aiae.appstage.myhuaweicloud.com/v1/workflow-adapter-open/connectors/{connector_id}/actions

表1 路径参数

参数

是否必选

参数类型

描述

connector_id

string

参数解释:

工具id,进入ai原生应用引擎,在左侧导航栏选择“agent编排中心 > 我的工具”,在工具列表中复制工具id。

约束限制:

不涉及。

取值范围:

只能由英文字母、数字以及“-”组成,且长度为36个字符。

默认取值:

不涉及。

请求参数

表2 请求header参数

参数

是否必选

参数类型

描述

authorization

string

参数解释:

鉴权信息。获取平台api key,并为api key添加前缀bearer,得到标准鉴权信息,例如bearer sk-74e4157***。api key获取方法请参见创建api key

约束限制:

不涉及。

取值范围:

不涉及。

默认取值:

不涉及。

表3 请求body参数

参数

是否必选

参数类型

描述

name

string

参数解释:

执行动作的名称。

约束限制:

只能由中英文、数字、下划线、中划线、英文小括号组成,只能使用中英文以及数字开头,且长度不能超过32个字符。

description

string

参数解释:

执行动作的描述。

约束限制:

只能包含中英文、数字、下划线、中划线、空格及,.?:;"':;“”‘’,。?、()()/@!!*%#等,且长度不能超过256个字符。

english_name

string

参数解释:

执行动作的英文名称。

约束限制:

只能由英文、数字、下划线、中划线、英文小括号组成,只能使用英文以及数字开头,且长度不能超过32个字符。

swagger

swagger object

参数解释:

执行动作的swagger结构。

约束限制:

不涉及。

表4 swagger

参数

是否必选

参数类型

描述

paths

paths object

参数解释:

执行动作的swagger结构。

约束限制:

不涉及。

表5 paths

参数

是否必选

参数类型

描述

path

path object

参数解释:

执行动作的swagger结构,本字段的名称与接口路径相同,比如接口路径为/test,此处的key应将path替换为/test。

约束限制:

不涉及。

表6 path

参数

是否必选

参数类型

描述

post

post object

参数解释:

执行动作的调用方法,本字段的名称与接口的请求方式相同。

约束限制:

不涉及。

表7 post

参数

是否必选

参数类型

描述

operationid

string

参数解释:

执行动作的操作id,随机的uuid。

约束限制:

只由英文字母、数字以及“-”组成,且长度为36个字符。

x-hw-visibility

boolean

参数解释:

可见性。

约束限制:

填写none即可,表示当前执行动作在流中可以正常显示。

description

string

参数解释:

执行动作的描述。

约束限制:

只能包含中英文、数字、下划线、中划线、空格及,.?:;"':;“”‘’,。?、()()/@!!*%#等,且长度不能超过256个字符。

summary

string

参数解释:

执行动作的名称。

约束限制:

只能由中英文、数字、下划线、中划线、英文小括号组成,只能使用中英文以及数字开头,且长度不能超过32个字符。

parameters

array of parameters objects

参数解释:

执行动作的参数。

约束限制:

不涉及。

response

response object

参数解释:

执行动作的响应参数。

约束限制:

不涉及。

consumes

string

参数解释:

执行动作接收的请求体格式。

约束限制:

application/json等常用http请求格式。

produces

string

参数解释:

执行动作返回的响应体格式。

约束限制:

application/json等常用http响应格式。

表8 parameters

参数

是否必选

参数类型

描述

in

string

参数解释:

参数位置。

约束限制:

可以填写body、header、query、path,分别表示参数在请求体、请求头、查询参数、路径参数中。

name

string

参数解释:

参数名称。

约束限制:

不涉及。

description

string

参数解释:

参数描述。

约束限制:

不涉及。

x-hw-body-required

boolean

参数解释:

请求体是否必填。

约束限制:

填true即可。

schema

object

参数解释:

入参结构,进入ai原生应用引擎,在左侧导航栏选择“agent编排中心 > 我的工具”,在工具列表中展开执行动作列表,单击执行动作列表操作列的“编辑”。单击“下一步”,在“配置输入”页面单击“复制”进行获取。

约束限制:

不涉及。

x-hw-xml-header

string

参数解释:

xml格式入参的头格式。

约束限制:

不涉及。

表9 response

参数

是否必选

参数类型

描述

200

200 object

参数解释:

请求成功时的响应参数。

约束限制:

不涉及。

表10 200

参数

是否必选

参数类型

描述

description

string

参数解释:

请求成功。

约束限制:

填写“请求成功”。

schema

object

参数解释:

响应参数结构,进入ai原生应用引擎,在左侧导航栏选择“agent编排中心 > 我的工具”,在工具列表中展开执行动作列表,单击执行动作列表操作列的“编辑”。单击“下一步”,在“配置输出”页面单击“复制”进行获取。

约束限制:

不涉及。

headers

object

参数解释:

响应参数结构,进入ai原生应用引擎,在左侧导航栏选择“agent编排中心 > 我的工具”,在工具列表中展开执行动作列表,单击执行动作列表操作列的“编辑”。单击“下一步”,在“配置输出”页面单击“复制”进行获取。

约束限制:

不涉及。

x-hw-xml-header

string

参数解释:

xml格式响应参数的头格式。

约束限制:

不涉及。

响应参数

状态码:200

表11 响应body参数

参数

参数类型

描述

-

string

参数解释:

创建出的工具的id。

约束限制:

不涉及。

状态码:500

表12 响应body参数

参数

参数类型

描述

error_code

string

参数解释:

错误码。

取值范围:

不涉及。

error_msg

string

参数解释:

错误信息。

取值范围:

不涉及。

请求示例

{
  "swagger" : {
    "paths" : {
      "/test" : {
        "post" : {
          "operationid" : "1234567-1234-1234-123451234512",
          "x-hw-visibility" : "none",
          "description" : "example description",
          "summary" : "example name",
          "parameters" : [ {
            "in" : "body",
            "name" : "body",
            "description" : "",
            "x-hw-body-required" : true,
            "schema" : {
              "properties" : {
                "input" : {
                  "description" : "input",
                  "default" : "",
                  "x-hw-default" : "",
                  "type" : "string",
                  "x-hw-label" : "input",
                  "format" : "input",
                  "x-hw-format" : "input",
                  "x-hw-select-options" : [ ]
                }
              },
              "required" : [ "input" ],
              "type" : "object",
              "xml" : null
            },
            "x-hw-xml-header" : null
          } ],
          "response" : {
            "200" : {
              "description" : "请求成功",
              "schema" : {
                "properties" : {
                  "output" : {
                    "description" : "输出",
                    "default" : "",
                    "x-hw-default" : "",
                    "type" : "string",
                    "x-hw-label" : "output",
                    "x-hw-visibility" : "none",
                    "format" : "input",
                    "x-hw-format" : "input",
                    "x-hw-select-options" : [ ]
                  }
                },
                "type" : "object",
                "xml" : null
              },
              "headers" : { },
              "x-hw-xml-header" : null
            }
          },
          "x-model" : {
            "input-mappingconfig" : {
              "rules" : [ ]
            },
            "input-is-model-mapping" : false,
            "input-model" : { },
            "output-mappingconfig" : {
              "rules" : [ ]
            },
            "output-is-model-mapping" : false,
            "output-model" : { }
          },
          "consumes" : [ "application/json" ],
          "produces" : [ "application/json" ]
        }
      }
    }
  },
  "name" : "example name",
  "description" : "example description",
  "english_name" : "example english name"
}

响应示例

状态码:200

成功。

{
  "data" : "tool id"
}

状态码:500

服务器内部错误或三方服务器内部错误。

{
  "error_code" : "aiae.22009001",
  "error_msg" : "internal server error."
}

状态码

状态码

描述

200

成功。

500

服务器内部错误或三方服务器内部错误。

错误码

请参见错误码

相关文档

网站地图