Skip to content

Commit 651e447

Browse files
feat(api): manual updates
1 parent be531db commit 651e447

File tree

3 files changed

+25
-187
lines changed

3 files changed

+25
-187
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: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-eacfa676c4ac9c051f61d4d25c1074315959b2e3d418bca529e6de2a9f6636e7.yml
33
openapi_spec_hash: 1d56caf3dd011e888fb911d34bd34aef
4-
config_hash: d037f56e1852edb91ceeb8cf7b12f50d
4+
config_hash: 50b86276412e927f8eb0e69e2857b1c7

api.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,14 @@ Params Types:
230230
Response Types:
231231

232232
- <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#Autoscaling">Autoscaling</a>
233-
- <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointNewResponse">EndpointNewResponse</a>
234-
- <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointGetResponse">EndpointGetResponse</a>
235-
- <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointUpdateResponse">EndpointUpdateResponse</a>
233+
- <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#DedicatedEndpoint">DedicatedEndpoint</a>
236234
- <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointListResponse">EndpointListResponse</a>
237235

238236
Methods:
239237

240-
- <code title="post /endpoints">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointNewParams">EndpointNewParams</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointNewResponse">EndpointNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
241-
- <code title="get /endpoints/{endpointId}">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, endpointID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointGetResponse">EndpointGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
242-
- <code title="patch /endpoints/{endpointId}">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, endpointID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointUpdateParams">EndpointUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointUpdateResponse">EndpointUpdateResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
238+
- <code title="post /endpoints">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointNewParams">EndpointNewParams</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#DedicatedEndpoint">DedicatedEndpoint</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
239+
- <code title="get /endpoints/{endpointId}">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, endpointID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#DedicatedEndpoint">DedicatedEndpoint</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
240+
- <code title="patch /endpoints/{endpointId}">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, endpointID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointUpdateParams">EndpointUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#DedicatedEndpoint">DedicatedEndpoint</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
243241
- <code title="get /endpoints">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointListParams">EndpointListParams</a>) (<a href="https://pkg.go.dev/github.com/togethercomputer/together-go">together</a>.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointListResponse">EndpointListResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
244242
- <code title="delete /endpoints/{endpointId}">client.Endpoints.<a href="https://pkg.go.dev/github.com/togethercomputer/together-go#EndpointService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, endpointID <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
245243

endpoint.go

