Skip to content

Commit 42bdca7

Browse files
feat(api): move post_training and eval under alpha namespace
1 parent d8b42f6 commit 42bdca7

16 files changed

+361
-357
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 109
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-4337a6181c2db17737133e944b4b660a5e00ea10dce6be3252918e39451e9b5f.yml
33
openapi_spec_hash: a0bc8f4b5f45bc5741fed8eaa61171c3
4-
config_hash: 47ef2eb62d188340f22eb6dea3693f15
4+
config_hash: d8706905bf16d9e4141e88d5a778263b

alpha.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import (
1313
// automatically. You should not instantiate this service directly, and instead use
1414
// the [NewAlphaService] method instead.
1515
type AlphaService struct {
16-
Options []option.RequestOption
17-
Inference AlphaInferenceService
18-
Agents AlphaAgentService
16+
Options []option.RequestOption
17+
Inference AlphaInferenceService
18+
PostTraining AlphaPostTrainingService
19+
Eval AlphaEvalService
20+
Agents AlphaAgentService
1921
}
2022

2123
// NewAlphaService generates a new service that applies the given options to each
@@ -25,6 +27,8 @@ func NewAlphaService(opts ...option.RequestOption) (r AlphaService) {
2527
r = AlphaService{}
2628
r.Options = opts
2729
r.Inference = NewAlphaInferenceService(opts...)
30+
r.PostTraining = NewAlphaPostTrainingService(opts...)
31+
r.Eval = NewAlphaEvalService(opts...)
2832
r.Agents = NewAlphaAgentService(opts...)
2933
return
3034
}

alphaagent.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func NewAlphaAgentService(opts ...option.RequestOption) (r AlphaAgentService) {
4949
// Create an agent with the given configuration.
5050
func (r *AlphaAgentService) New(ctx context.Context, body AlphaAgentNewParams, opts ...option.RequestOption) (res *AlphaAgentNewResponse, err error) {
5151
opts = slices.Concat(r.Options, opts)
52-
path := "v1/agents"
52+
path := "v1alpha/agents"
5353
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
5454
return
5555
}
@@ -61,15 +61,15 @@ func (r *AlphaAgentService) Get(ctx context.Context, agentID string, opts ...opt
6161
err = errors.New("missing required agent_id parameter")
6262
return
6363
}
64-
path := fmt.Sprintf("v1/agents/%s", agentID)
64+
path := fmt.Sprintf("v1alpha/agents/%s", agentID)
6565
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
6666
return
6767
}
6868

6969
// List all agents.
7070
func (r *AlphaAgentService) List(ctx context.Context, query AlphaAgentListParams, opts ...option.RequestOption) (res *AlphaAgentListResponse, err error) {
7171
opts = slices.Concat(r.Options, opts)
72-
path := "v1/agents"
72+
path := "v1alpha/agents"
7373
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
7474
return
7575
}
@@ -82,7 +82,7 @@ func (r *AlphaAgentService) Delete(ctx context.Context, agentID string, opts ...
8282
err = errors.New("missing required agent_id parameter")
8383
return
8484
}
85-
path := fmt.Sprintf("v1/agents/%s", agentID)
85+
path := fmt.Sprintf("v1alpha/agents/%s", agentID)
8686
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...)
8787
return
8888
}

alphaagentsession.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (r *AlphaAgentSessionService) New(ctx context.Context, agentID string, body
4646
err = errors.New("missing required agent_id parameter")
4747
return
4848
}
49-
path := fmt.Sprintf("v1/agents/%s/session", agentID)
49+
path := fmt.Sprintf("v1alpha/agents/%s/session", agentID)
5050
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
5151
return
5252
}
@@ -62,7 +62,7 @@ func (r *AlphaAgentSessionService) Get(ctx context.Context, sessionID string, pa
6262
err = errors.New("missing required session_id parameter")
6363
return
6464
}
65-
path := fmt.Sprintf("v1/agents/%s/session/%s", params.AgentID, sessionID)
65+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s", params.AgentID, sessionID)
6666
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &res, opts...)
6767
return
6868
}
@@ -74,7 +74,7 @@ func (r *AlphaAgentSessionService) List(ctx context.Context, agentID string, que
7474
err = errors.New("missing required agent_id parameter")
7575
return
7676
}
77-
path := fmt.Sprintf("v1/agents/%s/sessions", agentID)
77+
path := fmt.Sprintf("v1alpha/agents/%s/sessions", agentID)
7878
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
7979
return
8080
}
@@ -91,7 +91,7 @@ func (r *AlphaAgentSessionService) Delete(ctx context.Context, sessionID string,
9191
err = errors.New("missing required session_id parameter")
9292
return
9393
}
94-
path := fmt.Sprintf("v1/agents/%s/session/%s", body.AgentID, sessionID)
94+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s", body.AgentID, sessionID)
9595
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, nil, opts...)
9696
return
9797
}

