together 2.0.0a17__py3-none-any.whl → 2.0.0a18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. together/_base_client.py +5 -2
  2. together/_client.py +1 -39
  3. together/_compat.py +3 -3
  4. together/_utils/_json.py +35 -0
  5. together/_version.py +1 -1
  6. together/lib/cli/api/endpoints/create.py +7 -3
  7. together/lib/cli/api/endpoints/hardware.py +37 -6
  8. together/lib/cli/api/models/upload.py +5 -1
  9. together/resources/__init__.py +0 -14
  10. together/resources/beta/__init__.py +14 -0
  11. together/resources/beta/beta.py +32 -0
  12. together/resources/beta/clusters/clusters.py +12 -12
  13. together/resources/beta/clusters/storage.py +10 -10
  14. together/resources/beta/jig/__init__.py +61 -0
  15. together/resources/beta/jig/jig.py +1024 -0
  16. together/resources/beta/jig/queue.py +482 -0
  17. together/resources/beta/jig/secrets.py +548 -0
  18. together/resources/beta/jig/volumes.py +514 -0
  19. together/resources/chat/completions.py +10 -0
  20. together/resources/models/__init__.py +33 -0
  21. together/resources/{models.py → models/models.py} +41 -9
  22. together/resources/models/uploads.py +163 -0
  23. together/types/__init__.py +0 -2
  24. together/types/beta/__init__.py +6 -0
  25. together/types/beta/deployment.py +261 -0
  26. together/types/beta/deployment_logs.py +11 -0
  27. together/types/beta/jig/__init__.py +20 -0
  28. together/types/beta/jig/queue_cancel_params.py +13 -0
  29. together/types/beta/jig/queue_cancel_response.py +11 -0
  30. together/types/beta/jig/queue_metrics_params.py +12 -0
  31. together/types/beta/jig/queue_metrics_response.py +8 -0
  32. together/types/beta/jig/queue_retrieve_params.py +15 -0
  33. together/types/beta/jig/queue_retrieve_response.py +35 -0
  34. together/types/beta/jig/queue_submit_params.py +19 -0
  35. together/types/beta/jig/queue_submit_response.py +25 -0
  36. together/types/beta/jig/secret.py +33 -0
  37. together/types/beta/jig/secret_create_params.py +34 -0
  38. together/types/beta/jig/secret_list_response.py +16 -0
  39. together/types/beta/jig/secret_update_params.py +34 -0
  40. together/types/beta/jig/volume.py +47 -0
  41. together/types/beta/jig/volume_create_params.py +34 -0
  42. together/types/beta/jig/volume_list_response.py +16 -0
  43. together/types/beta/jig/volume_update_params.py +34 -0
  44. together/types/beta/jig_deploy_params.py +150 -0
  45. together/types/beta/jig_list_response.py +16 -0
  46. together/types/beta/jig_retrieve_logs_params.py +15 -0
  47. together/types/beta/jig_update_params.py +141 -0
  48. together/types/chat/completion_create_params.py +11 -0
  49. together/types/models/__init__.py +5 -0
  50. together/types/{job_retrieve_response.py → models/upload_status_response.py} +3 -3
  51. {together-2.0.0a17.dist-info → together-2.0.0a18.dist-info}/METADATA +11 -14
  52. {together-2.0.0a17.dist-info → together-2.0.0a18.dist-info}/RECORD +55 -25
  53. together/resources/jobs.py +0 -214
  54. together/types/job_list_response.py +0 -47
  55. {together-2.0.0a17.dist-info → together-2.0.0a18.dist-info}/WHEEL +0 -0
  56. {together-2.0.0a17.dist-info → together-2.0.0a18.dist-info}/entry_points.txt +0 -0
  57. {together-2.0.0a17.dist-info → together-2.0.0a18.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,548 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
8
+ from ...._utils import maybe_transform, async_maybe_transform
9
+ from ...._compat import cached_property
10
+ from ...._resource import SyncAPIResource, AsyncAPIResource
11
+ from ...._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ...._base_client import make_request_options
18
+ from ....types.beta.jig import secret_create_params, secret_update_params
19
+ from ....types.beta.jig.secret import Secret
20
+ from ....types.beta.jig.secret_list_response import SecretListResponse
21
+
22
+ __all__ = ["SecretsResource", "AsyncSecretsResource"]
23
+
24
+
25
+ class SecretsResource(SyncAPIResource):
26
+ @cached_property
27
+ def with_raw_response(self) -> SecretsResourceWithRawResponse:
28
+ """
29
+ This property can be used as a prefix for any HTTP method call to return
30
+ the raw response object instead of the parsed content.
31
+
32
+ For more information, see https://www.github.com/togethercomputer/together-py#accessing-raw-response-data-eg-headers
33
+ """
34
+ return SecretsResourceWithRawResponse(self)
35
+
36
+ @cached_property
37
+ def with_streaming_response(self) -> SecretsResourceWithStreamingResponse:
38
+ """
39
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
40
+
41
+ For more information, see https://www.github.com/togethercomputer/together-py#with_streaming_response
42
+ """
43
+ return SecretsResourceWithStreamingResponse(self)
44
+
45
+ def create(
46
+ self,
47
+ *,
48
+ name: str,
49
+ value: str,
50
+ description: str | Omit = omit,
51
+ project_id: str | Omit = omit,
52
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
53
+ # The extra values given here take precedence over values defined on the client or passed to this method.
54
+ extra_headers: Headers | None = None,
55
+ extra_query: Query | None = None,
56
+ extra_body: Body | None = None,
57
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
58
+ ) -> Secret:
59
+ """
60
+ Create a new secret to store sensitive configuration values
61
+
62
+ Args:
63
+ name: Name is the unique identifier for the secret. Can contain alphanumeric
64
+ characters, underscores, hyphens, forward slashes, and periods (1-100
65
+ characters)
66
+
67
+ value: Value is the sensitive data to store securely (e.g., API keys, passwords,
68
+ tokens). This value will be encrypted at rest
69
+
70
+ description: Description is an optional human-readable description of the secret's purpose
71
+ (max 500 characters)
72
+
73
+ project_id: ProjectID is ignored - the project is automatically determined from your
74
+ authentication
75
+
76
+ extra_headers: Send extra headers
77
+
78
+ extra_query: Add additional query parameters to the request
79
+
80
+ extra_body: Add additional JSON properties to the request
81
+
82
+ timeout: Override the client-level default timeout for this request, in seconds
83
+ """
84
+ return self._post(
85
+ "/deployments/secrets",
86
+ body=maybe_transform(
87
+ {
88
+ "name": name,
89
+ "value": value,
90
+ "description": description,
91
+ "project_id": project_id,
92
+ },
93
+ secret_create_params.SecretCreateParams,
94
+ ),
95
+ options=make_request_options(
96
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
97
+ ),
98
+ cast_to=Secret,
99
+ )
100
+
101
+ def retrieve(
102
+ self,
103
+ id: str,
104
+ *,
105
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
106
+ # The extra values given here take precedence over values defined on the client or passed to this method.
107
+ extra_headers: Headers | None = None,
108
+ extra_query: Query | None = None,
109
+ extra_body: Body | None = None,
110
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
111
+ ) -> Secret:
112
+ """
113
+ Retrieve details of a specific secret by its ID or name
114
+
115
+ Args:
116
+ extra_headers: Send extra headers
117
+
118
+ extra_query: Add additional query parameters to the request
119
+
120
+ extra_body: Add additional JSON properties to the request
121
+
122
+ timeout: Override the client-level default timeout for this request, in seconds
123
+ """
124
+ if not id:
125
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
126
+ return self._get(
127
+ f"/deployments/secrets/{id}",
128
+ options=make_request_options(
129
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
130
+ ),
131
+ cast_to=Secret,
132
+ )
133
+
134
+ def update(
135
+ self,
136
+ id: str,
137
+ *,
138
+ description: str | Omit = omit,
139
+ name: str | Omit = omit,
140
+ project_id: str | Omit = omit,
141
+ value: str | Omit = omit,
142
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
143
+ # The extra values given here take precedence over values defined on the client or passed to this method.
144
+ extra_headers: Headers | None = None,
145
+ extra_query: Query | None = None,
146
+ extra_body: Body | None = None,
147
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
148
+ ) -> Secret:
149
+ """
150
+ Update an existing secret's value or metadata
151
+
152
+ Args:
153
+ description: Description is an optional human-readable description of the secret's purpose
154
+ (max 500 characters)
155
+
156
+ name: Name is the new unique identifier for the secret. Can contain alphanumeric
157
+ characters, underscores, hyphens, forward slashes, and periods (1-100
158
+ characters)
159
+
160
+ project_id: ProjectID is ignored - the project is automatically determined from your
161
+ authentication
162
+
163
+ value: Value is the new sensitive data to store securely. Updating this will replace
164
+ the existing secret value
165
+
166
+ extra_headers: Send extra headers
167
+
168
+ extra_query: Add additional query parameters to the request
169
+
170
+ extra_body: Add additional JSON properties to the request
171
+
172
+ timeout: Override the client-level default timeout for this request, in seconds
173
+ """
174
+ if not id:
175
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
176
+ return self._patch(
177
+ f"/deployments/secrets/{id}",
178
+ body=maybe_transform(
179
+ {
180
+ "description": description,
181
+ "name": name,
182
+ "project_id": project_id,
183
+ "value": value,
184
+ },
185
+ secret_update_params.SecretUpdateParams,
186
+ ),
187
+ options=make_request_options(
188
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
189
+ ),
190
+ cast_to=Secret,
191
+ )
192
+
193
+ def list(
194
+ self,
195
+ *,
196
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
197
+ # The extra values given here take precedence over values defined on the client or passed to this method.
198
+ extra_headers: Headers | None = None,
199
+ extra_query: Query | None = None,
200
+ extra_body: Body | None = None,
201
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
202
+ ) -> SecretListResponse:
203
+ """Retrieve all secrets in your project"""
204
+ return self._get(
205
+ "/deployments/secrets",
206
+ options=make_request_options(
207
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
208
+ ),
209
+ cast_to=SecretListResponse,
210
+ )
211
+
212
+ def delete(
213
+ self,
214
+ id: str,
215
+ *,
216
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
217
+ # The extra values given here take precedence over values defined on the client or passed to this method.
218
+ extra_headers: Headers | None = None,
219
+ extra_query: Query | None = None,
220
+ extra_body: Body | None = None,
221
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
222
+ ) -> object:
223
+ """
224
+ Delete an existing secret
225
+
226
+ Args:
227
+ extra_headers: Send extra headers
228
+
229
+ extra_query: Add additional query parameters to the request
230
+
231
+ extra_body: Add additional JSON properties to the request
232
+
233
+ timeout: Override the client-level default timeout for this request, in seconds
234
+ """
235
+ if not id:
236
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
237
+ return self._delete(
238
+ f"/deployments/secrets/{id}",
239
+ options=make_request_options(
240
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
241
+ ),
242
+ cast_to=object,
243
+ )
244
+
245
+
246
+ class AsyncSecretsResource(AsyncAPIResource):
247
+ @cached_property
248
+ def with_raw_response(self) -> AsyncSecretsResourceWithRawResponse:
249
+ """
250
+ This property can be used as a prefix for any HTTP method call to return
251
+ the raw response object instead of the parsed content.
252
+
253
+ For more information, see https://www.github.com/togethercomputer/together-py#accessing-raw-response-data-eg-headers
254
+ """
255
+ return AsyncSecretsResourceWithRawResponse(self)
256
+
257
+ @cached_property
258
+ def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse:
259
+ """
260
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
261
+
262
+ For more information, see https://www.github.com/togethercomputer/together-py#with_streaming_response
263
+ """
264
+ return AsyncSecretsResourceWithStreamingResponse(self)
265
+
266
+ async def create(
267
+ self,
268
+ *,
269
+ name: str,
270
+ value: str,
271
+ description: str | Omit = omit,
272
+ project_id: str | Omit = omit,
273
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
274
+ # The extra values given here take precedence over values defined on the client or passed to this method.
275
+ extra_headers: Headers | None = None,
276
+ extra_query: Query | None = None,
277
+ extra_body: Body | None = None,
278
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
279
+ ) -> Secret:
280
+ """
281
+ Create a new secret to store sensitive configuration values
282
+
283
+ Args:
284
+ name: Name is the unique identifier for the secret. Can contain alphanumeric
285
+ characters, underscores, hyphens, forward slashes, and periods (1-100
286
+ characters)
287
+
288
+ value: Value is the sensitive data to store securely (e.g., API keys, passwords,
289
+ tokens). This value will be encrypted at rest
290
+
291
+ description: Description is an optional human-readable description of the secret's purpose
292
+ (max 500 characters)
293
+
294
+ project_id: ProjectID is ignored - the project is automatically determined from your
295
+ authentication
296
+
297
+ extra_headers: Send extra headers
298
+
299
+ extra_query: Add additional query parameters to the request
300
+
301
+ extra_body: Add additional JSON properties to the request
302
+
303
+ timeout: Override the client-level default timeout for this request, in seconds
304
+ """
305
+ return await self._post(
306
+ "/deployments/secrets",
307
+ body=await async_maybe_transform(
308
+ {
309
+ "name": name,
310
+ "value": value,
311
+ "description": description,
312
+ "project_id": project_id,
313
+ },
314
+ secret_create_params.SecretCreateParams,
315
+ ),
316
+ options=make_request_options(
317
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
318
+ ),
319
+ cast_to=Secret,
320
+ )
321
+
322
+ async def retrieve(
323
+ self,
324
+ id: str,
325
+ *,
326
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
327
+ # The extra values given here take precedence over values defined on the client or passed to this method.
328
+ extra_headers: Headers | None = None,
329
+ extra_query: Query | None = None,
330
+ extra_body: Body | None = None,
331
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
332
+ ) -> Secret:
333
+ """
334
+ Retrieve details of a specific secret by its ID or name
335
+
336
+ Args:
337
+ extra_headers: Send extra headers
338
+
339
+ extra_query: Add additional query parameters to the request
340
+
341
+ extra_body: Add additional JSON properties to the request
342
+
343
+ timeout: Override the client-level default timeout for this request, in seconds
344
+ """
345
+ if not id:
346
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
347
+ return await self._get(
348
+ f"/deployments/secrets/{id}",
349
+ options=make_request_options(
350
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
351
+ ),
352
+ cast_to=Secret,
353
+ )
354
+
355
+ async def update(
356
+ self,
357
+ id: str,
358
+ *,
359
+ description: str | Omit = omit,
360
+ name: str | Omit = omit,
361
+ project_id: str | Omit = omit,
362
+ value: str | Omit = omit,
363
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
364
+ # The extra values given here take precedence over values defined on the client or passed to this method.
365
+ extra_headers: Headers | None = None,
366
+ extra_query: Query | None = None,
367
+ extra_body: Body | None = None,
368
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
369
+ ) -> Secret:
370
+ """
371
+ Update an existing secret's value or metadata
372
+
373
+ Args:
374
+ description: Description is an optional human-readable description of the secret's purpose
375
+ (max 500 characters)
376
+
377
+ name: Name is the new unique identifier for the secret. Can contain alphanumeric
378
+ characters, underscores, hyphens, forward slashes, and periods (1-100
379
+ characters)
380
+
381
+ project_id: ProjectID is ignored - the project is automatically determined from your
382
+ authentication
383
+
384
+ value: Value is the new sensitive data to store securely. Updating this will replace
385
+ the existing secret value
386
+
387
+ extra_headers: Send extra headers
388
+
389
+ extra_query: Add additional query parameters to the request
390
+
391
+ extra_body: Add additional JSON properties to the request
392
+
393
+ timeout: Override the client-level default timeout for this request, in seconds
394
+ """
395
+ if not id:
396
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
397
+ return await self._patch(
398
+ f"/deployments/secrets/{id}",
399
+ body=await async_maybe_transform(
400
+ {
401
+ "description": description,
402
+ "name": name,
403
+ "project_id": project_id,
404
+ "value": value,
405
+ },
406
+ secret_update_params.SecretUpdateParams,
407
+ ),
408
+ options=make_request_options(
409
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
410
+ ),
411
+ cast_to=Secret,
412
+ )
413
+
414
+ async def list(
415
+ self,
416
+ *,
417
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
418
+ # The extra values given here take precedence over values defined on the client or passed to this method.
419
+ extra_headers: Headers | None = None,
420
+ extra_query: Query | None = None,
421
+ extra_body: Body | None = None,
422
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
423
+ ) -> SecretListResponse:
424
+ """Retrieve all secrets in your project"""
425
+ return await self._get(
426
+ "/deployments/secrets",
427
+ options=make_request_options(
428
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
429
+ ),
430
+ cast_to=SecretListResponse,
431
+ )
432
+
433
+ async def delete(
434
+ self,
435
+ id: str,
436
+ *,
437
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
438
+ # The extra values given here take precedence over values defined on the client or passed to this method.
439
+ extra_headers: Headers | None = None,
440
+ extra_query: Query | None = None,
441
+ extra_body: Body | None = None,
442
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
443
+ ) -> object:
444
+ """
445
+ Delete an existing secret
446
+
447
+ Args:
448
+ extra_headers: Send extra headers
449
+
450
+ extra_query: Add additional query parameters to the request
451
+
452
+ extra_body: Add additional JSON properties to the request
453
+
454
+ timeout: Override the client-level default timeout for this request, in seconds
455
+ """
456
+ if not id:
457
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
458
+ return await self._delete(
459
+ f"/deployments/secrets/{id}",
460
+ options=make_request_options(
461
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
462
+ ),
463
+ cast_to=object,
464
+ )
465
+
466
+
467
+ class SecretsResourceWithRawResponse:
468
+ def __init__(self, secrets: SecretsResource) -> None:
469
+ self._secrets = secrets
470
+
471
+ self.create = to_raw_response_wrapper(
472
+ secrets.create,
473
+ )
474
+ self.retrieve = to_raw_response_wrapper(
475
+ secrets.retrieve,
476
+ )
477
+ self.update = to_raw_response_wrapper(
478
+ secrets.update,
479
+ )
480
+ self.list = to_raw_response_wrapper(
481
+ secrets.list,
482
+ )
483
+ self.delete = to_raw_response_wrapper(
484
+ secrets.delete,
485
+ )
486
+
487
+
488
+ class AsyncSecretsResourceWithRawResponse:
489
+ def __init__(self, secrets: AsyncSecretsResource) -> None:
490
+ self._secrets = secrets
491
+
492
+ self.create = async_to_raw_response_wrapper(
493
+ secrets.create,
494
+ )
495
+ self.retrieve = async_to_raw_response_wrapper(
496
+ secrets.retrieve,
497
+ )
498
+ self.update = async_to_raw_response_wrapper(
499
+ secrets.update,
500
+ )
501
+ self.list = async_to_raw_response_wrapper(
502
+ secrets.list,
503
+ )
504
+ self.delete = async_to_raw_response_wrapper(
505
+ secrets.delete,
506
+ )
507
+
508
+
509
+ class SecretsResourceWithStreamingResponse:
510
+ def __init__(self, secrets: SecretsResource) -> None:
511
+ self._secrets = secrets
512
+
513
+ self.create = to_streamed_response_wrapper(
514
+ secrets.create,
515
+ )
516
+ self.retrieve = to_streamed_response_wrapper(
517
+ secrets.retrieve,
518
+ )
519
+ self.update = to_streamed_response_wrapper(
520
+ secrets.update,
521
+ )
522
+ self.list = to_streamed_response_wrapper(
523
+ secrets.list,
524
+ )
525
+ self.delete = to_streamed_response_wrapper(
526
+ secrets.delete,
527
+ )
528
+
529
+
530
+ class AsyncSecretsResourceWithStreamingResponse:
531
+ def __init__(self, secrets: AsyncSecretsResource) -> None:
532
+ self._secrets = secrets
533
+
534
+ self.create = async_to_streamed_response_wrapper(
535
+ secrets.create,
536
+ )
537
+ self.retrieve = async_to_streamed_response_wrapper(
538
+ secrets.retrieve,
539
+ )
540
+ self.update = async_to_streamed_response_wrapper(
541
+ secrets.update,
542
+ )
543
+ self.list = async_to_streamed_response_wrapper(
544
+ secrets.list,
545
+ )
546
+ self.delete = async_to_streamed_response_wrapper(
547
+ secrets.delete,
548
+ )