Skip to content

Commit b12bb38

Browse files
feat: ENG-82904 - chore: update ReplicaEvent schema
1 parent dbc5efe commit b12bb38

File tree

16 files changed

+839
-111
lines changed

16 files changed

+839
-111
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 75
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-9d21c718836b00960cf34f6a1c14648ebcb1e747fc1a02006c56eaa571e0e261.yml
3-
openapi_spec_hash: b60875195a5f6dd59a2d7c6c75a23a43
4-
config_hash: 66b14e6bbf15a00f288e60f03ef44c4a
1+
configured_endpoints: 83
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-dc45695614158674dec4da8ae843a7564905f24d2ce577e8e6e5246b4a7b0f61.yml
3+
openapi_spec_hash: 46a91a84c8c270792676ee863b33ab99
4+
config_hash: 419603b503b8f5b6147b585b6d778b27

MIGRATION.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ Readable.fromWeb(res.body).pipe(process.stdout);
3838

3939
Additionally, the `headers` property on `APIError` objects is now an instance of the Web [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) class. It was previously defined as `Record<string, string | null | undefined>`.
4040

41+
### Named path parameters
42+
43+
Methods that take multiple path parameters typically now use named instead of positional arguments for better clarity and to prevent a footgun where it was easy to accidentally pass arguments in the incorrect order.
44+
45+
For example, for a method that would call an endpoint at `/v1/parents/{parent_id}/children/{child_id}`, only the _last_ path parameter is positional and the rest must be passed as named arguments.
46+
47+
```ts
48+
// Before
49+
client.parents.children.retrieve('p_123', 'c_456');
50+
51+
// After
52+
client.parents.children.retrieve('c_456', { parent_id: 'p_123' });
53+
```
54+
55+
This affects the following methods:
56+
57+
- `client.rl.trainingSessions.operations.retrieveForwardBackward()`
58+
- `client.rl.trainingSessions.operations.retrieveOptimStep()`
59+
4160
### URI encoded path parameters
4261

4362
Path params are now properly encoded by default. If you were manually encoding path parameters before giving them to the SDK, you must now stop doing that and pass the
@@ -73,6 +92,7 @@ This affects the following methods:
7392
- `client.endpoints.list()`
7493
- `client.endpoints.listHardware()`
7594
- `client.evals.list()`
95+
- `client.rl.trainingSessions.list()`
7696

7797
### Removed `httpAgent` in favor of `fetchOptions`
7898

api.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,23 @@ Methods:
364364
- <code title="get /evaluation/{id}">client.evals.<a href="./src/resources/evals.ts">retrieve</a>(id) -> EvaluationJob</code>
365365
- <code title="get /evaluation">client.evals.<a href="./src/resources/evals.ts">list</a>({ ...params }) -> EvalListResponse</code>
366366
- <code title="get /evaluation/{id}/status">client.evals.<a href="./src/resources/evals.ts">status</a>(id) -> EvalStatusResponse</code>
367+
368+
# Rl
369+
370+
## TrainingSessions
371+
372+
Methods:
373+
374+
- <code title="post /rl/training-sessions">client.rl.trainingSessions.<a href="./src/resources/rl/training-sessions/training-sessions.ts">create</a>({ ...params }) -> void</code>
375+
- <code title="get /rl/training-sessions/{session_id}">client.rl.trainingSessions.<a href="./src/resources/rl/training-sessions/training-sessions.ts">retrieve</a>(sessionID) -> void</code>
376+
- <code title="get /rl/training-sessions">client.rl.trainingSessions.<a href="./src/resources/rl/training-sessions/training-sessions.ts">list</a>({ ...params }) -> void</code>
377+
- <code title="post /rl/training-sessions/{session_id}:forward-backward">client.rl.trainingSessions.<a href="./src/resources/rl/training-sessions/training-sessions.ts">forwardBackward</a>(sessionID, { ...params }) -> void</code>
378+
- <code title="post /rl/training-sessions/{session_id}:optim-step">client.rl.trainingSessions.<a href="./src/resources/rl/training-sessions/training-sessions.ts">optimStep</a>(sessionID, { ...params }) -> void</code>
379+
- <code title="post /rl/training-sessions/{session_id}:stop">client.rl.trainingSessions.<a href="./src/resources/rl/training-sessions/training-sessions.ts">stop</a>(sessionID) -> void</code>
380+
381+
### Operations
382+
383+
Methods:
384+
385+
- <code title="get /rl/training-sessions/{session_id}/operations/forward-backward/{operation_id}">client.rl.trainingSessions.operations.<a href="./src/resources/rl/training-sessions/operations.ts">retrieveForwardBackward</a>(operationID, { ...params }) -> void</code>
386+
- <code title="get /rl/training-sessions/{session_id}/operations/optim-step/{operation_id}">client.rl.trainingSessions.operations.<a href="./src/resources/rl/training-sessions/operations.ts">retrieveOptimStep</a>(operationID, { ...params }) -> void</code>