alphaagentstep.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (r *AlphaAgentStepService) Get(ctx context.Context, stepID string, query Al
5555
err = errors.New("missing required step_id parameter")
5656
return
5757
}
58-
path := fmt.Sprintf("v1/agents/%s/session/%s/turn/%s/step/%s", query.AgentID, query.SessionID, query.TurnID, stepID)
58+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s/turn/%s/step/%s", query.AgentID, query.SessionID, query.TurnID, stepID)
5959
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
6060
return
6161
}

alphaagentturn.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (r *AlphaAgentTurnService) New(ctx context.Context, sessionID string, param
5050
err = errors.New("missing required session_id parameter")
5151
return
5252
}
53-
path := fmt.Sprintf("v1/agents/%s/session/%s/turn", params.AgentID, sessionID)
53+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s/turn", params.AgentID, sessionID)
5454
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
5555
return
5656
}
@@ -71,7 +71,7 @@ func (r *AlphaAgentTurnService) NewStreaming(ctx context.Context, sessionID stri
7171
err = errors.New("missing required session_id parameter")
7272
return
7373
}
74-
path := fmt.Sprintf("v1/agents/%s/session/%s/turn", params.AgentID, sessionID)
74+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s/turn", params.AgentID, sessionID)
7575
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &raw, opts...)
7676
return ssestream.NewStream[AgentTurnResponseStreamChunk](ssestream.NewDecoder(raw), err)
7777
}
@@ -91,7 +91,7 @@ func (r *AlphaAgentTurnService) Get(ctx context.Context, turnID string, query Al
9191
err = errors.New("missing required turn_id parameter")
9292
return
9393
}
94-
path := fmt.Sprintf("v1/agents/%s/session/%s/turn/%s", query.AgentID, query.SessionID, turnID)
94+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s/turn/%s", query.AgentID, query.SessionID, turnID)
9595
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
9696
return
9797
}
@@ -114,7 +114,7 @@ func (r *AlphaAgentTurnService) Resume(ctx context.Context, turnID string, param
114114
err = errors.New("missing required turn_id parameter")
115115
return
116116
}
117-
path := fmt.Sprintf("v1/agents/%s/session/%s/turn/%s/resume", params.AgentID, params.SessionID, turnID)
117+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s/turn/%s/resume", params.AgentID, params.SessionID, turnID)
118118
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
119119
return
120120
}
@@ -142,7 +142,7 @@ func (r *AlphaAgentTurnService) ResumeStreaming(ctx context.Context, turnID stri
142142
err = errors.New("missing required turn_id parameter")
143143
return
144144
}
145-
path := fmt.Sprintf("v1/agents/%s/session/%s/turn/%s/resume", params.AgentID, params.SessionID, turnID)
145+
path := fmt.Sprintf("v1alpha/agents/%s/session/%s/turn/%s/resume", params.AgentID, params.SessionID, turnID)
146146
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &raw, opts...)
147147
return ssestream.NewStream[AgentTurnResponseStreamChunk](ssestream.NewDecoder(raw), err)
148148
}

eval.go renamed to alphaeval.go

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,71 +18,71 @@ import (
1818
"github.com/llamastack/llama-stack-client-go/shared/constant"
1919
)
2020

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.
2323
//
2424
// Note, unlike clients, this service does not read variables from the environment
2525
// 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 {
2828
Options []option.RequestOption
29-
Jobs EvalJobService
29+
Jobs AlphaEvalJobService
3030
}
3131

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{}
3737
r.Options = opts
38-
r.Jobs = NewEvalJobService(opts...)
38+
r.Jobs = NewAlphaEvalJobService(opts...)
3939
return
4040
}
4141

