How to Schedule Functions
Schedule functions to run periodically.
Validated on 8 Jul 2025 • Last edited on 8 Jul 2025
You can create a scheduled function to automatically reindex your knowledge base on a schedule you choose.
For example, you can use the following Python script, which triggers a reindex usin gPyDo’s create_indexing_job()
:
from pydo import Client
import os
c = Client(os.getenv("DO_API_KEY"))
c.genai.create_indexing_job(body={
"knowledge_base_uuid": "KB UUID",
"data_source_uuids": ["DS UUID"] # optional, reindexes all data sources if not specified
})
You can also write your own function that sends a POST request to the indexing jobs API endpoint.
Try using different keywords or simplifying your search terms.