import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const knowledgeBaseUpload = await client.knowledgeBases.uploads.retrieve('knowledge_base_id', 'upload_id');
console.log(knowledgeBaseUpload.upload_id);{
"upload_id": "<string>",
"data_source_config": {
"source": "<string>",
"s3_bucket": "<string>",
"aws_region": "<string>",
"aws_account_id": "<string>",
"s3_prefix": ""
},
"created_at": "<string>",
"updated_at": "<string>",
"status": "Running",
"artifacts_status": {
"artifacts_chunking": 123,
"artifacts_embedding": 123,
"artifacts_completed": 123,
"artifacts_pending": 123,
"artifacts_uploading": 123,
"artifacts_failed": 123
},
"artifacts": [
{
"artifact_id": "<string>",
"artifact_name": "<string>",
"artifact_uri": "<string>",
"status": "<string>",
"source": "S3",
"chunks_status": {
"chunks_completed": 123,
"chunks_pending": 123,
"chunks_failed": 123
},
"tags": {},
"artifact_uri_public": "<string>",
"status_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"chunking_strategy_config": {
"strategy": "<string>",
"separator": "\n\n",
"chunk_size": 1000,
"chunk_overlap": 200
},
"status_reason": "<string>",
"created_by_schedule_id": "<string>"
}import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const knowledgeBaseUpload = await client.knowledgeBases.uploads.retrieve('knowledge_base_id', 'upload_id');
console.log(knowledgeBaseUpload.upload_id);{
"upload_id": "<string>",
"data_source_config": {
"source": "<string>",
"s3_bucket": "<string>",
"aws_region": "<string>",
"aws_account_id": "<string>",
"s3_prefix": ""
},
"created_at": "<string>",
"updated_at": "<string>",
"status": "Running",
"artifacts_status": {
"artifacts_chunking": 123,
"artifacts_embedding": 123,
"artifacts_completed": 123,
"artifacts_pending": 123,
"artifacts_uploading": 123,
"artifacts_failed": 123
},
"artifacts": [
{
"artifact_id": "<string>",
"artifact_name": "<string>",
"artifact_uri": "<string>",
"status": "<string>",
"source": "S3",
"chunks_status": {
"chunks_completed": 123,
"chunks_pending": 123,
"chunks_failed": 123
},
"tags": {},
"artifact_uri_public": "<string>",
"status_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"chunking_strategy_config": {
"strategy": "<string>",
"separator": "\n\n",
"chunk_size": 1000,
"chunk_overlap": 200
},
"status_reason": "<string>",
"created_by_schedule_id": "<string>"
}Successful Response
Unique ID of the upload job.
Configuration for downloading data from source.
Show child attributes
"S3"Name of the S3 bucket where the data is stored.
AWS region where the S3 bucket is located.
AWS account ID that owns the S3 bucket.
Prefix of the S3 bucket where the data is stored. If not specified, the entire bucket will be used.
The timestamp at which the upload job started.
The timestamp at which the upload job was last updated.
Sync status
Running, Completed, Failed, Canceled Number of artifacts in each of the various states, such as completed and failed for this upload. This includes artifacts for this data source that are retried.
Show child attributes
Number of artifacts in the chunking state
Number of artifacts in the embedding state
Number of artifacts uploaded successfully.
Previously: Number of artifacts awaiting upload. Note that this status will be deprecated soon and should show 0
Number of artifacts with upload in progress.
Number of artifacts that failed while being processed.
List of info for each artifacts associated with this upload. This includes artifacts for this data source that are retried.
Show child attributes
Unique identifier for the artifact.
Friendly name for the artifact.
Location (e.g. URI) of the artifact in the data source.
Status of the artifact.
Data source of the artifact.
S3, Confluence, SharePoint, SharePointPage, GoogleDrive, AzureBlobStorage, Slack, Snowflake, Databricks, LocalFile, LocalChunks Number of chunks pending, completed, and failed.
Tags associated with the artifact.
Public Location (e.g. URI) of the artifact in the data source.
Reason for the artifact's status.
Timestamp at which the artifact was last updated.
Configuration for chunking the text content of each artifact.
Show child attributes
"character"Character designating breaks in input data. Text data will first be split into sections by this separator, then each section will be split into chunks of size chunk_size.
Maximum number of characters in each chunk. If not specified, a chunk size of 1000 will be used.
x >= 1Number of characters to overlap between chunks. If not specified, an overlap of 200 will be used. For example if the chunk size is 3 and the overlap size is 1, and the text to chunk is 'abcde', the chunks will be 'abc', 'cde'.
x >= 0Reason for the upload job's status.
Id of the upload schedule that triggered this upload_id. Null if triggered manually.