4242
// 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) {
4444
opts = slices.Concat(r.Options, opts)
4545
if benchmarkID == "" {
4646
err = errors.New("missing required benchmark_id parameter")
4747
return
4848
}
49-
path := fmt.Sprintf("v1/eval/benchmarks/%s/evaluations", benchmarkID)
49+
path := fmt.Sprintf("v1alpha/eval/benchmarks/%s/evaluations", benchmarkID)
5050
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
5151
return
5252
}
5353

5454
// 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) {
5656
opts = slices.Concat(r.Options, opts)
5757
if benchmarkID == "" {
5858
err = errors.New("missing required benchmark_id parameter")
5959
return
6060
}
61-
path := fmt.Sprintf("v1/eval/benchmarks/%s/evaluations", benchmarkID)
61+
path := fmt.Sprintf("v1alpha/eval/benchmarks/%s/evaluations", benchmarkID)
6262
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
6363
return
6464
}
6565

6666
// 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) {
6868
opts = slices.Concat(r.Options, opts)
6969
if benchmarkID == "" {
7070
err = errors.New("missing required benchmark_id parameter")
7171
return
7272
}
73-
path := fmt.Sprintf("v1/eval/benchmarks/%s/jobs", benchmarkID)
73+
path := fmt.Sprintf("v1alpha/eval/benchmarks/%s/jobs", benchmarkID)
7474
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
7575
return
7676
}
7777

7878
// 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) {
8080
opts = slices.Concat(r.Options, opts)
8181
if benchmarkID == "" {
8282
err = errors.New("missing required benchmark_id parameter")
8383
return
8484
}
85-
path := fmt.Sprintf("v1/eval/benchmarks/%s/jobs", benchmarkID)
85+
path := fmt.Sprintf("v1alpha/eval/benchmarks/%s/jobs", benchmarkID)
8686
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
8787
return
8888
}
@@ -334,43 +334,43 @@ const (
334334
JobStatusCancelled JobStatus = "cancelled"
335335
)
336336

