Learn how to run experiments programmatically using the Traceloop SDK
TRACELOOP_API_KEY
before you start. Check out the SDK’s getting started
guide for more information.experiment.run()
method to execute your experiment by selecting a dataset as the source data, choosing the evaluators to run, and assigning a slug to make it easy to rerun later.
experiment.run()
Parametersdataset_slug
(str): Identifier for your datasetdataset_version
(str): Version of the dataset to use, experiment can only run on a published versiontask
(function): Async function that processes each dataset rowevaluators
(list): List of evaluator slugs to measure performanceexperiment_slug
(str): Unique identifier for this experimentstop_on_error
(boolean): Whether to stop on first error (default: False)wait_for_results
(boolean): Whether to wait for async tasks to complete, when not waiting the results will be found in the ui (default: True)