@@ -18,71 +18,71 @@ import (
18
18
"github.com/llamastack/llama-stack-client-go/shared/constant"
19
19
)
20
20
21
- // EvalService contains methods and other services that help with interacting with
22
- // the llama-stack-client API.
21
+ // AlphaEvalService contains methods and other services that help with interacting
22
+ // with the llama-stack-client API.
23
23
//
24
24
// Note, unlike clients, this service does not read variables from the environment
25
25
// automatically. You should not instantiate this service directly, and instead use
26
- // the [NewEvalService ] method instead.
27
- type EvalService struct {
26
+ // the [NewAlphaEvalService ] method instead.
27
+ type AlphaEvalService struct {
28
28
Options []option.RequestOption
29
- Jobs EvalJobService
29
+ Jobs AlphaEvalJobService
30
30
}
31
31
32
- // NewEvalService generates a new service that applies the given options to each
33
- // request. These options are applied after the parent client's options (if there
34
- // is one), and before any request-specific options.
35
- func NewEvalService (opts ... option.RequestOption ) (r EvalService ) {
36
- r = EvalService {}
32
+ // NewAlphaEvalService generates a new service that applies the given options to
33
+ // each request. These options are applied after the parent client's options (if
34
+ // there is one), and before any request-specific options.
35
+ func NewAlphaEvalService (opts ... option.RequestOption ) (r AlphaEvalService ) {
36
+ r = AlphaEvalService {}
37
37
r .Options = opts
38
- r .Jobs = NewEvalJobService (opts ... )
38
+ r .Jobs = NewAlphaEvalJobService (opts ... )
39
39
return
40
40
}
41
41
42
42
// Evaluate a list of rows on a benchmark.
43
- func (r * EvalService ) EvaluateRows (ctx context.Context , benchmarkID string , body EvalEvaluateRowsParams , opts ... option.RequestOption ) (res * EvaluateResponse , err error ) {
43
+ func (r * AlphaEvalService ) EvaluateRows (ctx context.Context , benchmarkID string , body AlphaEvalEvaluateRowsParams , opts ... option.RequestOption ) (res * EvaluateResponse , err error ) {
44
44
opts = slices .Concat (r .Options , opts )
45
45
if benchmarkID == "" {
46
46
err = errors .New ("missing required benchmark_id parameter" )
47
47
return
48
48
}
49
- path := fmt .Sprintf ("v1 /eval/benchmarks/%s/evaluations" , benchmarkID )
49
+ path := fmt .Sprintf ("v1alpha /eval/benchmarks/%s/evaluations" , benchmarkID )
50
50
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
51
51
return
52
52
}
53
53
54
54
// Evaluate a list of rows on a benchmark.
55
- func (r * EvalService ) EvaluateRowsAlpha (ctx context.Context , benchmarkID string , body EvalEvaluateRowsAlphaParams , opts ... option.RequestOption ) (res * EvaluateResponse , err error ) {
55
+ func (r * AlphaEvalService ) EvaluateRowsAlpha (ctx context.Context , benchmarkID string , body AlphaEvalEvaluateRowsAlphaParams , opts ... option.RequestOption ) (res * EvaluateResponse , err error ) {
56
56
opts = slices .Concat (r .Options , opts )
57
57
if benchmarkID == "" {
58
58
err = errors .New ("missing required benchmark_id parameter" )
59
59
return
60
60
}
61
- path := fmt .Sprintf ("v1 /eval/benchmarks/%s/evaluations" , benchmarkID )
61
+ path := fmt .Sprintf ("v1alpha /eval/benchmarks/%s/evaluations" , benchmarkID )
62
62
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
63
63
return
64
64
}
65
65
66
66
// Run an evaluation on a benchmark.
67
- func (r * EvalService ) RunEval (ctx context.Context , benchmarkID string , body EvalRunEvalParams , opts ... option.RequestOption ) (res * Job , err error ) {
67
+ func (r * AlphaEvalService ) RunEval (ctx context.Context , benchmarkID string , body AlphaEvalRunEvalParams , opts ... option.RequestOption ) (res * Job , err error ) {
68
68
opts = slices .Concat (r .Options , opts )
69
69
if benchmarkID == "" {
70
70
err = errors .New ("missing required benchmark_id parameter" )
71
71
return
72
72
}
73
- path := fmt .Sprintf ("v1 /eval/benchmarks/%s/jobs" , benchmarkID )
73
+ path := fmt .Sprintf ("v1alpha /eval/benchmarks/%s/jobs" , benchmarkID )
74
74
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
75
75
return
76
76
}
77
77
78
78
// Run an evaluation on a benchmark.
79
- func (r * EvalService ) RunEvalAlpha (ctx context.Context , benchmarkID string , body EvalRunEvalAlphaParams , opts ... option.RequestOption ) (res * Job , err error ) {
79
+ func (r * AlphaEvalService ) RunEvalAlpha (ctx context.Context , benchmarkID string , body AlphaEvalRunEvalAlphaParams , opts ... option.RequestOption ) (res * Job , err error ) {
80
80
opts = slices .Concat (r .Options , opts )
81
81
if benchmarkID == "" {
82
82
err = errors .New ("missing required benchmark_id parameter" )
83
83
return
84
84
}
85
- path := fmt .Sprintf ("v1 /eval/benchmarks/%s/jobs" , benchmarkID )
85
+ path := fmt .Sprintf ("v1alpha /eval/benchmarks/%s/jobs" , benchmarkID )
86
86
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
87
87
return
88
88
}
@@ -334,43 +334,43 @@ const (
334
334
JobStatusCancelled JobStatus = "cancelled"
335
335
)
336
336
337
- type EvalEvaluateRowsParams struct {
337
+ type AlphaEvalEvaluateRowsParams struct {
338
338
// The configuration for the benchmark.
339
339
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
340
340
// The rows to evaluate.
341
- InputRows []map [string ]EvalEvaluateRowsParamsInputRowUnion `json:"input_rows,omitzero,required"`
341
+ InputRows []map [string ]AlphaEvalEvaluateRowsParamsInputRowUnion `json:"input_rows,omitzero,required"`
342
342
// The scoring functions to use for the evaluation.
343
343
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
344
344
paramObj
345
345
}
346
346
347
- func (r EvalEvaluateRowsParams ) MarshalJSON () (data []byte , err error ) {
348
- type shadow EvalEvaluateRowsParams
347
+ func (r AlphaEvalEvaluateRowsParams ) MarshalJSON () (data []byte , err error ) {
348
+ type shadow AlphaEvalEvaluateRowsParams
349
349
return param .MarshalObject (r , (* shadow )(& r ))
350
350
}
351
- func (r * EvalEvaluateRowsParams ) UnmarshalJSON (data []byte ) error {
351
+ func (r * AlphaEvalEvaluateRowsParams ) UnmarshalJSON (data []byte ) error {
352
352
return apijson .UnmarshalRoot (data , r )
353
353
}
354
354
355
355
// Only one field can be non-zero.
356
356
//
357
357
// Use [param.IsOmitted] to confirm if a field is set.
358
- type EvalEvaluateRowsParamsInputRowUnion struct {
358
+ type AlphaEvalEvaluateRowsParamsInputRowUnion struct {
359
359
OfBool param.Opt [bool ] `json:",omitzero,inline"`
360
360
OfFloat param.Opt [float64 ] `json:",omitzero,inline"`
361
361
OfString param.Opt [string ] `json:",omitzero,inline"`
362
362
OfAnyArray []any `json:",omitzero,inline"`
363
363
paramUnion
364
364
}
365
365
366
- func (u EvalEvaluateRowsParamsInputRowUnion ) MarshalJSON () ([]byte , error ) {
366
+ func (u AlphaEvalEvaluateRowsParamsInputRowUnion ) MarshalJSON () ([]byte , error ) {
367
367
return param .MarshalUnion (u , u .OfBool , u .OfFloat , u .OfString , u .OfAnyArray )
368
368
}
369
- func (u * EvalEvaluateRowsParamsInputRowUnion ) UnmarshalJSON (data []byte ) error {
369
+ func (u * AlphaEvalEvaluateRowsParamsInputRowUnion ) UnmarshalJSON (data []byte ) error {
370
370
return apijson .UnmarshalRoot (data , u )
371
371
}
372
372
373
- func (u * EvalEvaluateRowsParamsInputRowUnion ) asAny () any {
373
+ func (u * AlphaEvalEvaluateRowsParamsInputRowUnion ) asAny () any {
374
374
if ! param .IsOmitted (u .OfBool ) {
375
375
return & u .OfBool .Value
376
376
} else if ! param .IsOmitted (u .OfFloat ) {
@@ -383,43 +383,43 @@ func (u *EvalEvaluateRowsParamsInputRowUnion) asAny() any {
383
383
return nil
384
384
}
385
385
386
- type EvalEvaluateRowsAlphaParams struct {
386
+ type AlphaEvalEvaluateRowsAlphaParams struct {
387
387
// The configuration for the benchmark.
388
388
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
389
389
// The rows to evaluate.
390
- InputRows []map [string ]EvalEvaluateRowsAlphaParamsInputRowUnion `json:"input_rows,omitzero,required"`
390
+ InputRows []map [string ]AlphaEvalEvaluateRowsAlphaParamsInputRowUnion `json:"input_rows,omitzero,required"`
391
391
// The scoring functions to use for the evaluation.
392
392
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
393
393
paramObj
394
394
}
395
395
396
- func (r EvalEvaluateRowsAlphaParams ) MarshalJSON () (data []byte , err error ) {
397
- type shadow EvalEvaluateRowsAlphaParams
396
+ func (r AlphaEvalEvaluateRowsAlphaParams ) MarshalJSON () (data []byte , err error ) {
397
+ type shadow AlphaEvalEvaluateRowsAlphaParams
398
398
return param .MarshalObject (r , (* shadow )(& r ))
399
399
}
400
- func (r * EvalEvaluateRowsAlphaParams ) UnmarshalJSON (data []byte ) error {
400
+ func (r * AlphaEvalEvaluateRowsAlphaParams ) UnmarshalJSON (data []byte ) error {
401
401
return apijson .UnmarshalRoot (data , r )
402
402
}
403
403
404
404
// Only one field can be non-zero.
405
405
//
406
406
// Use [param.IsOmitted] to confirm if a field is set.
407
- type EvalEvaluateRowsAlphaParamsInputRowUnion struct {
407
+ type AlphaEvalEvaluateRowsAlphaParamsInputRowUnion struct {
408
408
OfBool param.Opt [bool ] `json:",omitzero,inline"`
409
409
OfFloat param.Opt [float64 ] `json:",omitzero,inline"`
410
410
OfString param.Opt [string ] `json:",omitzero,inline"`
411
411
OfAnyArray []any `json:",omitzero,inline"`
412
412
paramUnion
413
413
}
414
414
415
- func (u EvalEvaluateRowsAlphaParamsInputRowUnion ) MarshalJSON () ([]byte , error ) {
415
+ func (u AlphaEvalEvaluateRowsAlphaParamsInputRowUnion ) MarshalJSON () ([]byte , error ) {
416
416
return param .MarshalUnion (u , u .OfBool , u .OfFloat , u .OfString , u .OfAnyArray )
417
417
}
418
- func (u * EvalEvaluateRowsAlphaParamsInputRowUnion ) UnmarshalJSON (data []byte ) error {
418
+ func (u * AlphaEvalEvaluateRowsAlphaParamsInputRowUnion ) UnmarshalJSON (data []byte ) error {
419
419
return apijson .UnmarshalRoot (data , u )
420
420
}
421
421
422
- func (u * EvalEvaluateRowsAlphaParamsInputRowUnion ) asAny () any {
422
+ func (u * AlphaEvalEvaluateRowsAlphaParamsInputRowUnion ) asAny () any {
423
423
if ! param .IsOmitted (u .OfBool ) {
424
424
return & u .OfBool .Value
425
425
} else if ! param .IsOmitted (u .OfFloat ) {
@@ -432,30 +432,30 @@ func (u *EvalEvaluateRowsAlphaParamsInputRowUnion) asAny() any {
432
432
return nil
433
433
}
434
434
435
- type EvalRunEvalParams struct {
435
+ type AlphaEvalRunEvalParams struct {
436
436
// The configuration for the benchmark.
437
437
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
438
438
paramObj
439
439
}
440
440
441
- func (r EvalRunEvalParams ) MarshalJSON () (data []byte , err error ) {
442
- type shadow EvalRunEvalParams
441
+ func (r AlphaEvalRunEvalParams ) MarshalJSON () (data []byte , err error ) {
442
+ type shadow AlphaEvalRunEvalParams
443
443
return param .MarshalObject (r , (* shadow )(& r ))
444
444
}
445
- func (r * EvalRunEvalParams ) UnmarshalJSON (data []byte ) error {
445
+ func (r * AlphaEvalRunEvalParams ) UnmarshalJSON (data []byte ) error {
446
446
return apijson .UnmarshalRoot (data , r )
447
447
}
448
448
449
- type EvalRunEvalAlphaParams struct {
449
+ type AlphaEvalRunEvalAlphaParams struct {
450
450
// The configuration for the benchmark.
451
451
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
452
452
paramObj
453
453
}
454
454
455
- func (r EvalRunEvalAlphaParams ) MarshalJSON () (data []byte , err error ) {
456
- type shadow EvalRunEvalAlphaParams
455
+ func (r AlphaEvalRunEvalAlphaParams ) MarshalJSON () (data []byte , err error ) {
456
+ type shadow AlphaEvalRunEvalAlphaParams
457
457
return param .MarshalObject (r , (* shadow )(& r ))
458
458
}
459
- func (r * EvalRunEvalAlphaParams ) UnmarshalJSON (data []byte ) error {
459
+ func (r * AlphaEvalRunEvalAlphaParams ) UnmarshalJSON (data []byte ) error {
460
460
return apijson .UnmarshalRoot (data , r )
461
461
}
0 commit comments