Skip to main content
POST
/
llm-application
/
open
/
document
/
upload_document
/
{id}
上传文件文档
curl --request POST \
  --url https://open.bigmodel.cn/api/llm-application/open/document/upload_document/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form knowledge_type=123 \
  --form 'custom_separator=<string>' \
  --form sentence_size=123 \
  --form parse_image=true \
  --form 'callback_url=<string>' \
  --form 'callback_header={}' \
  --form 'word_num_limit=<string>' \
  --form 'req_id=<string>' \
  --form files=@example-file
{
  "data": {
    "successInfos": [
      {
        "documentId": "<string>",
        "fileName": "<string>"
      }
    ],
    "failedInfos": [
      {
        "fileName": "<string>",
        "failReason": "<string>"
      }
    ]
  },
  "code": 123,
  "message": "<string>",
  "timestamp": 123
}

Authorizations

Authorization
string
header
required

使用以下格式进行身份验证:Bearer <your api key>

Path Parameters

id
string
required

知识库id

Body

multipart/form-data
files
file
required

文件

knowledge_type
integer

文档类型,不传则动态解析。 1: 按标题段落切:支持txt,doc,pdf,url,docx,ppt,pptx,md 2: 按问答对切片:支持txt,doc,pdf,url,docx,ppt,pptx,md 3: 按行切片:支持xls,xlsx,csv 5: 自定义切片:支持txt,doc,pdf,url,docx,ppt,pptx,md 6: 按页切片:支持pdf,ppt,pptx 7: 按单个切片:支持xls,xlsx,csv

custom_separator
string[]

自定义切片规则,knowledge_type=5时传,默认

sentence_size
integer

自定义切片大小,knowledge_type=5时传,20-2000,默认300

parse_image
boolean

是否解析图片,默认不解析

callback_url
string

回调地址

callback_header
object

回调时header携带的k-v

word_num_limit
string

文档字数上限,必须为数字

req_id
string

请求唯一id

Response

业务处理成功

data
object
code
integer

响应码,200为成功

message
string

响应信息

timestamp
integer

响应时间戳

I