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) -> indexed_data_sourceslistIndexingJobRetrieveDataSourcesResponse
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.

Parameters
indexing_job_uuidstr
Returns
IndexingJobRetrieveDataSourcesResponseclass
Hide ParametersShow Parameters
indexed_data_sourceslist
optional
Optional[List[completed_atdatetimedata_source_uuidstrerror_detailsstrerror_msgstrfailed_item_countstrindexed_file_countstrindexed_item_countstrremoved_item_countstrskipped_item_countstrstarted_atdatetimestatusliteraltotal_bytesstrtotal_bytes_indexedstrtotal_file_countstrAPIIndexedDataSource]]
Hide ParametersShow Parameters
completed_atdatetime
optional

Timestamp when data source completed indexing

formatdate-time
data_source_uuidstr
optional

Uuid of the indexed data source

error_detailsstr
optional

A detailed error description

error_msgstr
optional

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

failed_item_countstr
optional

Total count of files that have failed

formatuint64
indexed_file_countstr
optional

Total count of files that have been indexed

formatuint64
indexed_item_countstr
optional

Total count of files that have been indexed

formatuint64
removed_item_countstr
optional

Total count of files that have been removed

formatuint64
skipped_item_countstr
optional

Total count of files that have been skipped

formatuint64
started_atdatetime
optional

Timestamp when data source started indexing

formatdate-time
statusliteral
optional
Optional[Literal["DATA_SOURCE_STATUS_UNKNOWN", "DATA_SOURCE_STATUS_IN_PROGRESS", "DATA_SOURCE_STATUS_UPDATED", 3 more]]
Hide ParametersShow Parameters
"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_bytesstr
optional

Total size of files in data source in bytes

formatuint64
total_bytes_indexedstr
optional

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

formatuint64
total_file_countstr
optional

Total file count in the data source

formatuint64
from do_gradientai import GradientAI

client = GradientAI()
response = client.knowledge_bases.indexing_jobs.retrieve_data_sources(
    "indexing_job_uuid",
)
print(response.indexed_data_sources)
200 Example
{
  "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\""
    }
  ]
}