Skip to content

List

List Data Sources for a Knowledge Base
get/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources

To list all data sources for a knowledge base, send a GET request to /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources.

Path Parameters
knowledge_base_uuidstring
Query Parameters
pagenumber
optional

page number.

formatint64
per_pagenumber
optional

items per page.

formatint64
Returns
knowledge_base_data_sourcesarray of aws_data_sourceobjectbucket_namestringcreated_atstringfile_upload_data_sourceAPIFileUploadDataSourceitem_pathstringlast_datasource_indexing_jobAPIIndexedDataSourcelast_indexing_jobAPIIndexingJobregionstringspaces_data_sourceAPISpacesDataSourceupdated_atstringuuidstringweb_crawler_data_sourceAPIWebCrawlerDataSourceAPIKnowledgeBaseDataSource
optional
metapagenumberpagesnumbertotalnumberAPIMeta
optional
Request example cURL
curl https://api.digitalocean.com//v2/gen-ai/knowledge_bases/$KNOWLEDGE_BASE_UUID/data_sources \
    -H "Authorization: Bearer $GRADIENTAI_API_KEY"
200 Example
{
  "knowledge_base_data_sources": [
    {
      "aws_data_source": {
        "bucket_name": "bucket_name",
        "item_path": "item_path",
        "region": "region"
      },
      "bucket_name": "bucket_name",
      "created_at": "2019-12-27T18:11:19.117Z",
      "file_upload_data_source": {
        "original_file_name": "original_file_name",
        "size_in_bytes": "size_in_bytes",
        "stored_object_key": "stored_object_key"
      },
      "item_path": "item_path",
      "last_datasource_indexing_job": {
        "completed_at": "2019-12-27T18:11:19.117Z",
        "data_source_uuid": "data_source_uuid",
        "error_details": "error_details",
        "error_msg": "error_msg",
        "failed_item_count": "failed_item_count",
        "indexed_file_count": "indexed_file_count",
        "indexed_item_count": "indexed_item_count",
        "removed_item_count": "removed_item_count",
        "skipped_item_count": "skipped_item_count",
        "started_at": "2019-12-27T18:11:19.117Z",
        "status": "DATA_SOURCE_STATUS_UNKNOWN",
        "total_bytes": "total_bytes",
        "total_bytes_indexed": "total_bytes_indexed",
        "total_file_count": "total_file_count"
      },
      "last_indexing_job": {
        "completed_datasources": 0,
        "created_at": "2019-12-27T18:11:19.117Z",
        "data_source_uuids": [
          "string"
        ],
        "finished_at": "2019-12-27T18:11:19.117Z",
        "knowledge_base_uuid": "knowledge_base_uuid",
        "phase": "BATCH_JOB_PHASE_UNKNOWN",
        "started_at": "2019-12-27T18:11:19.117Z",
        "status": "INDEX_JOB_STATUS_UNKNOWN",
        "tokens": 0,
        "total_datasources": 0,
        "updated_at": "2019-12-27T18:11:19.117Z",
        "uuid": "uuid"
      },
      "region": "region",
      "spaces_data_source": {
        "bucket_name": "bucket_name",
        "item_path": "item_path",
        "region": "region"
      },
      "updated_at": "2019-12-27T18:11:19.117Z",
      "uuid": "uuid",
      "web_crawler_data_source": {
        "base_url": "base_url",
        "crawling_option": "UNKNOWN",
        "embed_media": true
      }
    }
  ],
  "links": {
    "pages": {
      "first": "first",
      "last": "last",
      "next": "next",
      "previous": "previous"
    }
  },
  "meta": {
    "page": 0,
    "pages": 0,
    "total": 0
  }
}