ExecuteChat - 进行智能问答对话

智能问答。

服务接入点与授权信息

产品 资源 所需权限
通义灵码 智能问答 读写

请求语法

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

请求头

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

请求参数

参数 类型 位置 是否必填 描述 示例值
organizationId string path 所属企业 ID。
stream string query 是否使用流式问答,true/false。
teamDocs string query 是否使用企业知识库,true/false。
- object body
      input object body 输入数据。
            messages array body 历史消息,以 role-content 形式组成,系统角色需要放在最前面,然后跟历史或示例信息。
                  - object body 历史或示例信息。
                        content string body 消息内容。
                        role string body 消息角色,可选值为 system、user、assistant。
      kbIds array[string] body 知识库 ID 列表。
      parameters object body 模型参数。
            max_tokens integer body 最大输出 token 数,取值范围[1,4096],默认为512。
            seed integer body 种子,默认为1234。
            temperature number body 随机性,取值范围[0,1],默认为0.2。
            top_k integer body 采样率,默认为1024。
            top_p number body 采样率,取值范围[0,1],默认为0.6。

请求示例

curl -X 'POST' \
  'https://test.rdc.aliyuncs.com/oapi/v1/lingma/organizations/{organizationId}/model/chat?stream={stream}&teamDocs={teamDocs}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "input": {
            "messages": [
                {
                    "content": "",
                    "role": ""
                }
            ]
        },
        "kbIds": [

        ],
        "parameters": {
            "max_tokens": 0,
            "seed": 0,
            "temperature": ,
            "top_k": 0,
            "top_p": 
        }
    }'

返回参数 #1

参数 类型 描述 示例值
- object
      output object 输出数据。
            finish_reason string 结束原因。
            text string 答案文本。
      requestId string
      usage object 用量。
            input_tokens integer 输入 token 数。
            output_tokens integer 输出 token 数。

返回参数 #2

参数 类型 描述 示例值
- string
      - object
            data string 输出数据流,以"data"开头,结尾有结束事件

返回示例 #1

{
    "output": {
        "finish_reason": "",
        "text": ""
    },
    "requestId": "",
    "usage": {
        "input_tokens": 0,
        "output_tokens": 0
    }
}

返回示例 #2

    {
        "data": ""
    }

错误码

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

results matching ""

    No results matching ""