@@ -557,6 +557,41 @@ func TestMarshalJSON(t *testing.T) {
557
557
wantErr : false ,
558
558
target : "File" ,
559
559
},
560
+ // SlidingWindow tests
561
+ {
562
+ name : "SlidingWindow empty" ,
563
+ input : & SlidingWindow {},
564
+ want : `{}` ,
565
+ wantErr : false ,
566
+ target : "SlidingWindow" ,
567
+ },
568
+ {
569
+ name : "SlidingWindow with all fields" ,
570
+ input : & SlidingWindow {
571
+ TargetTokens : 1024 ,
572
+ },
573
+ want : `{"targetTokens":"1024"}` ,
574
+ wantErr : false ,
575
+ target : "SlidingWindow" ,
576
+ },
577
+ // ContextWindowCompressionConfig tests
578
+ {
579
+ name : "ContextWindowCompressionConfig empty" ,
580
+ input : & ContextWindowCompressionConfig {},
581
+ want : `{}` ,
582
+ wantErr : false ,
583
+ target : "ContextWindowCompressionConfig" ,
584
+ },
585
+ {
586
+ name : "ContextWindowCompressionConfig with all fields" ,
587
+ input : & ContextWindowCompressionConfig {
588
+ TriggerTokens : 1024 ,
589
+ SlidingWindow : & SlidingWindow {TargetTokens : 1024 },
590
+ },
591
+ want : `{"slidingWindow":{"targetTokens":"1024"},"triggerTokens":"1024"}` ,
592
+ wantErr : false ,
593
+ target : "ContextWindowCompressionConfig" ,
594
+ },
560
595
}
561
596
for _ , tt := range tests {
562
597
t .Run (tt .name , func (t * testing.T ) {
@@ -583,6 +618,10 @@ func TestMarshalJSON(t *testing.T) {
583
618
got , err = json .Marshal (tt .input .(* VideoMetadata ))
584
619
case "File" :
585
620
got , err = json .Marshal (tt .input .(* File ))
621
+ case "SlidingWindow" :
622
+ got , err = json .Marshal (tt .input .(* SlidingWindow ))
623
+ case "ContextWindowCompressionConfig" :
624
+ got , err = json .Marshal (tt .input .(* ContextWindowCompressionConfig ))
586
625
default :
587
626
t .Fatalf ("unknown target: %s" , tt .target )
588
627
}
0 commit comments