337-
type EvalEvaluateRowsParams struct {
337+
type AlphaEvalEvaluateRowsParams struct {
338338
// The configuration for the benchmark.
339339
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
340340
// The rows to evaluate.
341-
InputRows []map[string]EvalEvaluateRowsParamsInputRowUnion `json:"input_rows,omitzero,required"`
341+
InputRows []map[string]AlphaEvalEvaluateRowsParamsInputRowUnion `json:"input_rows,omitzero,required"`
342342
// The scoring functions to use for the evaluation.
343343
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
344344
paramObj
345345
}
346346

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
349349
return param.MarshalObject(r, (*shadow)(&r))
350350
}
351-
func (r *EvalEvaluateRowsParams) UnmarshalJSON(data []byte) error {
351+
func (r *AlphaEvalEvaluateRowsParams) UnmarshalJSON(data []byte) error {
352352
return apijson.UnmarshalRoot(data, r)
353353
}
354354

355355
// Only one field can be non-zero.
356356
//
357357
// Use [param.IsOmitted] to confirm if a field is set.
358-
type EvalEvaluateRowsParamsInputRowUnion struct {
358+
type AlphaEvalEvaluateRowsParamsInputRowUnion struct {
359359
OfBool param.Opt[bool] `json:",omitzero,inline"`
360360
OfFloat param.Opt[float64] `json:",omitzero,inline"`
361361
OfString param.Opt[string] `json:",omitzero,inline"`
362362
OfAnyArray []any `json:",omitzero,inline"`
363363
paramUnion
364364
}
365365

366-
func (u EvalEvaluateRowsParamsInputRowUnion) MarshalJSON() ([]byte, error) {
366+
func (u AlphaEvalEvaluateRowsParamsInputRowUnion) MarshalJSON() ([]byte, error) {
367367
return param.MarshalUnion(u, u.OfBool, u.OfFloat, u.OfString, u.OfAnyArray)
368368
}
369-
func (u *EvalEvaluateRowsParamsInputRowUnion) UnmarshalJSON(data []byte) error {
369+
func (u *AlphaEvalEvaluateRowsParamsInputRowUnion) UnmarshalJSON(data []byte) error {
370370
return apijson.UnmarshalRoot(data, u)
371371
}
372372

373-
func (u *EvalEvaluateRowsParamsInputRowUnion) asAny() any {
373+
func (u *AlphaEvalEvaluateRowsParamsInputRowUnion) asAny() any {
374374
if !param.IsOmitted(u.OfBool) {
375375
return &u.OfBool.Value
376376
} else if !param.IsOmitted(u.OfFloat) {
@@ -383,43 +383,43 @@ func (u *EvalEvaluateRowsParamsInputRowUnion) asAny() any {
383383
return nil
384384
}
385385

386-
type EvalEvaluateRowsAlphaParams struct {
386+
type AlphaEvalEvaluateRowsAlphaParams struct {
387387
// The configuration for the benchmark.
388388
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
389389
// The rows to evaluate.
390-
InputRows []map[string]EvalEvaluateRowsAlphaParamsInputRowUnion `json:"input_rows,omitzero,required"`
390+
InputRows []map[string]AlphaEvalEvaluateRowsAlphaParamsInputRowUnion `json:"input_rows,omitzero,required"`
391391
// The scoring functions to use for the evaluation.
392392
ScoringFunctions []string `json:"scoring_functions,omitzero,required"`
393393
paramObj
394394
}
395395

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
398398
return param.MarshalObject(r, (*shadow)(&r))
399399
}
400-
func (r *EvalEvaluateRowsAlphaParams) UnmarshalJSON(data []byte) error {
400+
func (r *AlphaEvalEvaluateRowsAlphaParams) UnmarshalJSON(data []byte) error {
401401
return apijson.UnmarshalRoot(data, r)
402402
}
403403

404404
// Only one field can be non-zero.
405405
//
406406
// Use [param.IsOmitted] to confirm if a field is set.
407-
type EvalEvaluateRowsAlphaParamsInputRowUnion struct {
407+
type AlphaEvalEvaluateRowsAlphaParamsInputRowUnion struct {
408408
OfBool param.Opt[bool] `json:",omitzero,inline"`
409409
OfFloat param.Opt[float64] `json:",omitzero,inline"`
410410
OfString param.Opt[string] `json:",omitzero,inline"`
411411
OfAnyArray []any `json:",omitzero,inline"`
412412
paramUnion
413413
}
414414

415-
func (u EvalEvaluateRowsAlphaParamsInputRowUnion) MarshalJSON() ([]byte, error) {
415+
func (u AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) MarshalJSON() ([]byte, error) {
416416
return param.MarshalUnion(u, u.OfBool, u.OfFloat, u.OfString, u.OfAnyArray)
417417
}
418-
func (u *EvalEvaluateRowsAlphaParamsInputRowUnion) UnmarshalJSON(data []byte) error {
418+
func (u *AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) UnmarshalJSON(data []byte) error {
419419
return apijson.UnmarshalRoot(data, u)
420420
}
421421

422-
func (u *EvalEvaluateRowsAlphaParamsInputRowUnion) asAny() any {
422+
func (u *AlphaEvalEvaluateRowsAlphaParamsInputRowUnion) asAny() any {
423423
if !param.IsOmitted(u.OfBool) {
424424
return &u.OfBool.Value
425425
} else if !param.IsOmitted(u.OfFloat) {
@@ -432,30 +432,30 @@ func (u *EvalEvaluateRowsAlphaParamsInputRowUnion) asAny() any {
432432
return nil
433433
}
434434

435-
type EvalRunEvalParams struct {
435+
type AlphaEvalRunEvalParams struct {
436436
// The configuration for the benchmark.
437437
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
438438
paramObj
439439
}
440440

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
443443
return param.MarshalObject(r, (*shadow)(&r))
444444
}
445-
func (r *EvalRunEvalParams) UnmarshalJSON(data []byte) error {
445+
func (r *AlphaEvalRunEvalParams) UnmarshalJSON(data []byte) error {
446446
return apijson.UnmarshalRoot(data, r)
447447
}
448448

449-
type EvalRunEvalAlphaParams struct {
449+
type AlphaEvalRunEvalAlphaParams struct {
450450
// The configuration for the benchmark.
451451
BenchmarkConfig BenchmarkConfigParam `json:"benchmark_config,omitzero,required"`
452452
paramObj
453453
}
454454

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
457457
return param.MarshalObject(r, (*shadow)(&r))
458458
}
459-
func (r *EvalRunEvalAlphaParams) UnmarshalJSON(data []byte) error {
459+
func (r *AlphaEvalRunEvalAlphaParams) UnmarshalJSON(data []byte) error {
460460
return apijson.UnmarshalRoot(data, r)
461461
}

0 commit comments

Comments
 (0)