bin/migration-config.json

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,72 @@
22
"pkg": "together-ai",
33
"githubRepo": "https://github.com/togethercomputer/together-typescript",
44
"clientClass": "Together",
5-
"methods": []
5+
"methods": [
6+
{
7+
"base": "rl.trainingSessions.operations",
8+
"name": "retrieveForwardBackward",
9+
"params": [
10+
{
11+
"type": "param",
12+
"key": "operation_id",
13+
"location": "path"
14+
},
15+
{
16+
"type": "params",
17+
"maybeOverload": false
18+
},
19+
{
20+
"type": "options"
21+
}
22+
],
23+
"oldParams": [
24+
{
25+
"type": "param",
26+
"key": "session_id",
27+
"location": "path"
28+
},
29+
{
30+
"type": "param",
31+
"key": "operation_id",
32+
"location": "path"
33+
},
34+
{
35+
"type": "options"
36+
}
37+
]
38+
},
39+
{
40+
"base": "rl.trainingSessions.operations",
41+
"name": "retrieveOptimStep",
42+
"params": [
43+
{
44+
"type": "param",
45+
"key": "operation_id",
46+
"location": "path"
47+
},
48+
{
49+
"type": "params",
50+
"maybeOverload": false
51+
},
52+
{
53+
"type": "options"
54+
}
55+
],
56+
"oldParams": [
57+
{
58+
"type": "param",
59+
"key": "session_id",
60+
"location": "path"
61+
},
62+
{
63+
"type": "param",
64+
"key": "operation_id",
65+
"location": "path"
66+
},
67+
{
68+
"type": "options"
69+
}
70+
]
71+
}
72+
]
673
}

src/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import {
101101
ModelUploadResponse,
102102
Models,
103103
} from './resources/models/models';
104+
import { Rl } from './resources/rl/rl';
104105
import { type Fetch } from './internal/builtin-types';
105106
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
106107
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -815,6 +816,7 @@ export class Together {
815816
rerank: API.Rerank = new API.Rerank(this);
816817
batches: API.Batches = new API.Batches(this);
817818
evals: API.Evals = new API.Evals(this);
819+
rl: API.Rl = new API.Rl(this);
818820
}
819821

820822
Together.Beta = Beta;
@@ -832,6 +834,7 @@ Together.Endpoints = Endpoints;
832834
Together.Rerank = Rerank;
833835
Together.Batches = Batches;
834836
Together.Evals = Evals;
837+
Together.Rl = Rl;
835838

836839
export declare namespace Together {
837840
export type RequestOptions = Opts.RequestOptions;
@@ -953,4 +956,6 @@ export declare namespace Together {
953956
type EvalCreateParams as EvalCreateParams,
954957
type EvalListParams as EvalListParams,
955958
};
959+
960+
export { Rl as Rl };
956961
}

src/resources/beta/jig/jig.ts

