会话
List sessions
返回您创建的会话列表。
GET
/
v2
/
team
/
sessions
List sessions
curl --request GET \
--url https://app.ai.relyt.cn/app/api/v2/team/sessions \
--header 'x-pd-api-key: <api-key>'import requests
url = "https://app.ai.relyt.cn/app/api/v2/team/sessions"
headers = {"x-pd-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-pd-api-key': '<api-key>'}};
fetch('https://app.ai.relyt.cn/app/api/v2/team/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.ai.relyt.cn/app/api/v2/team/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-pd-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.ai.relyt.cn/app/api/v2/team/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-pd-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.ai.relyt.cn/app/api/v2/team/sessions")
.header("x-pd-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.ai.relyt.cn/app/api/v2/team/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-pd-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 0,
"data": {
"total_items": 8,
"page_size": 10,
"page_number": 1,
"records": [
{
"id": "04b69928-532d-408a-8716-8f5e70fcacc6",
"name": "Finding Your Inner Spark",
"output_language": "AUTO",
"job_mode": "AUTO",
"max_contextual_job_history": 10,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "7e9941af-ad1b-4834-a421-4b37b54aae19",
"name": "session_trade_analyze_001",
"output_language": "EN",
"job_mode": "AUTO",
"max_contextual_job_history": 1,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "a137ecc8-9554-42c3-b042-2458dd2aeb36",
"name": "My first session",
"output_language": "AUTO",
"job_mode": "AUTO",
"max_contextual_job_history": 10,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "4440ab38-3df0-465b-a66c-bf6acb0f1bc2",
"name": "New name",
"output_language": "EN",
"job_mode": "AUTO",
"max_contextual_job_history": 10,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "3eb5e294-11eb-4bf0-8854-7177c415d15c",
"name": "trade_analyze_001",
"output_language": "ZH-CN",
"job_mode": "AUTO",
"max_contextual_job_history": 10,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "ccca6d34-894f-4f6f-a8b5-c9df93126309",
"name": "lhtest-old",
"output_language": "ZH-CN",
"job_mode": "AUTO",
"max_contextual_job_history": 5,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "c28a1f47-da68-4456-bb0b-e85bf5a0e98e",
"name": "lhtest-newest",
"output_language": "ZH-TW",
"job_mode": "AUTO",
"max_contextual_job_history": 6,
"agent_id": "DATA_ANALYSIS_AGENT"
},
{
"id": "fbde9b45-69cd-408e-97d1-f874236aadac",
"name": "General-session",
"output_language": "ZH-CN",
"job_mode": "AUTO",
"max_contextual_job_history": 10,
"agent_id": "DATA_ANALYSIS_AGENT"
}
]
}
}请求示例:
返回示例:
curl --request GET \
--url https://app.ai.relyt.cn/app/api/v2/team/sessions?user_id=tmm-dafasdfasdfasdf \
--header 'x-pd-api-key: <api-key>'
import requests
url = "https://app.ai.relyt.cn/app/api/v2/team/sessions?user_id=tmm-dafasdfasdfasdf"
headers = {"x-pd-api-key": "<api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
200
{
"code": 0,
"data": {
"page_number": 1,
"page_size": 10,
"total_items": 1,
"records": [
{
"id": "dataset-dasfadsgadsgas",
"name": "mysql",
"description": "mysql databases"
}
]
}
}
Authorizations
Headers
您本地系统中设置的 Trace ID,至多支持 128 个字符。当请求发生错误时,可以将此 ID 提供给 Relyt AI 团队,协助进行故障排查。
Query Parameters
分页返回的起始页码。如不指定,则使用默认值 1。
每页返回的记录数量。如不指定,则使用默认值 10。
搜索关键词,最多支持 128 个字符。所有名称中包含该关键词的会话将被返回。
如果省略此项,将列出所有会话。
用户 ID,即您在组织中的唯一身份标识。
⌘I