重新向量化
curl --request POST \
--url https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "<string>",
"callback_header": {}
}
'import requests
url = "https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id}"
payload = {
"callback_url": "<string>",
"callback_header": {}
}
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({callback_url: '<string>', callback_header: {}})
};
fetch('https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id}', 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/llm-application/open/document/embedding/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"<string>\",\n \"callback_header\": {}\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id}"
payload := strings.NewReader("{\n \"callback_url\": \"<string>\",\n \"callback_header\": {}\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/llm-application/open/document/embedding/{id}",
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([
'callback_url' => '<string>',
'callback_header' => [
]
]),
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;
}{
"code": 200,
"message": "请求成功",
"timestamp": 1689649504996
}{
"code": 123,
"message": "<string>"
}知识库 API
重新向量化
用于重新向量化文档(重试等操作)。同步返回成功表示调用成功,向量化完成后调用callback_url进行通知,也可调用知识详情接口获取结果。多用于url知识场景。点击 Try it 按钮可快速试用。
POST
/
llm-application
/
open
/
document
/
embedding
/
{id}
重新向量化
curl --request POST \
--url https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "<string>",
"callback_header": {}
}
'import requests
url = "https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id}"
payload = {
"callback_url": "<string>",
"callback_header": {}
}
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({callback_url: '<string>', callback_header: {}})
};
fetch('https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id}', 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/llm-application/open/document/embedding/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"<string>\",\n \"callback_header\": {}\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/llm-application/open/document/embedding/{id}"
payload := strings.NewReader("{\n \"callback_url\": \"<string>\",\n \"callback_header\": {}\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/llm-application/open/document/embedding/{id}",
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([
'callback_url' => '<string>',
'callback_header' => [
]
]),
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;
}{
"code": 200,
"message": "请求成功",
"timestamp": 1689649504996
}{
"code": 123,
"message": "<string>"
}Was this page helpful?
⌘I