File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ class TestsetGenerationEvent(BaseEvent):
9797 num_rows : int
9898 language : str
9999 is_experiment : bool = False
100+ version : str = "3" # the version of testset generation pipeline
100101
101102
102103@silent
Original file line number Diff line number Diff line change 44import typing as t
55from dataclasses import dataclass , field
66
7+ from ragas ._analytics import TestsetGenerationEvent , track
78from ragas .callbacks import new_group
89from ragas .executor import Executor
910from ragas .llms import BaseRagasLLM , LangchainLLMWrapper
@@ -202,4 +203,17 @@ def generate(
202203 testsets .append (TestsetSample (eval_sample = sample , ** additional_info ))
203204 testset = Testset (samples = testsets )
204205 testset_generation_rm .on_chain_end ({"testset" : testset })
206+
207+ # tracking how many samples were generated
208+ track (
209+ TestsetGenerationEvent (
210+ event_type = "testset_generation" ,
211+ evolution_names = [
212+ e .__class__ .__name__ .lower () for e , _ in query_distribution
213+ ],
214+ evolution_percentages = [p for _ , p in query_distribution ],
215+ num_rows = test_size ,
216+ language = "english" ,
217+ )
218+ )
205219 return testset
You can’t perform that action at this time.
0 commit comments