together 2.0.0a18__py3-none-any.whl → 2.0.0a19__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.
@@ -1,181 +0,0 @@
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 hardware_list_params
8
- from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9
- from .._utils import maybe_transform, async_maybe_transform
10
- from .._compat import cached_property
11
- from .._resource import SyncAPIResource, AsyncAPIResource
12
- from .._response import (
13
- to_raw_response_wrapper,
14
- to_streamed_response_wrapper,
15
- async_to_raw_response_wrapper,
16
- async_to_streamed_response_wrapper,
17
- )
18
- from .._base_client import make_request_options
19
- from ..types.hardware_list_response import HardwareListResponse
20
-
21
- __all__ = ["HardwareResource", "AsyncHardwareResource"]
22
-
23
-
24
- class HardwareResource(SyncAPIResource):
25
- @cached_property
26
- def with_raw_response(self) -> HardwareResourceWithRawResponse:
27
- """
28
- This property can be used as a prefix for any HTTP method call to return
29
- the raw response object instead of the parsed content.
30
-
31
- For more information, see https://www.github.com/togethercomputer/together-py#accessing-raw-response-data-eg-headers
32
- """
33
- return HardwareResourceWithRawResponse(self)
34
-
35
- @cached_property
36
- def with_streaming_response(self) -> HardwareResourceWithStreamingResponse:
37
- """
38
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39
-
40
- For more information, see https://www.github.com/togethercomputer/together-py#with_streaming_response
41
- """
42
- return HardwareResourceWithStreamingResponse(self)
43
-
44
- def list(
45
- self,
46
- *,
47
- model: str | Omit = omit,
48
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
49
- # The extra values given here take precedence over values defined on the client or passed to this method.
50
- extra_headers: Headers | None = None,
51
- extra_query: Query | None = None,
52
- extra_body: Body | None = None,
53
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
54
- ) -> HardwareListResponse:
55
- """Returns a list of available hardware configurations for deploying models.
56
-
57
- When a
58
- model parameter is provided, it returns only hardware configurations compatible
59
- with that model, including their current availability status.
60
-
61
- Args:
62
- model: Filter hardware configurations by model compatibility. When provided, the
63
- response includes availability status for each compatible configuration.
64
-
65
- extra_headers: Send extra headers
66
-
67
- extra_query: Add additional query parameters to the request
68
-
69
- extra_body: Add additional JSON properties to the request
70
-
71
- timeout: Override the client-level default timeout for this request, in seconds
72
- """
73
- return self._get(
74
- "/hardware",
75
- options=make_request_options(
76
- extra_headers=extra_headers,
77
- extra_query=extra_query,
78
- extra_body=extra_body,
79
- timeout=timeout,
80
- query=maybe_transform({"model": model}, hardware_list_params.HardwareListParams),
81
- ),
82
- cast_to=HardwareListResponse,
83
- )
84
-
85
-
86
- class AsyncHardwareResource(AsyncAPIResource):
87
- @cached_property
88
- def with_raw_response(self) -> AsyncHardwareResourceWithRawResponse:
89
- """
90
- This property can be used as a prefix for any HTTP method call to return
91
- the raw response object instead of the parsed content.
92
-
93
- For more information, see https://www.github.com/togethercomputer/together-py#accessing-raw-response-data-eg-headers
94
- """
95
- return AsyncHardwareResourceWithRawResponse(self)
96
-
97
- @cached_property
98
- def with_streaming_response(self) -> AsyncHardwareResourceWithStreamingResponse:
99
- """
100
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
101
-
102
- For more information, see https://www.github.com/togethercomputer/together-py#with_streaming_response
103
- """
104
- return AsyncHardwareResourceWithStreamingResponse(self)
105
-
106
- async def list(
107
- self,
108
- *,
109
- model: str | Omit = omit,
110
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111
- # The extra values given here take precedence over values defined on the client or passed to this method.
112
- extra_headers: Headers | None = None,
113
- extra_query: Query | None = None,
114
- extra_body: Body | None = None,
115
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
116
- ) -> HardwareListResponse:
117
- """Returns a list of available hardware configurations for deploying models.
118
-
119
- When a
120
- model parameter is provided, it returns only hardware configurations compatible
121
- with that model, including their current availability status.
122
-
123
- Args:
124
- model: Filter hardware configurations by model compatibility. When provided, the
125
- response includes availability status for each compatible configuration.
126
-
127
- extra_headers: Send extra headers
128
-
129
- extra_query: Add additional query parameters to the request
130
-
131
- extra_body: Add additional JSON properties to the request
132
-
133
- timeout: Override the client-level default timeout for this request, in seconds
134
- """
135
- return await self._get(
136
- "/hardware",
137
- options=make_request_options(
138
- extra_headers=extra_headers,
139
- extra_query=extra_query,
140
- extra_body=extra_body,
141
- timeout=timeout,
142
- query=await async_maybe_transform({"model": model}, hardware_list_params.HardwareListParams),
143
- ),
144
- cast_to=HardwareListResponse,
145
- )
146
-
147
-
148
- class HardwareResourceWithRawResponse:
149
- def __init__(self, hardware: HardwareResource) -> None:
150
- self._hardware = hardware
151
-
152
- self.list = to_raw_response_wrapper(
153
- hardware.list,
154
- )
155
-
156
-
157
- class AsyncHardwareResourceWithRawResponse:
158
- def __init__(self, hardware: AsyncHardwareResource) -> None:
159
- self._hardware = hardware
160
-
161
- self.list = async_to_raw_response_wrapper(
162
- hardware.list,
163
- )
164
-
165
-
166
- class HardwareResourceWithStreamingResponse:
167
- def __init__(self, hardware: HardwareResource) -> None:
168
- self._hardware = hardware
169
-
170
- self.list = to_streamed_response_wrapper(
171
- hardware.list,
172
- )
173
-
174
-
175
- class AsyncHardwareResourceWithStreamingResponse:
176
- def __init__(self, hardware: AsyncHardwareResource) -> None:
177
- self._hardware = hardware
178
-
179
- self.list = async_to_streamed_response_wrapper(
180
- hardware.list,
181
- )