import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const knowledgeBaseUpload = await client.knowledgeBases.uploads.retrieve('knowledge_base_id', 'upload_id');
console.log(knowledgeBaseUpload.upload_id);
{
"upload_id": "<string>",
"data_source_config": {
"source": "S3",
"s3_bucket": "<string>",
"s3_prefix": "",
"aws_region": "<string>",
"aws_account_id": "<string>"
},
"chunking_strategy_config": {
"strategy": "character",
"separator": "\n\n",
"chunk_size": 1000,
"chunk_overlap": 200
},
"created_at": "<string>",
"updated_at": "<string>",
"status": "Running",
"status_reason": "<string>",
"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>",
"artifact_uri_public": "<string>",
"status": "<string>",
"status_reason": "<string>",
"source": "S3",
"chunks_status": {
"chunks_completed": 123,
"chunks_pending": 123,
"chunks_failed": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"tags": {}
}
],
"created_by_schedule_id": "<string>"
}
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const knowledgeBaseUpload = await client.knowledgeBases.uploads.retrieve('knowledge_base_id', 'upload_id');
console.log(knowledgeBaseUpload.upload_id);
{
"upload_id": "<string>",
"data_source_config": {
"source": "S3",
"s3_bucket": "<string>",
"s3_prefix": "",
"aws_region": "<string>",
"aws_account_id": "<string>"
},
"chunking_strategy_config": {
"strategy": "character",
"separator": "\n\n",
"chunk_size": 1000,
"chunk_overlap": 200
},
"created_at": "<string>",
"updated_at": "<string>",
"status": "Running",
"status_reason": "<string>",
"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>",
"artifact_uri_public": "<string>",
"status": "<string>",
"status_reason": "<string>",
"source": "S3",
"chunks_status": {
"chunks_completed": 123,
"chunks_pending": 123,
"chunks_failed": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"tags": {}
}
],
"created_by_schedule_id": "<string>"
}
Successful Response
The response is of type object
.