Skip to content
On this page
简要描述
  • 人工智能服务-Agent助手
请求URL
  • https://open.gangtise.com/application/open-ai/ai/chat/sse
请求方式
  • POST (SSE协议)
请求头
请求头类型说明
AuthorizationStringaccessToken,通accessToken接口获取
参数说明
参数名必选类型说明
textString问题内容
modeString问答模式
deep_research:深度研究模式
ark_agent:Agent模式
askChatParamObject问答参数,问答模式不同,支持的参数不同
深度研究模式 askChatParam参数说明
参数名必选类型说明
iterInteger思考轮数,默认3轮,最大支持3轮
Agent模式 askChatParam参数说明
参数名必选类型说明
historyList<String>问题历史,最大支持10个问题
includeSearchTypesList<Integer>查询数据所包含的类型,包含以下类型
10:券商研究报告
20:首席分析师观点
30:会议平台纪要
startDateString查询开始日期,格式为yyyy-MM-dd
endDateString查询结束日期,格式为yyyy-MM-dd
webEnableBoolean是否联网查询
traceIdString请求traceId,建议使用前缀+uuid
请求示例
深度研究模式:
{
    "text":"介绍一下比亚迪",
    "mode":"deep_research",
    "askChatParam":{
        "iter":3
    }

}

agent模式:
{
    "text":"介绍一下比亚迪",
    "mode":"ark_agent",
    "askChatParam":{
        "history":["比亚迪今天的销量","比亚迪以前的表现"],
        "includeSearchTypes":[10,20,30],
        "startDate":"2025-04-09",
        "endDate":"2025-04-16",
        "webEnable":true,
        "traceId":"traceId"
    }
}
返回示例
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": "好的"}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": ","}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": "我现在"}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": "需要"}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": "回答"}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": "用户"}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": "的问题"}}
{"phase": "think", "round": 1, "result": {"type": "rich_text", "isStream": true, "isStreamLast": false, "delta": ":“"}}
返回参数说明
参数名类型说明
phaseString当前阶段,think:思考阶段,answer:回答阶段
roundInteger当前思考轮数
resultObject输出结果对象
result.typeString输出格式,rich_text:富文本
result.isStreamBoolean是否流式输出
result.isStreamLastBoolean是否为流式的最后一个输出
result.deltaString内容增量

查看完整返回内容格式说明

调用示例(java)
String accessToken = "你的accessToken";
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("application/json");
        RequestBody requestBody = RequestBody.create(mediaType, "{\"mode\":\"deep_research\",\"askChatParam\":{\"iter\":2},\"text\":\"介绍一下比亚迪\"}");
        Request request = new Request.Builder()
                .url("https://open.gangtise.com/application/open-ai/ai/chat/sse")
                .method("POST", requestBody)
                .addHeader("Authorization", accessToken)
                .addHeader("Content-Type", "application/json")
                .build();
        try ( Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                assert response.body() != null;
                try (BufferedReader reader = new BufferedReader(new InputStreamReader(response.body().byteStream(), StandardCharsets.UTF_8))) {
                    String line;
                    while ((line = reader.readLine()) != null) {
                        // 解析 SSE 格式
                        if (line.startsWith("data:")) {
                            String data = line.substring(5).trim();
                            //这里是打印输入内容
                            System.out.println(data);
                        }
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
备注
HTTP状态码说明
200操作成功
429接口繁忙,请稍后再试
  • 更多返回错误代码请看首页的错误代码描述