Skip to content
  • Auto
  • Light
  • Dark

Retrieve Data Sources

List Data Sources for Indexing Job for a Knowledge Base
client.knowledgeBases.indexingJobs.retrieveDataSources(stringindexingJobUuid, RequestOptionsoptions?): IndexingJobRetrieveDataSourcesResponse { indexed_data_sources }
get/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources

To list all datasources for an indexing job, send a GET request to /v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources.

ParametersExpand Collapse
indexingJobUuid: string
ReturnsExpand Collapse
IndexingJobRetrieveDataSourcesResponse { indexed_data_sources }
indexed_data_sources?: Array<APIIndexedDataSource { completed_at, data_source_uuid, error_details, 11 more } >
completed_at?: string

Timestamp when data source completed indexing

formatdate-time
data_source_uuid?: string

Uuid of the indexed data source

error_details?: string

A detailed error description

error_msg?: string

A string code provinding a hint which part of the system experienced an error

failed_item_count?: string

Total count of files that have failed

formatuint64
indexed_file_count?: string

Total count of files that have been indexed

formatuint64
indexed_item_count?: string

Total count of files that have been indexed

formatuint64
removed_item_count?: string

Total count of files that have been removed

formatuint64
skipped_item_count?: string

Total count of files that have been skipped

formatuint64
started_at?: string

Timestamp when data source started indexing

formatdate-time
status?: "DATA_SOURCE_STATUS_UNKNOWN" | "DATA_SOURCE_STATUS_IN_PROGRESS" | "DATA_SOURCE_STATUS_UPDATED" | 3 more
Accepts one of the following:
"DATA_SOURCE_STATUS_UNKNOWN"
"DATA_SOURCE_STATUS_IN_PROGRESS"
"DATA_SOURCE_STATUS_UPDATED"
"DATA_SOURCE_STATUS_PARTIALLY_UPDATED"
"DATA_SOURCE_STATUS_NOT_UPDATED"
"DATA_SOURCE_STATUS_FAILED"
total_bytes?: string

Total size of files in data source in bytes

formatuint64
total_bytes_indexed?: string

Total size of files in data source in bytes that have been indexed

formatuint64
total_file_count?: string

Total file count in the data source

formatuint64
List Data Sources for Indexing Job for a Knowledge Base
import Gradient from '@digitalocean/gradient';

const client = new Gradient();

const response = await client.knowledgeBases.indexingJobs.retrieveDataSources(
  '"123e4567-e89b-12d3-a456-426614174000"',
);

console.log(response.indexed_data_sources);
{
  "indexed_data_sources": [
    {
      "completed_at": "2023-01-01T00:00:00Z",
      "data_source_uuid": "123e4567-e89b-12d3-a456-426614174000",
      "error_details": "example string",
      "error_msg": "example string",
      "failed_item_count": "12345",
      "indexed_file_count": "12345",
      "indexed_item_count": "12345",
      "removed_item_count": "12345",
      "skipped_item_count": "12345",
      "started_at": "2023-01-01T00:00:00Z",
      "status": "DATA_SOURCE_STATUS_UNKNOWN",
      "total_bytes": "12345",
      "total_bytes_indexed": "12345",
      "total_file_count": "12345"
    }
  ]
}
Returns Examples
{
  "indexed_data_sources": [
    {
      "completed_at": "2023-01-01T00:00:00Z",
      "data_source_uuid": "123e4567-e89b-12d3-a456-426614174000",
      "error_details": "example string",
      "error_msg": "example string",
      "failed_item_count": "12345",
      "indexed_file_count": "12345",
      "indexed_item_count": "12345",
      "removed_item_count": "12345",
      "skipped_item_count": "12345",
      "started_at": "2023-01-01T00:00:00Z",
      "status": "DATA_SOURCE_STATUS_UNKNOWN",
      "total_bytes": "12345",
      "total_bytes_indexed": "12345",
      "total_file_count": "12345"
    }
  ]
}