diff --git a/trulens_eval/trulens_eval/tru_virtual.py b/trulens_eval/trulens_eval/tru_virtual.py index 17bcd5417..d41e3ce41 100644 --- a/trulens_eval/trulens_eval/tru_virtual.py +++ b/trulens_eval/trulens_eval/tru_virtual.py @@ -407,12 +407,10 @@ def __init__( if (end_time - start_time).total_seconds() == 0.0: end_time += datetime.timedelta(microseconds=1) - if "cost" not in kwargs: - kwargs['cost'] = mod_base_schema.Cost() - if "perf" not in kwargs: - kwargs['perf'] = mod_base_schema.Perf( - start_time=start_time, end_time=end_time - ) + kwargs['cost'] = cost or mod_base_schema.Cost() + kwargs['perf'] = perf or mod_base_schema.Perf( + start_time=start_time, end_time=end_time + ) if "main_input" not in kwargs: kwargs['main_input'] = "No main_input provided."