Skip to content
  • Auto
  • Light
  • Dark

Retrieve Data Sources

List Data Sources for Indexing Job for a Knowledge Base
knowledge_bases.indexing_jobs.retrieve_data_sources(strindexing_job_uuid) -> IndexingJobRetrieveDataSourcesResponse
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
indexing_job_uuid: str
ReturnsExpand Collapse
class IndexingJobRetrieveDataSourcesResponse:
indexed_data_sources: Optional[List[APIIndexedDataSource]]
completed_at: Optional[datetime]

Timestamp when data source completed indexing

formatdate-time
data_source_uuid: Optional[str]

Uuid of the indexed data source

error_details: Optional[str]

A detailed error description

error_msg: Optional[str]

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

failed_item_count: Optional[str]

Total count of files that have failed

formatuint64
indexed_file_count: Optional[str]

Total count of files that have been indexed

formatuint64
indexed_item_count: Optional[str]

Total count of files that have been indexed

formatuint64
removed_item_count: Optional[str]

Total count of files that have been removed

formatuint64
skipped_item_count: Optional[str]

Total count of files that have been skipped

formatuint64
started_at: Optional[datetime]

Timestamp when data source started indexing

formatdate-time
status: Optional[Literal["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: Optional[str]

Total size of files in data source in bytes

formatuint64
total_bytes_indexed: Optional[str]

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

formatuint64
total_file_count: Optional[str]

Total file count in the data source

formatuint64
from gradient import Gradient

client = Gradient()
response = client.knowledge_bases.indexing_jobs.retrieve_data_sources(
    "indexing_job_uuid",
)
print(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"
    }
  ]
}