文档列表
curl --request GET \
--url https://open.bigmodel.cn/api/llm-application/open/document \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/llm-application/open/document"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/llm-application/open/document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/llm-application/open/document")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/llm-application/open/document"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"list": [
{
"id": "12312121212",
"knowledge_type": 1,
"custom_separator": [
"\n"
],
"sentence_size": 300,
"length": 0,
"word_num": 100,
"name": "",
"url": "",
"embedding_stat": 0,
"failInfo": {
"embedding_code": 10002,
"embedding_msg": "字数超出限制"
}
}
],
"total": 1
},
"code": 200,
"message": "请求成功",
"timestamp": 1689649504996
}{
"code": 123,
"message": "<string>"
}知识库 API
文档列表
获取指定知识库下的文档列表。点击 Try it 按钮可快速试用。
GET
/
llm-application
/
open
/
document
文档列表
curl --request GET \
--url https://open.bigmodel.cn/api/llm-application/open/document \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/llm-application/open/document"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/llm-application/open/document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/llm-application/open/document")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/llm-application/open/document"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"list": [
{
"id": "12312121212",
"knowledge_type": 1,
"custom_separator": [
"\n"
],
"sentence_size": 300,
"length": 0,
"word_num": 100,
"name": "",
"url": "",
"embedding_stat": 0,
"failInfo": {
"embedding_code": 10002,
"embedding_msg": "字数超出限制"
}
}
],
"total": 1
},
"code": 200,
"message": "请求成功",
"timestamp": 1689649504996
}{
"code": 123,
"message": "<string>"
}Query Parameters
知识库id
页码,默认1
每页数量,默认10
文档名称
Was this page helpful?
⌘I