9
9
"fmt"
10
10
"net/http"
11
11
"net/url"
12
+ "slices"
12
13
13
14
"github.com/llamastack/llama-stack-client-go/internal/apijson"
14
15
"github.com/llamastack/llama-stack-client-go/internal/apiquery"
@@ -40,7 +41,7 @@ func NewDatasetService(opts ...option.RequestOption) (r DatasetService) {
40
41
41
42
// Get a dataset by its ID.
42
43
func (r * DatasetService ) Get (ctx context.Context , datasetID string , opts ... option.RequestOption ) (res * DatasetGetResponse , err error ) {
43
- opts = append (r .Options [:] , opts ... )
44
+ opts = slices . Concat (r .Options , opts )
44
45
if datasetID == "" {
45
46
err = errors .New ("missing required dataset_id parameter" )
46
47
return
@@ -53,7 +54,7 @@ func (r *DatasetService) Get(ctx context.Context, datasetID string, opts ...opti
53
54
// List all datasets.
54
55
func (r * DatasetService ) List (ctx context.Context , opts ... option.RequestOption ) (res * []ListDatasetsResponseData , err error ) {
55
56
var env ListDatasetsResponse
56
- opts = append (r .Options [:] , opts ... )
57
+ opts = slices . Concat (r .Options , opts )
57
58
path := "v1/datasets"
58
59
err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , nil , & env , opts ... )
59
60
if err != nil {
@@ -65,7 +66,7 @@ func (r *DatasetService) List(ctx context.Context, opts ...option.RequestOption)
65
66
66
67
// Append rows to a dataset.
67
68
func (r * DatasetService ) Appendrows (ctx context.Context , datasetID string , body DatasetAppendrowsParams , opts ... option.RequestOption ) (err error ) {
68
- opts = append (r .Options [:] , opts ... )
69
+ opts = slices . Concat (r .Options , opts )
69
70
opts = append ([]option.RequestOption {option .WithHeader ("Accept" , "" )}, opts ... )
70
71
if datasetID == "" {
71
72
err = errors .New ("missing required dataset_id parameter" )
@@ -86,7 +87,7 @@ func (r *DatasetService) Appendrows(ctx context.Context, datasetID string, body
86
87
// - data: List of items for the current page.
87
88
// - has_more: Whether there are more items available after this set.
88
89
func (r * DatasetService ) Iterrows (ctx context.Context , datasetID string , query DatasetIterrowsParams , opts ... option.RequestOption ) (res * DatasetIterrowsResponse , err error ) {
89
- opts = append (r .Options [:] , opts ... )
90
+ opts = slices . Concat (r .Options , opts )
90
91
if datasetID == "" {
91
92
err = errors .New ("missing required dataset_id parameter" )
92
93
return
@@ -98,15 +99,15 @@ func (r *DatasetService) Iterrows(ctx context.Context, datasetID string, query D
98
99
99
100
// Register a new dataset.
100
101
func (r * DatasetService ) Register (ctx context.Context , body DatasetRegisterParams , opts ... option.RequestOption ) (res * DatasetRegisterResponse , err error ) {
101
- opts = append (r .Options [:] , opts ... )
102
+ opts = slices . Concat (r .Options , opts )
102
103
path := "v1/datasets"
103
104
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
104
105
return
105
106
}
106
107
107
108
// Unregister a dataset by its ID.
108
109
func (r * DatasetService ) Unregister (ctx context.Context , datasetID string , opts ... option.RequestOption ) (err error ) {
109
- opts = append (r .Options [:] , opts ... )
110
+ opts = slices . Concat (r .Options , opts )
110
111
opts = append ([]option.RequestOption {option .WithHeader ("Accept" , "" )}, opts ... )
111
112
if datasetID == "" {
112
113
err = errors .New ("missing required dataset_id parameter" )
0 commit comments