Skip to main content
POST
Train Index with Documents

문서로 인덱스 훈련

문서(파일)를 업로드하거나 텍스트 입력을 제공하여 인덱스를 훈련합니다.

엔드포인트

설명

문서(파일)를 업로드하거나 텍스트 입력을 제공하여 인덱스를 훈련합니다. 이 엔드포인트는 다양한 파일 형식을 지원하며 한 번에 최대 20개의 파일을 처리할 수 있습니다.

지원되는 파일 형식

-TXT
  • PDF
  • DOCX
  • 의사
  • JSON
  • CSV
  • XLS -XLSX

인증

필수: API 키

경로 매개변수

요청 본문

이 끝점은 multipart/form-data 형식을 허용합니다.

매개변수

텍스트 입력 형식

text_inputs를 사용할 때 다음을 포함하는 객체가 포함된 JSON 문자열 배열을 제공하세요.

요청 예시

파일 업로드(다중 부분 양식 데이터)

자바스크립트/Node.js

파이썬

텍스트 입력 사용

응답

성공 응답 (200)

응답 필드

결과 개체

오류 응답

400 잘못된 요청

401 승인되지 않음

403 금지됨

404 찾을 수 없음

413 페이로드가 너무 큼

500 내부 서버 오류

메모

  • 요청당 최대 20개 파일
  • 파일당 최대 50MB
  • 파일은 멀티파트/폼 데이터로 업로드 가능
  • 텍스트 입력은 JSON 문자열 배열로 제공될 수 있습니다.
  • 의미 검색을 위해 문서가 자동으로 청크화되고 벡터화됩니다.
  • 훈련 전에 인덱스가 존재해야 합니다.
  • 훈련 결과에는 성공적으로 인덱싱된 문서 수가 표시됩니다.

인증

Authorization
string
header
필수

API key authentication using Bearer token format. Example: Authorization: Bearer sk-your-api-key-here

경로 매개변수

indexName
string
필수

Name of the index to train

예시:

"my-knowledge-base"

본문

multipart/form-data
files
file[]

Document files to upload (up to 20 files, 50MB each). Supported formats: TXT, PDF, DOCX, DOC, JSON, CSV, XLS, XLSX

Maximum array length: 20
text_inputs
string

JSON string array of text inputs. Each item should have:

  • name: string (filename)
  • type: string (MIME type, e.g., "text/plain")
  • content: string (text content)
  • size: number (content length in bytes)
예시:

"[{\"name\":\"doc1.txt\",\"type\":\"text/plain\",\"content\":\"Document content here\",\"size\":20}]"

응답

Index trained successfully

success
boolean
예시:

true

message
string
예시:

"Index trained successfully"

request_id
string<uuid>
예시:

"550e8400-e29b-41d4-a716-446655440000"

results
object