Lines changed: 20 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewEndpointService(opts ...option.RequestOption) (r EndpointService) {
4242
// Creates a new dedicated endpoint for serving models. The endpoint will
4343
// automatically start after creation. You can deploy any supported model on
4444
// hardware configurations that meet the model's requirements.
45-
func (r *EndpointService) New(ctx context.Context, body EndpointNewParams, opts ...option.RequestOption) (res *EndpointNewResponse, err error) {
45+
func (r *EndpointService) New(ctx context.Context, body EndpointNewParams, opts ...option.RequestOption) (res *DedicatedEndpoint, err error) {
4646
opts = slices.Concat(r.Options, opts)
4747
path := "endpoints"
4848
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
@@ -51,7 +51,7 @@ func (r *EndpointService) New(ctx context.Context, body EndpointNewParams, opts
5151

5252
// Retrieves details about a specific endpoint, including its current state,
5353
// configuration, and scaling settings.
54-
func (r *EndpointService) Get(ctx context.Context, endpointID string, opts ...option.RequestOption) (res *EndpointGetResponse, err error) {
54+
func (r *EndpointService) Get(ctx context.Context, endpointID string, opts ...option.RequestOption) (res *DedicatedEndpoint, err error) {
5555
opts = slices.Concat(r.Options, opts)
5656
if endpointID == "" {
5757
err = errors.New("missing required endpointId parameter")
@@ -64,7 +64,7 @@ func (r *EndpointService) Get(ctx context.Context, endpointID string, opts ...op
6464

6565
// Updates an existing endpoint's configuration. You can modify the display name,
6666
// autoscaling settings, or change the endpoint's state (start/stop).
67-
func (r *EndpointService) Update(ctx context.Context, endpointID string, body EndpointUpdateParams, opts ...option.RequestOption) (res *EndpointUpdateResponse, err error) {
67+
func (r *EndpointService) Update(ctx context.Context, endpointID string, body EndpointUpdateParams, opts ...option.RequestOption) (res *DedicatedEndpoint, err error) {
6868
opts = slices.Concat(r.Options, opts)
6969
if endpointID == "" {
7070
err = errors.New("missing required endpointId parameter")
@@ -147,7 +147,7 @@ func (r *AutoscalingParam) UnmarshalJSON(data []byte) error {
147147
}
148148

149149
// Details about a dedicated endpoint deployment
150-
type EndpointNewResponse struct {
150+
type DedicatedEndpoint struct {
151151
// Unique identifier for the endpoint
152152
ID string `json:"id,required"`
153153
// Configuration for automatic scaling of the endpoint
@@ -165,17 +165,17 @@ type EndpointNewResponse struct {
165165
// The type of object
166166
//
167167
// Any of "endpoint".
168-
Object EndpointNewResponseObject `json:"object,required"`
168+
Object DedicatedEndpointObject `json:"object,required"`
169169
// The owner of this endpoint
170170
Owner string `json:"owner,required"`
171171
// Current state of the endpoint
172172
//
173173
// Any of "PENDING", "STARTING", "STARTED", "STOPPING", "STOPPED", "ERROR".
174-
State EndpointNewResponseState `json:"state,required"`
174+
State DedicatedEndpointState `json:"state,required"`
175175
// The type of endpoint
176176
//
177177
// Any of "dedicated".
178-
Type EndpointNewResponseType `json:"type,required"`
178+
Type DedicatedEndpointType `json:"type,required"`
179179
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
180180
JSON struct {
181181
ID respjson.Field
@@ -195,195 +195,35 @@ type EndpointNewResponse struct {
195195
}
196196

197197
// Returns the unmodified JSON received from the API
198-
func (r EndpointNewResponse) RawJSON() string { return r.JSON.raw }
199-
func (r *EndpointNewResponse) UnmarshalJSON(data []byte) error {
198+
func (r DedicatedEndpoint) RawJSON() string { return r.JSON.raw }
199+
func (r *DedicatedEndpoint) UnmarshalJSON(data []byte) error {
200200
return apijson.UnmarshalRoot(data, r)
201201
}
202202

203203
// The type of object
204-
type EndpointNewResponseObject string
204+
type DedicatedEndpointObject string
205205

206206
const (
207-
EndpointNewResponseObjectEndpoint EndpointNewResponseObject = "endpoint"
207+
DedicatedEndpointObjectEndpoint DedicatedEndpointObject = "endpoint"
208208
)
209209

210210
// Current state of the endpoint
211-
type EndpointNewResponseState string
211+
type DedicatedEndpointState string
212212

213213
const (
214-
EndpointNewResponseStatePending EndpointNewResponseState = "PENDING"
215-
EndpointNewResponseStateStarting EndpointNewResponseState = "STARTING"
216-
EndpointNewResponseStateStarted EndpointNewResponseState = "STARTED"
217-
EndpointNewResponseStateStopping EndpointNewResponseState = "STOPPING"
218-
EndpointNewResponseStateStopped EndpointNewResponseState = "STOPPED"
219-
EndpointNewResponseStateError EndpointNewResponseState = "ERROR"
214+
DedicatedEndpointStatePending DedicatedEndpointState = "PENDING"
215+
DedicatedEndpointStateStarting DedicatedEndpointState = "STARTING"
216+
DedicatedEndpointStateStarted DedicatedEndpointState = "STARTED"
217+
DedicatedEndpointStateStopping DedicatedEndpointState = "STOPPING"
218+
DedicatedEndpointStateStopped DedicatedEndpointState = "STOPPED"
219+
DedicatedEndpointStateError DedicatedEndpointState = "ERROR"
220220
)
221221

222222
// The type of endpoint
223-
type EndpointNewResponseType string
223+
type DedicatedEndpointType string
224224

225225
const (
226-
EndpointNewResponseTypeDedicated EndpointNewResponseType = "dedicated"
227-
)
228-
229-
// Details about a dedicated endpoint deployment
230-
type EndpointGetResponse struct {
231-
// Unique identifier for the endpoint
232-
ID string `json:"id,required"`
233-
// Configuration for automatic scaling of the endpoint
234-
Autoscaling Autoscaling `json:"autoscaling,required"`
235-
// Timestamp when the endpoint was created
236-
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
237-
// Human-readable name for the endpoint
238-
DisplayName string `json:"display_name,required"`
239-
// The hardware configuration used for this endpoint
240-
Hardware string `json:"hardware,required"`
241-
// The model deployed on this endpoint
242-
Model string `json:"model,required"`
243-
// System name for the endpoint
244-
Name string `json:"name,required"`
245-
// The type of object
246-
//
247-
// Any of "endpoint".
248-
Object EndpointGetResponseObject `json:"object,required"`
249-
// The owner of this endpoint
250-
Owner string `json:"owner,required"`
251-
// Current state of the endpoint
252-
//
253-
// Any of "PENDING", "STARTING", "STARTED", "STOPPING", "STOPPED", "ERROR".
254-
State EndpointGetResponseState `json:"state,required"`
255-
// The type of endpoint
256-
//
257-
// Any of "dedicated".
258-
Type EndpointGetResponseType `json:"type,required"`
259-
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
260-
JSON struct {
261-
ID respjson.Field
262-
Autoscaling respjson.Field
263-
CreatedAt respjson.Field
264-
DisplayName respjson.Field
265-
Hardware respjson.Field
266-
Model respjson.Field
267-
Name respjson.Field
268-
Object respjson.Field
269-
Owner respjson.Field
270-
State respjson.Field
271-
Type respjson.Field
272-
ExtraFields map[string]respjson.Field
273-
raw string
274-
} `json:"-"`
275-
}
276-
277-
// Returns the unmodified JSON received from the API
278-
func (r EndpointGetResponse) RawJSON() string { return r.JSON.raw }
279-
func (r *EndpointGetResponse) UnmarshalJSON(data []byte) error {
280-
return apijson.UnmarshalRoot(data, r)
281-
}
282-
283-
// The type of object
284-
type EndpointGetResponseObject string
285-
286-
const (
287-
EndpointGetResponseObjectEndpoint EndpointGetResponseObject = "endpoint"
288-
)
289-
290-
// Current state of the endpoint
291-
type EndpointGetResponseState string
292-
293-
const (
294-
EndpointGetResponseStatePending EndpointGetResponseState = "PENDING"
295-
EndpointGetResponseStateStarting EndpointGetResponseState = "STARTING"
296-
EndpointGetResponseStateStarted EndpointGetResponseState = "STARTED"
297-
EndpointGetResponseStateStopping EndpointGetResponseState = "STOPPING"
298-
EndpointGetResponseStateStopped EndpointGetResponseState = "STOPPED"
299-
EndpointGetResponseStateError EndpointGetResponseState = "ERROR"
300-
)
301-
302-
// The type of endpoint
303-
type EndpointGetResponseType string
304-
305-
const (
306-
EndpointGetResponseTypeDedicated EndpointGetResponseType = "dedicated"
307-
)
308-
309-
// Details about a dedicated endpoint deployment
310-
type EndpointUpdateResponse struct {
311-
// Unique identifier for the endpoint
312-
ID string `json:"id,required"`
313-
// Configuration for automatic scaling of the endpoint
314-
Autoscaling Autoscaling `json:"autoscaling,required"`
315-
// Timestamp when the endpoint was created
316-
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
317-
// Human-readable name for the endpoint
318-
DisplayName string `json:"display_name,required"`
319-
// The hardware configuration used for this endpoint
320-
Hardware string `json:"hardware,required"`
321-
// The model deployed on this endpoint
322-
Model string `json:"model,required"`
323-
// System name for the endpoint
324-
Name string `json:"name,required"`
325-
// The type of object
326-
//
327-
// Any of "endpoint".
328-
Object EndpointUpdateResponseObject `json:"object,required"`
329-
// The owner of this endpoint
330-
Owner string `json:"owner,required"`
331-
// Current state of the endpoint
332-
//
333-
// Any of "PENDING", "STARTING", "STARTED", "STOPPING", "STOPPED", "ERROR".
334-
State EndpointUpdateResponseState `json:"state,required"`
335-
// The type of endpoint
336-
//
337-
// Any of "dedicated".
338-
Type EndpointUpdateResponseType `json:"type,required"`
339-
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
340-
JSON struct {
341-
ID respjson.Field
342-
Autoscaling respjson.Field
343-
CreatedAt respjson.Field
344-
DisplayName respjson.Field
345-
Hardware respjson.Field
346-
Model respjson.Field
347-
Name respjson.Field
348-
Object respjson.Field
349-
Owner respjson.Field
350-
State respjson.Field
351-
Type respjson.Field
352-
ExtraFields map[string]respjson.Field
353-
raw string
354-
} `json:"-"`
355-
}
356-
357-
// Returns the unmodified JSON received from the API
358-
func (r EndpointUpdateResponse) RawJSON() string { return r.JSON.raw }
359-
func (r *EndpointUpdateResponse) UnmarshalJSON(data []byte) error {
360-
return apijson.UnmarshalRoot(data, r)
361-
}
362-
363-
// The type of object
364-
type EndpointUpdateResponseObject string
365-
366-
const (
367-
EndpointUpdateResponseObjectEndpoint EndpointUpdateResponseObject = "endpoint"
368-
)
369-
370-
// Current state of the endpoint
371-
type EndpointUpdateResponseState string
372-
373-
const (
374-
EndpointUpdateResponseStatePending EndpointUpdateResponseState = "PENDING"
375-
EndpointUpdateResponseStateStarting EndpointUpdateResponseState = "STARTING"
376-
EndpointUpdateResponseStateStarted EndpointUpdateResponseState = "STARTED"
377-
EndpointUpdateResponseStateStopping EndpointUpdateResponseState = "STOPPING"
378-
EndpointUpdateResponseStateStopped EndpointUpdateResponseState = "STOPPED"
379-
EndpointUpdateResponseStateError EndpointUpdateResponseState = "ERROR"
380-
)
381-
382-
// The type of endpoint
383-
type EndpointUpdateResponseType string
384-
385-
const (
386-
EndpointUpdateResponseTypeDedicated EndpointUpdateResponseType = "dedicated"
226+
DedicatedEndpointTypeDedicated DedicatedEndpointType = "dedicated"
387227
)
388228

389229
type EndpointListResponse struct {

0 commit comments

Comments
 (0)