异步结果
curl --request POST \
--url https://open.bigmodel.cn/api/v1/agents/async-result \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"async_id": "VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5",
"agent_id": "intelligent_education_correction_polling"
}
'import requests
url = "https://open.bigmodel.cn/api/v1/agents/async-result"
payload = {
"async_id": "VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5",
"agent_id": "intelligent_education_correction_polling"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
async_id: 'VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5',
agent_id: 'intelligent_education_correction_polling'
})
};
fetch('https://open.bigmodel.cn/api/v1/agents/async-result', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://open.bigmodel.cn/api/v1/agents/async-result")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"async_id\": \"VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5\",\n \"agent_id\": \"intelligent_education_correction_polling\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/v1/agents/async-result"
payload := strings.NewReader("{\n \"async_id\": \"VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5\",\n \"agent_id\": \"intelligent_education_correction_polling\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/v1/agents/async-result",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'async_id' => 'VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5',
'agent_id' => 'intelligent_education_correction_polling'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"agent_id": "<string>",
"async_id": "<string>",
"choices": [
{
"messages": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"file_url": "<string>",
"tag_cn": "<string>",
"tag_en": "<string>"
}
]
}
]
}
],
"usage": {
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Agent API
异步结果
查询智能体异步任务的处理结果和状态。点击 Try it 按钮可快速试用。
POST
/
v1
/
agents
/
async-result
异步结果
curl --request POST \
--url https://open.bigmodel.cn/api/v1/agents/async-result \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"async_id": "VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5",
"agent_id": "intelligent_education_correction_polling"
}
'import requests
url = "https://open.bigmodel.cn/api/v1/agents/async-result"
payload = {
"async_id": "VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5",
"agent_id": "intelligent_education_correction_polling"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
async_id: 'VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5',
agent_id: 'intelligent_education_correction_polling'
})
};
fetch('https://open.bigmodel.cn/api/v1/agents/async-result', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://open.bigmodel.cn/api/v1/agents/async-result")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"async_id\": \"VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5\",\n \"agent_id\": \"intelligent_education_correction_polling\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/v1/agents/async-result"
payload := strings.NewReader("{\n \"async_id\": \"VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5\",\n \"agent_id\": \"intelligent_education_correction_polling\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/v1/agents/async-result",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'async_id' => 'VHJhbnNsYXRvckVudGl0eVRhc2s6OTI5OTY5',
'agent_id' => 'intelligent_education_correction_polling'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"agent_id": "<string>",
"async_id": "<string>",
"choices": [
{
"messages": [
{
"role": "<string>",
"content": [
{
"type": "<string>",
"file_url": "<string>",
"tag_cn": "<string>",
"tag_en": "<string>"
}
]
}
]
}
],
"usage": {
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Body
application/json
Was this page helpful?
⌘I