Skip to content

Create scheduled indexing for knowledge base

client.agents.evaluationMetrics.scheduledIndexing.create(ScheduledIndexingCreateParams { days, knowledge_base_uuid, time } body?, RequestOptionsoptions?): ScheduledIndexingCreateResponse { indexing_info }
post/v2/gen-ai/scheduled-indexing

To create scheduled indexing for a knowledge base, send a POST request to /v2/gen-ai/scheduled-indexing.

ParametersExpand Collapse
body: ScheduledIndexingCreateParams { days, knowledge_base_uuid, time }
days?: Array<number>

Days for execution (day is represented same as in a cron expression, e.g. Monday begins with 1 )

knowledge_base_uuid?: string

Knowledge base uuid for which the schedule is created

time?: string

Time of execution (HH:MM) UTC

ReturnsExpand Collapse
ScheduledIndexingCreateResponse { indexing_info }
indexing_info?: IndexingInfo { created_at, days, deleted_at, 7 more }

Metadata for scheduled indexing entries

created_at?: string

Created at timestamp

formatdate-time
days?: Array<number>

Days for execution (day is represented same as in a cron expression, e.g. Monday begins with 1 )

deleted_at?: string

Deleted at timestamp (if soft deleted)

formatdate-time
is_active?: boolean

Whether the schedule is currently active

knowledge_base_uuid?: string

Knowledge base uuid associated with this schedule

last_ran_at?: string

Last time the schedule was executed

formatdate-time
next_run_at?: string

Next scheduled run

formatdate-time
time?: string

Scheduled time of execution (HH:MM:SS format)

updated_at?: string

Updated at timestamp

formatdate-time
uuid?: string

Unique identifier for the scheduled indexing entry

Create scheduled indexing for knowledge base
import Gradient from '@digitalocean/gradient';

const client = new Gradient({
  accessToken: 'My Access Token',
});

const scheduledIndexing = await client.agents.evaluationMetrics.scheduledIndexing.create();

console.log(scheduledIndexing.indexing_info);
{
  "indexing_info": {
    "created_at": "2023-01-01T00:00:00Z",
    "days": [
      123
    ],
    "deleted_at": "2023-01-01T00:00:00Z",
    "is_active": true,
    "knowledge_base_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "last_ran_at": "2023-01-01T00:00:00Z",
    "next_run_at": "2023-01-01T00:00:00Z",
    "time": "example string",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
}
Returns Examples
{
  "indexing_info": {
    "created_at": "2023-01-01T00:00:00Z",
    "days": [
      123
    ],
    "deleted_at": "2023-01-01T00:00:00Z",
    "is_active": true,
    "knowledge_base_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "last_ran_at": "2023-01-01T00:00:00Z",
    "next_run_at": "2023-01-01T00:00:00Z",
    "time": "example string",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
}