1313    Union ,
1414)
1515
16- from  pydantic  import  BaseModel ,  Field 
16+ from  pydantic  import  Field 
1717
1818from  guidellm .backend  import  ResponseSummary 
1919from  guidellm .benchmark .benchmark  import  (
2424    GenerativeTextErrorStats ,
2525    GenerativeTextResponseStats ,
2626)
27- from  guidellm .benchmark .profile  import  Profile 
27+ from  guidellm .benchmark .profile  import  (
28+     AsyncProfile ,
29+     ConcurrentProfile ,
30+     Profile ,
31+     SweepProfile ,
32+     SynchronousProfile ,
33+     ThroughputProfile ,
34+ )
2835from  guidellm .config  import  settings 
29- from  guidellm .objects  import  RunningStats , Serializable , TimeRunningStats 
30- from  guidellm .request  import  GenerationRequest 
36+ from  guidellm .objects  import  RunningStats , StandardBaseModel , TimeRunningStats 
37+ from  guidellm .request  import  (
38+     GenerationRequest ,
39+     GenerativeRequestLoaderDescription ,
40+     RequestLoaderDescription ,
41+ )
3142from  guidellm .scheduler  import  (
3243    REQ ,
3344    RES ,
45+     AsyncConstantStrategy ,
46+     AsyncPoissonStrategy ,
47+     ConcurrentStrategy ,
48+     GenerativeRequestsWorkerDescription ,
3449    SchedulerRequestResult ,
3550    SchedulingStrategy ,
51+     SynchronousStrategy ,
52+     ThroughputStrategy ,
53+     WorkerDescription ,
3654)
3755from  guidellm .utils  import  check_load_processor 
3856
4361]
4462
4563
46- class  BenchmarkAggregator (ABC , BaseModel , Generic [BENCH , REQ , RES ]):
64+ class  BenchmarkAggregator (ABC , StandardBaseModel , Generic [BENCH , REQ , RES ]):
4765    """ 
4866    A pydantic base class representing the base class for aggregating benchmark results. 
4967    The purpose is to receive and process results from a Benchmarker as it iterates 
@@ -55,25 +73,43 @@ class BenchmarkAggregator(ABC, BaseModel, Generic[BENCH, REQ, RES]):
5573    fully calculated. 
5674    """ 
5775
76+     type_ : Literal ["benchmark_aggregator" ] =  "benchmark_aggregator" 
5877    run_id : str  =  Field (
5978        description = (
6079            "The unique identifier for the encompasing benchmark run that this " 
6180            "benchmark was a part of." 
6281        )
6382    )
64-     profile : Profile  =  Field (
83+     profile : Union [
84+         AsyncProfile ,
85+         SweepProfile ,
86+         ConcurrentProfile ,
87+         ThroughputProfile ,
88+         SynchronousProfile ,
89+         Profile ,
90+     ] =  Field (
6591        description = (
6692            "The profile used for the entire benchamrk run that the strategy for " 
6793            "the active benchmark was pulled from." 
68-         )
94+         ),
95+         discriminator = "type_" ,
6996    )
7097    strategy_index : int  =  Field (
7198        description = (
7299            "The index of the strategy in the profile that was used for this benchmark." 
73100        )
74101    )
75-     strategy : SchedulingStrategy  =  Field (
76-         description = "The scheduling strategy used to run this benchmark. " 
102+     strategy : Union [
103+         ConcurrentStrategy ,
104+         SchedulingStrategy ,
105+         ThroughputStrategy ,
106+         SynchronousStrategy ,
107+         AsyncPoissonStrategy ,
108+         AsyncConstantStrategy ,
109+         SchedulingStrategy ,
110+     ] =  Field (
111+         description = "The scheduling strategy used to run this benchmark. " ,
112+         discriminator = "type_" ,
77113    )
78114    max_number : Optional [int ] =  Field (
79115        description = "The maximum number of requests to run for this benchmark, if any." 
@@ -105,25 +141,31 @@ class BenchmarkAggregator(ABC, BaseModel, Generic[BENCH, REQ, RES]):
105141            "if any. These are requests that were not included in the final results." 
106142        )
107143    )
108-     worker_description : Optional [Serializable ] =  Field (
144+     worker_description : Optional [
145+         Union [GenerativeRequestsWorkerDescription , WorkerDescription ]
146+     ] =  Field (
109147        description = (
110148            "The description and specifics for the worker used to resolve requests " 
111149            "for this benchmark." 
112-         )
150+         ),
151+         discriminator = "type_" ,
113152    )
114-     request_loader_description : Optional [Serializable ] =  Field (
153+     request_loader_description : Optional [
154+         Union [GenerativeRequestLoaderDescription , RequestLoaderDescription ]
155+     ] =  Field (
115156        description = (
116157            "The description and specifics for the request loader used to create " 
117158            "requests for this benchmark." 
118-         )
159+         ),
160+         discriminator = "type_" ,
119161    )
120162    extras : Dict [str , Any ] =  Field (
121163        description = (
122164            "Any additional information or metadata that was passed for this benchmark." 
123165        )
124166    )
125167
126-     results : List [SchedulerRequestResult [GenerationRequest ,  ResponseSummary ]] =  Field (
168+     results : List [SchedulerRequestResult [REQ ,  RES ]] =  Field (
127169        default_factory = list ,
128170        description = (
129171            "The list of all results from the benchmark (complete, incomplete, error), " 
@@ -423,6 +465,9 @@ def compile(self) -> BENCH:
423465class  GenerativeBenchmarkAggregator (
424466    BenchmarkAggregator [GenerativeBenchmark , GenerationRequest , ResponseSummary ]
425467):
468+     type_ : Literal ["generative_benchmark_aggregator" ] =  (
469+         "generative_benchmark_aggregator" 
470+     )
426471    processor : Optional [Union [str , Path , Any ]] =  Field (
427472        description = (
428473            "The tokenizer to use for calculating token counts when none are " 
0 commit comments