Skip to main content
POST
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
upload_files
Python
import os
from scale_gp import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
create_knowledge_base_uploads_from_files_response = client.knowledge_bases.upload_files(
    knowledge_base_id="knowledge_base_id",
    chunking_strategy_config="chunking_strategy_config",
    data_source_config="data_source_config",
    files=["string"],
    force_reupload=True,
)
print(create_knowledge_base_uploads_from_files_response.upload_ids)
{
  "upload_ids": [
    "<string>"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Path Parameters

knowledge_base_id
string
required

Body

multipart/form-data
files
string[]
required
data_source_config
string
required
chunking_strategy_config
string
required
force_reupload
boolean
required
tagging_information
string
custom_metadata
string

JSON-encoded dictionary of custom metadata to attach to all chunks generated from the uploaded files. These metadata fields become queryable via metadata_filters on the chunks query endpoint.

Response

Successful Response

upload_ids
string[]
required

List of upload IDs that have been kicked off by the upload API