解析文档图片
curl --request POST \
--url https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{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/slice/image_list/{id}")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{id}"
req, _ := http.NewRequest("POST", 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/slice/image_list/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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": {
"images": [
{
"text": "【示意图序号_1829473032620613632_103】",
"cos_url": "https://cdn.bigmodel.cn/knowledge_pdf_image/de7163a7-c67f-4e33-8810-97a6d5a83378.png"
}
]
},
"code": 200,
"message": "请求成功",
"timestamp": 1725070689634
}{
"code": 123,
"message": "<string>"
}知识库 API
解析文档图片
用于获取文件下解析到的图片序号和图片链接映射关系。点击 Try it 按钮可快速试用。
POST
/
llm-application
/
open
/
document
/
slice
/
image_list
/
{id}
解析文档图片
curl --request POST \
--url https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{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/slice/image_list/{id}")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/llm-application/open/document/slice/image_list/{id}"
req, _ := http.NewRequest("POST", 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/slice/image_list/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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": {
"images": [
{
"text": "【示意图序号_1829473032620613632_103】",
"cos_url": "https://cdn.bigmodel.cn/knowledge_pdf_image/de7163a7-c67f-4e33-8810-97a6d5a83378.png"
}
]
},
"code": 200,
"message": "请求成功",
"timestamp": 1725070689634
}{
"code": 123,
"message": "<string>"
}Was this page helpful?
⌘I