Skip to content

Create scheduled indexing for knowledge base

agents.evaluation_metrics.scheduled_indexing.create(ScheduledIndexingCreateParams**kwargs) -> ScheduledIndexingCreateResponse
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
days: Optional[Iterable[int]]

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

knowledge_base_uuid: Optional[str]

Knowledge base uuid for which the schedule is created

time: Optional[str]

Time of execution (HH:MM) UTC

ReturnsExpand Collapse
class ScheduledIndexingCreateResponse:
indexing_info: Optional[IndexingInfo]

Metadata for scheduled indexing entries

created_at: Optional[datetime]

Created at timestamp

formatdate-time
days: Optional[List[int]]

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

deleted_at: Optional[datetime]

Deleted at timestamp (if soft deleted)

formatdate-time
is_active: Optional[bool]

Whether the schedule is currently active

knowledge_base_uuid: Optional[str]

Knowledge base uuid associated with this schedule

last_ran_at: Optional[datetime]

Last time the schedule was executed

formatdate-time
next_run_at: Optional[datetime]

Next scheduled run

formatdate-time
time: Optional[str]

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

updated_at: Optional[datetime]

Updated at timestamp

formatdate-time
uuid: Optional[str]

Unique identifier for the scheduled indexing entry

Create scheduled indexing for knowledge base
from gradient import Gradient

client = Gradient(
    access_token="My Access Token",
)
scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.create()
print(scheduled_indexing.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"
  }
}