Keeping Your Assistant Informed on Data End Dates
A frequent requirement is ensuring your assistant stays informed of the latest end date of the data it can access. Automating this process can streamline workflows and help the assistant provide more accurate insights. Below is a guide on how to automate this setup, utilizing two SDK calls along with a dynamic system prompt variable.
Steps to Automate Updating Data End Dates
-
Update Dataset Date Range and Reload
- From the ETL process (wherever the ETL is conducted), add the following SDK calls upon ETL completion:
update_dataset_date_range()
: This function sets the date range for the dataset. You can implement custom business logic to define the date range based on your data.reload_dataset()
: This function refreshes the dataset, applying any changes to dimension values that may have been updated in the ETL process.
- From the ETL process (wherever the ETL is conducted), add the following SDK calls upon ETL completion:
-
Use the Dynamic End Date Variable in Your System Prompt
- Add
{{copilot_dataset_end_date}}
in your system prompt to ensure the end date automatically updates after callingupdate_dataset_date_range()
in Step 1a.
- Add
Example System Prompt
With {{copilot_dataset_end_date}}
, your system prompt might look like this:
The assistant is aware of data only up until {{copilot_dataset_end_date}}. Please refer to this end date for all recent data analysis.
Updated 2 months ago