Lines changed: 19 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -243,27 +243,9 @@ export namespace Deployment {
243243

244244
export interface ReplicaEvents {
245245
/**
246-
* ContainerStatus provides detailed status information about the container within
247-
* this replica
246+
* Image is the container image used for this replica
248247
*/
249-
container_status?: ReplicaEvents.ContainerStatus;
250-
251-
/**
252-
* Events is a list of Kubernetes events related to this replica for
253-
* troubleshooting
254-
*/
255-
events?: Array<ReplicaEvents.Event>;
256-
257-
/**
258-
* ReplicaCompletedAt is the timestamp when the replica finished execution
259-
*/
260-
replica_completed_at?: string;
261-
262-
/**
263-
* ReplicaMarkedForTerminationAt is the timestamp when the replica was marked for
264-
* termination
265-
*/
266-
replica_marked_for_termination_at?: string;
248+
image?: string;
267249

268250
/**
269251
* ReplicaReadySince is the timestamp when the replica became ready to serve
@@ -272,18 +254,8 @@ export namespace Deployment {
272254
replica_ready_since?: string;
273255

274256
/**
275-
* ReplicaRunningSince is the timestamp when the replica entered the running state
276-
*/
277-
replica_running_since?: string;
278-
279-
/**
280-
* ReplicaStartedAt is the timestamp when the replica was created
281-
*/
282-
replica_started_at?: string;
283-
284-
/**
285-
* ReplicaStatus is the current status of the replica (e.g., "Running", "Pending",
286-
* "Failed")
257+
* ReplicaStatus is the current status of the replica (e.g., "Running", "Waiting",
258+
* "Terminated")
287259
*/
288260
replica_status?: string;
289261

@@ -300,84 +272,25 @@ export namespace Deployment {
300272
replica_status_reason?: string;
301273

302274
/**
303-
* ScheduledOnCluster identifies which cluster this replica is scheduled on
275+
* RevisionID is the deployment revision ID associated with this replica
304276
*/
305-
scheduled_on_cluster?: string;
306-
}
277+
revision_id?: string;
278+
279+
/**
280+
* VolumePreloadCompletedAt is the timestamp when the volume preload completed
281+
*/
282+
volume_preload_completed_at?: string;
283+
284+
/**
285+
* VolumePreloadStartedAt is the timestamp when the volume preload started
286+
*/
287+
volume_preload_started_at?: string;
307288

308-
export namespace ReplicaEvents {
309289
/**
310-
* ContainerStatus provides detailed status information about the container within
311-
* this replica
290+
* VolumePreloadStatus is the status of the volume preload (e.g., "InProgress",
291+
* "Completed", "Failed")
312292
*/
313-
export interface ContainerStatus {
314-
/**
315-
* FinishedAt is the timestamp when the container finished execution (if
316-
* terminated)
317-
*/
318-
finishedAt?: string;
319-
320-
/**
321-
* Message provides a human-readable message with details about the container's
322-
* status
323-
*/
324-
message?: string;
325-
326-
/**
327-
* Name is the name of the container
328-
*/
329-
name?: string;
330-
331-
/**
332-
* Reason provides a brief machine-readable reason for the container's current
333-
* status
334-
*/
335-
reason?: string;
336-
337-
/**
338-
* StartedAt is the timestamp when the container started execution
339-
*/
340-
startedAt?: string;
341-
342-
/**
343-
* Status is the current state of the container (e.g., "Running", "Terminated",
344-
* "Waiting")
345-
*/
346-
status?: string;
347-
}
348-
349-
export interface Event {
350-
/**
351-
* Action is the action taken or reported by this event
352-
*/
353-
action?: string;
354-
355-
/**
356-
* Count is the number of times this event has occurred
357-
*/
358-
count?: number;
359-
360-
/**
361-
* FirstSeen is the timestamp when this event was first observed
362-
*/
363-
first_seen?: string;
364-
365-
/**
366-
* LastSeen is the timestamp when this event was last observed
367-
*/
368-
last_seen?: string;
369-
370-
/**
371-
* Message is a human-readable description of the event
372-
*/
373-
message?: string;
374-
375-
/**
376-
* Reason is a brief machine-readable reason for this event (e.g., "Pulling",
377-
* "Started", "Failed")
378-
*/
379-
reason?: string;
380-
}
293+
volume_preload_status?: string;
381294
}
382295

383296
export interface Volume {

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ export {
9090
type ModelUploadParams,
9191
} from './models/models';
9292
export { Rerank, type RerankCreateResponse, type RerankCreateParams } from './rerank';
93+
export { Rl } from './rl/rl';
9394
export { Videos, type VideoJob, type VideoCreateParams } from './videos';

src/resources/rl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export * from './rl/index';

src/resources/rl/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { Rl } from './rl';
4+
export {
5+
TrainingSessions,
6+
type TrainingSessionCreateParams,
7+
type TrainingSessionListParams,
8+
type TrainingSessionForwardBackwardParams,
9+
type TrainingSessionOptimStepParams,
10+
} from './training-sessions/index';

src/resources/rl/rl.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../core/resource';
4+
import * as TrainingSessionsAPI from './training-sessions/training-sessions';
5+
import {
6+
TrainingSessionCreateParams,
7+
TrainingSessionForwardBackwardParams,
8+
TrainingSessionListParams,
9+
TrainingSessionOptimStepParams,
10+
TrainingSessions,
11+
} from './training-sessions/training-sessions';
12+
13+
export class Rl extends APIResource {
14+
trainingSessions: TrainingSessionsAPI.TrainingSessions = new TrainingSessionsAPI.TrainingSessions(
15+
this._client,
16+
);
17+
}
18+
19+
Rl.TrainingSessions = TrainingSessions;
20+
21+
export declare namespace Rl {
22+
export {
23+
TrainingSessions as TrainingSessions,
24+
type TrainingSessionCreateParams as TrainingSessionCreateParams,
25+
type TrainingSessionListParams as TrainingSessionListParams,
26+
type TrainingSessionForwardBackwardParams as TrainingSessionForwardBackwardParams,
27+
type TrainingSessionOptimStepParams as TrainingSessionOptimStepParams,
28+
};
29+
}

0 commit comments

Comments
 (0)