together 1.4.5__tar.gz → 1.4.6__tar.gz

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 (65) hide show
  1. {together-1.4.5 → together-1.4.6}/PKG-INFO +1 -1
  2. {together-1.4.5 → together-1.4.6}/pyproject.toml +1 -1
  3. {together-1.4.5 → together-1.4.6}/src/together/cli/api/endpoints.py +20 -1
  4. {together-1.4.5 → together-1.4.6}/src/together/cli/api/models.py +20 -7
  5. {together-1.4.5 → together-1.4.6}/src/together/resources/endpoints.py +24 -4
  6. together-1.4.6/src/together/resources/models.py +134 -0
  7. together-1.4.5/src/together/resources/models.py +0 -75
  8. {together-1.4.5 → together-1.4.6}/LICENSE +0 -0
  9. {together-1.4.5 → together-1.4.6}/README.md +0 -0
  10. {together-1.4.5 → together-1.4.6}/src/together/__init__.py +0 -0
  11. {together-1.4.5 → together-1.4.6}/src/together/abstract/__init__.py +0 -0
  12. {together-1.4.5 → together-1.4.6}/src/together/abstract/api_requestor.py +0 -0
  13. {together-1.4.5 → together-1.4.6}/src/together/cli/__init__.py +0 -0
  14. {together-1.4.5 → together-1.4.6}/src/together/cli/api/__init__.py +0 -0
  15. {together-1.4.5 → together-1.4.6}/src/together/cli/api/chat.py +0 -0
  16. {together-1.4.5 → together-1.4.6}/src/together/cli/api/completions.py +0 -0
  17. {together-1.4.5 → together-1.4.6}/src/together/cli/api/files.py +0 -0
  18. {together-1.4.5 → together-1.4.6}/src/together/cli/api/finetune.py +0 -0
  19. {together-1.4.5 → together-1.4.6}/src/together/cli/api/images.py +0 -0
  20. {together-1.4.5 → together-1.4.6}/src/together/cli/api/utils.py +0 -0
  21. {together-1.4.5 → together-1.4.6}/src/together/cli/cli.py +0 -0
  22. {together-1.4.5 → together-1.4.6}/src/together/client.py +0 -0
  23. {together-1.4.5 → together-1.4.6}/src/together/constants.py +0 -0
  24. {together-1.4.5 → together-1.4.6}/src/together/error.py +0 -0
  25. {together-1.4.5 → together-1.4.6}/src/together/filemanager.py +0 -0
  26. {together-1.4.5 → together-1.4.6}/src/together/legacy/__init__.py +0 -0
  27. {together-1.4.5 → together-1.4.6}/src/together/legacy/base.py +0 -0
  28. {together-1.4.5 → together-1.4.6}/src/together/legacy/complete.py +0 -0
  29. {together-1.4.5 → together-1.4.6}/src/together/legacy/embeddings.py +0 -0
  30. {together-1.4.5 → together-1.4.6}/src/together/legacy/files.py +0 -0
  31. {together-1.4.5 → together-1.4.6}/src/together/legacy/finetune.py +0 -0
  32. {together-1.4.5 → together-1.4.6}/src/together/legacy/images.py +0 -0
  33. {together-1.4.5 → together-1.4.6}/src/together/legacy/models.py +0 -0
  34. {together-1.4.5 → together-1.4.6}/src/together/resources/__init__.py +0 -0
  35. {together-1.4.5 → together-1.4.6}/src/together/resources/audio/__init__.py +0 -0
  36. {together-1.4.5 → together-1.4.6}/src/together/resources/audio/speech.py +0 -0
  37. {together-1.4.5 → together-1.4.6}/src/together/resources/chat/__init__.py +0 -0
  38. {together-1.4.5 → together-1.4.6}/src/together/resources/chat/completions.py +0 -0
  39. {together-1.4.5 → together-1.4.6}/src/together/resources/completions.py +0 -0
  40. {together-1.4.5 → together-1.4.6}/src/together/resources/embeddings.py +0 -0
  41. {together-1.4.5 → together-1.4.6}/src/together/resources/files.py +0 -0
  42. {together-1.4.5 → together-1.4.6}/src/together/resources/finetune.py +0 -0
  43. {together-1.4.5 → together-1.4.6}/src/together/resources/images.py +0 -0
  44. {together-1.4.5 → together-1.4.6}/src/together/resources/rerank.py +0 -0
  45. {together-1.4.5 → together-1.4.6}/src/together/together_response.py +0 -0
  46. {together-1.4.5 → together-1.4.6}/src/together/types/__init__.py +0 -0
  47. {together-1.4.5 → together-1.4.6}/src/together/types/abstract.py +0 -0
  48. {together-1.4.5 → together-1.4.6}/src/together/types/audio_speech.py +0 -0
  49. {together-1.4.5 → together-1.4.6}/src/together/types/chat_completions.py +0 -0
  50. {together-1.4.5 → together-1.4.6}/src/together/types/common.py +0 -0
  51. {together-1.4.5 → together-1.4.6}/src/together/types/completions.py +0 -0
  52. {together-1.4.5 → together-1.4.6}/src/together/types/embeddings.py +0 -0
  53. {together-1.4.5 → together-1.4.6}/src/together/types/endpoints.py +0 -0
  54. {together-1.4.5 → together-1.4.6}/src/together/types/error.py +0 -0
  55. {together-1.4.5 → together-1.4.6}/src/together/types/files.py +0 -0
  56. {together-1.4.5 → together-1.4.6}/src/together/types/finetune.py +0 -0
  57. {together-1.4.5 → together-1.4.6}/src/together/types/images.py +0 -0
  58. {together-1.4.5 → together-1.4.6}/src/together/types/models.py +0 -0
  59. {together-1.4.5 → together-1.4.6}/src/together/types/rerank.py +0 -0
  60. {together-1.4.5 → together-1.4.6}/src/together/utils/__init__.py +0 -0
  61. {together-1.4.5 → together-1.4.6}/src/together/utils/_log.py +0 -0
  62. {together-1.4.5 → together-1.4.6}/src/together/utils/api_helpers.py +0 -0
  63. {together-1.4.5 → together-1.4.6}/src/together/utils/files.py +0 -0
  64. {together-1.4.5 → together-1.4.6}/src/together/utils/tools.py +0 -0
  65. {together-1.4.5 → together-1.4.6}/src/together/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 1.4.5
3
+ Version: 1.4.6
4
4
  Summary: Python client for Together's Cloud Platform!
5
5
  License: Apache-2.0
6
6
  Author: Together AI
@@ -12,7 +12,7 @@ build-backend = "poetry.masonry.api"
12
12
 
13
13
  [tool.poetry]
14
14
  name = "together"
15
- version = "1.4.5"
15
+ version = "1.4.6"
16
16
  authors = [
17
17
  "Together AI <support@together.ai>"
18
18
  ]
@@ -127,6 +127,11 @@ def endpoints(ctx: click.Context) -> None:
127
127
  is_flag=True,
128
128
  help="Create the endpoint in STOPPED state instead of auto-starting it",
129
129
  )
130
+ @click.option(
131
+ "--inactive-timeout",
132
+ type=int,
133
+ help="Number of minutes of inactivity after which the endpoint will be automatically stopped. Set to 0 to disable.",
134
+ )
130
135
  @click.option(
131
136
  "--wait",
132
137
  is_flag=True,
@@ -146,6 +151,7 @@ def create(
146
151
  no_prompt_cache: bool,
147
152
  no_speculative_decoding: bool,
148
153
  no_auto_start: bool,
154
+ inactive_timeout: int | None,
149
155
  wait: bool,
150
156
  ) -> None:
151
157
  """Create a new dedicated inference endpoint."""
@@ -170,6 +176,7 @@ def create(
170
176
  disable_prompt_cache=no_prompt_cache,
171
177
  disable_speculative_decoding=no_speculative_decoding,
172
178
  state="STOPPED" if no_auto_start else "STARTED",
179
+ inactive_timeout=inactive_timeout,
173
180
  )
174
181
  except InvalidRequestError as e:
175
182
  print_api_error(e)
@@ -194,6 +201,8 @@ def create(
194
201
  click.echo(" Speculative decoding: disabled", err=True)
195
202
  if no_auto_start:
196
203
  click.echo(" Auto-start: disabled", err=True)
204
+ if inactive_timeout is not None:
205
+ click.echo(f" Inactive timeout: {inactive_timeout} minutes", err=True)
197
206
 
198
207
  click.echo(f"Endpoint created successfully, id: {response.id}", err=True)
199
208
 
@@ -371,6 +380,11 @@ def list(
371
380
  type=int,
372
381
  help="New maximum number of replicas to scale up to",
373
382
  )
383
+ @click.option(
384
+ "--inactive-timeout",
385
+ type=int,
386
+ help="Number of minutes of inactivity after which the endpoint will be automatically stopped. Set to 0 to disable.",
387
+ )
374
388
  @click.pass_obj
375
389
  @handle_api_errors
376
390
  def update(
@@ -379,9 +393,10 @@ def update(
379
393
  display_name: str | None,
380
394
  min_replicas: int | None,
381
395
  max_replicas: int | None,
396
+ inactive_timeout: int | None,
382
397
  ) -> None:
383
398
  """Update a dedicated inference endpoint's configuration."""
384
- if not any([display_name, min_replicas, max_replicas]):
399
+ if not any([display_name, min_replicas, max_replicas, inactive_timeout]):
385
400
  click.echo("Error: At least one update option must be specified", err=True)
386
401
  sys.exit(1)
387
402
 
@@ -400,6 +415,8 @@ def update(
400
415
  if min_replicas is not None and max_replicas is not None:
401
416
  kwargs["min_replicas"] = min_replicas
402
417
  kwargs["max_replicas"] = max_replicas
418
+ if inactive_timeout is not None:
419
+ kwargs["inactive_timeout"] = inactive_timeout
403
420
 
404
421
  _response = client.endpoints.update(endpoint_id, **kwargs)
405
422
 
@@ -410,6 +427,8 @@ def update(
410
427
  if min_replicas is not None and max_replicas is not None:
411
428
  click.echo(f" Min replicas: {min_replicas}", err=True)
412
429
  click.echo(f" Max replicas: {max_replicas}", err=True)
430
+ if inactive_timeout is not None:
431
+ click.echo(f" Inactive timeout: {inactive_timeout} minutes", err=True)
413
432
 
414
433
  click.echo("Successfully updated endpoint", err=True)
415
434
  click.echo(endpoint_id)
@@ -1,4 +1,4 @@
1
- from textwrap import wrap
1
+ import json as json_lib
2
2
 
3
3
  import click
4
4
  from tabulate import tabulate
@@ -15,12 +15,22 @@ def models(ctx: click.Context) -> None:
15
15
 
16
16
 
17
17
  @models.command()
18
+ @click.option(
19
+ "--type",
20
+ type=click.Choice(["dedicated"]),
21
+ help="Filter models by type (dedicated: models that can be deployed as dedicated endpoints)",
22
+ )
23
+ @click.option(
24
+ "--json",
25
+ is_flag=True,
26
+ help="Output in JSON format",
27
+ )
18
28
  @click.pass_context
19
- def list(ctx: click.Context) -> None:
29
+ def list(ctx: click.Context, type: str | None, json: bool) -> None:
20
30
  """List models"""
21
31
  client: Together = ctx.obj
22
32
 
23
- response = client.models.list()
33
+ response = client.models.list(dedicated=(type == "dedicated"))
24
34
 
25
35
  display_list = []
26
36
 
@@ -28,15 +38,18 @@ def list(ctx: click.Context) -> None:
28
38
  for model in response:
29
39
  display_list.append(
30
40
  {
31
- "ID": "\n".join(wrap(model.id or "", width=30)),
32
- "Name": "\n".join(wrap(model.display_name or "", width=30)),
41
+ "ID": model.id,
42
+ "Name": model.display_name,
33
43
  "Organization": model.organization,
34
44
  "Type": model.type,
35
45
  "Context Length": model.context_length,
36
- "License": "\n".join(wrap(model.license or "", width=30)),
46
+ "License": model.license,
37
47
  "Input per 1M token": model.pricing.input,
38
48
  "Output per 1M token": model.pricing.output,
39
49
  }
40
50
  )
41
51
 
42
- click.echo(tabulate(display_list, headers="keys", tablefmt="grid"))
52
+ if json:
53
+ click.echo(json_lib.dumps(display_list, indent=2))
54
+ else:
55
+ click.echo(tabulate(display_list, headers="keys", tablefmt="plain"))
@@ -59,6 +59,7 @@ class Endpoints:
59
59
  disable_prompt_cache: bool = False,
60
60
  disable_speculative_decoding: bool = False,
61
61
  state: Literal["STARTED", "STOPPED"] = "STARTED",
62
+ inactive_timeout: Optional[int] = None,
62
63
  ) -> DedicatedEndpoint:
63
64
  """
64
65
  Create a new dedicated endpoint.
@@ -72,6 +73,7 @@ class Endpoints:
72
73
  disable_prompt_cache (bool, optional): Whether to disable the prompt cache. Defaults to False.
73
74
  disable_speculative_decoding (bool, optional): Whether to disable speculative decoding. Defaults to False.
74
75
  state (str, optional): The desired state of the endpoint. Defaults to "STARTED".
76
+ inactive_timeout (int, optional): The number of minutes of inactivity after which the endpoint will be automatically stopped. Set to 0 to disable automatic timeout.
75
77
 
76
78
  Returns:
77
79
  DedicatedEndpoint: Object containing endpoint information
@@ -80,7 +82,7 @@ class Endpoints:
80
82
  client=self._client,
81
83
  )
82
84
 
83
- data: Dict[str, Union[str, bool, Dict[str, int]]] = {
85
+ data: Dict[str, Union[str, bool, Dict[str, int], int]] = {
84
86
  "model": model,
85
87
  "hardware": hardware,
86
88
  "autoscaling": {
@@ -95,6 +97,9 @@ class Endpoints:
95
97
  if display_name is not None:
96
98
  data["display_name"] = display_name
97
99
 
100
+ if inactive_timeout is not None:
101
+ data["inactive_timeout"] = inactive_timeout
102
+
98
103
  response, _, _ = requestor.request(
99
104
  options=TogetherRequest(
100
105
  method="POST",
@@ -161,6 +166,7 @@ class Endpoints:
161
166
  max_replicas: Optional[int] = None,
162
167
  state: Optional[Literal["STARTED", "STOPPED"]] = None,
163
168
  display_name: Optional[str] = None,
169
+ inactive_timeout: Optional[int] = None,
164
170
  ) -> DedicatedEndpoint:
165
171
  """
166
172
  Update an endpoint's configuration.
@@ -171,6 +177,7 @@ class Endpoints:
171
177
  max_replicas (int, optional): The maximum number of replicas to scale up to
172
178
  state (str, optional): The desired state of the endpoint ("STARTED" or "STOPPED")
173
179
  display_name (str, optional): A human-readable name for the endpoint
180
+ inactive_timeout (int, optional): The number of minutes of inactivity after which the endpoint will be automatically stopped. Set to 0 to disable automatic timeout.
174
181
 
175
182
  Returns:
176
183
  DedicatedEndpoint: Object containing endpoint information
@@ -179,7 +186,7 @@ class Endpoints:
179
186
  client=self._client,
180
187
  )
181
188
 
182
- data: Dict[str, Union[str, Dict[str, int]]] = {}
189
+ data: Dict[str, Union[str, Dict[str, int], int]] = {}
183
190
 
184
191
  if min_replicas is not None or max_replicas is not None:
185
192
  current_min = min_replicas
@@ -200,6 +207,9 @@ class Endpoints:
200
207
  if display_name is not None:
201
208
  data["display_name"] = display_name
202
209
 
210
+ if inactive_timeout is not None:
211
+ data["inactive_timeout"] = inactive_timeout
212
+
203
213
  response, _, _ = requestor.request(
204
214
  options=TogetherRequest(
205
215
  method="PATCH",
@@ -297,6 +307,7 @@ class AsyncEndpoints:
297
307
  disable_prompt_cache: bool = False,
298
308
  disable_speculative_decoding: bool = False,
299
309
  state: Literal["STARTED", "STOPPED"] = "STARTED",
310
+ inactive_timeout: Optional[int] = None,
300
311
  ) -> DedicatedEndpoint:
301
312
  """
302
313
  Create a new dedicated endpoint.
@@ -310,6 +321,7 @@ class AsyncEndpoints:
310
321
  disable_prompt_cache (bool, optional): Whether to disable the prompt cache. Defaults to False.
311
322
  disable_speculative_decoding (bool, optional): Whether to disable speculative decoding. Defaults to False.
312
323
  state (str, optional): The desired state of the endpoint. Defaults to "STARTED".
324
+ inactive_timeout (int, optional): The number of minutes of inactivity after which the endpoint will be automatically stopped. Set to 0 to disable automatic timeout.
313
325
 
314
326
  Returns:
315
327
  DedicatedEndpoint: Object containing endpoint information
@@ -318,7 +330,7 @@ class AsyncEndpoints:
318
330
  client=self._client,
319
331
  )
320
332
 
321
- data: Dict[str, Union[str, bool, Dict[str, int]]] = {
333
+ data: Dict[str, Union[str, bool, Dict[str, int], int]] = {
322
334
  "model": model,
323
335
  "hardware": hardware,
324
336
  "autoscaling": {
@@ -333,6 +345,9 @@ class AsyncEndpoints:
333
345
  if display_name is not None:
334
346
  data["display_name"] = display_name
335
347
 
348
+ if inactive_timeout is not None:
349
+ data["inactive_timeout"] = inactive_timeout
350
+
336
351
  response, _, _ = await requestor.arequest(
337
352
  options=TogetherRequest(
338
353
  method="POST",
@@ -399,6 +414,7 @@ class AsyncEndpoints:
399
414
  max_replicas: Optional[int] = None,
400
415
  state: Optional[Literal["STARTED", "STOPPED"]] = None,
401
416
  display_name: Optional[str] = None,
417
+ inactive_timeout: Optional[int] = None,
402
418
  ) -> DedicatedEndpoint:
403
419
  """
404
420
  Update an endpoint's configuration.
@@ -409,6 +425,7 @@ class AsyncEndpoints:
409
425
  max_replicas (int, optional): The maximum number of replicas to scale up to
410
426
  state (str, optional): The desired state of the endpoint ("STARTED" or "STOPPED")
411
427
  display_name (str, optional): A human-readable name for the endpoint
428
+ inactive_timeout (int, optional): The number of minutes of inactivity after which the endpoint will be automatically stopped. Set to 0 to disable automatic timeout.
412
429
 
413
430
  Returns:
414
431
  DedicatedEndpoint: Object containing endpoint information
@@ -417,7 +434,7 @@ class AsyncEndpoints:
417
434
  client=self._client,
418
435
  )
419
436
 
420
- data: Dict[str, Union[str, Dict[str, int]]] = {}
437
+ data: Dict[str, Union[str, Dict[str, int], int]] = {}
421
438
 
422
439
  if min_replicas is not None or max_replicas is not None:
423
440
  current_min = min_replicas
@@ -438,6 +455,9 @@ class AsyncEndpoints:
438
455
  if display_name is not None:
439
456
  data["display_name"] = display_name
440
457
 
458
+ if inactive_timeout is not None:
459
+ data["inactive_timeout"] = inactive_timeout
460
+
441
461
  response, _, _ = await requestor.arequest(
442
462
  options=TogetherRequest(
443
463
  method="PATCH",
@@ -0,0 +1,134 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import List
4
+
5
+ from together.abstract import api_requestor
6
+ from together.together_response import TogetherResponse
7
+ from together.types import (
8
+ ModelObject,
9
+ TogetherClient,
10
+ TogetherRequest,
11
+ )
12
+
13
+
14
+ class ModelsBase:
15
+ def __init__(self, client: TogetherClient) -> None:
16
+ self._client = client
17
+
18
+ def _filter_dedicated_models(
19
+ self, models: List[ModelObject], dedicated_response: TogetherResponse
20
+ ) -> List[ModelObject]:
21
+ """
22
+ Filter models based on dedicated model response.
23
+
24
+ Args:
25
+ models (List[ModelObject]): List of all models
26
+ dedicated_response (TogetherResponse): Response from autoscale models endpoint
27
+
28
+ Returns:
29
+ List[ModelObject]: Filtered list of models
30
+ """
31
+ assert isinstance(dedicated_response.data, list)
32
+
33
+ # Create a set of dedicated model names for efficient lookup
34
+ dedicated_model_names = {model["name"] for model in dedicated_response.data}
35
+
36
+ # Filter models to only include those in dedicated_model_names
37
+ # Note: The model.id from ModelObject matches the name field in the autoscale response
38
+ return [model for model in models if model.id in dedicated_model_names]
39
+
40
+
41
+ class Models(ModelsBase):
42
+ def list(
43
+ self,
44
+ dedicated: bool = False,
45
+ ) -> List[ModelObject]:
46
+ """
47
+ Method to return list of models on the API
48
+
49
+ Args:
50
+ dedicated (bool, optional): If True, returns only dedicated models. Defaults to False.
51
+
52
+ Returns:
53
+ List[ModelObject]: List of model objects
54
+ """
55
+ requestor = api_requestor.APIRequestor(
56
+ client=self._client,
57
+ )
58
+
59
+ response, _, _ = requestor.request(
60
+ options=TogetherRequest(
61
+ method="GET",
62
+ url="models",
63
+ ),
64
+ stream=False,
65
+ )
66
+
67
+ assert isinstance(response, TogetherResponse)
68
+ assert isinstance(response.data, list)
69
+
70
+ models = [ModelObject(**model) for model in response.data]
71
+
72
+ if dedicated:
73
+ # Get dedicated models
74
+ dedicated_response, _, _ = requestor.request(
75
+ options=TogetherRequest(
76
+ method="GET",
77
+ url="autoscale/models",
78
+ ),
79
+ stream=False,
80
+ )
81
+
82
+ models = self._filter_dedicated_models(models, dedicated_response)
83
+
84
+ models.sort(key=lambda x: x.id.lower())
85
+
86
+ return models
87
+
88
+
89
+ class AsyncModels(ModelsBase):
90
+ async def list(
91
+ self,
92
+ dedicated: bool = False,
93
+ ) -> List[ModelObject]:
94
+ """
95
+ Async method to return list of models on API
96
+
97
+ Args:
98
+ dedicated (bool, optional): If True, returns only dedicated models. Defaults to False.
99
+
100
+ Returns:
101
+ List[ModelObject]: List of model objects
102
+ """
103
+ requestor = api_requestor.APIRequestor(
104
+ client=self._client,
105
+ )
106
+
107
+ response, _, _ = await requestor.arequest(
108
+ options=TogetherRequest(
109
+ method="GET",
110
+ url="models",
111
+ ),
112
+ stream=False,
113
+ )
114
+
115
+ assert isinstance(response, TogetherResponse)
116
+ assert isinstance(response.data, list)
117
+
118
+ models = [ModelObject(**model) for model in response.data]
119
+
120
+ if dedicated:
121
+ # Get dedicated models
122
+ dedicated_response, _, _ = await requestor.arequest(
123
+ options=TogetherRequest(
124
+ method="GET",
125
+ url="autoscale/models",
126
+ ),
127
+ stream=False,
128
+ )
129
+
130
+ models = self._filter_dedicated_models(models, dedicated_response)
131
+
132
+ models.sort(key=lambda x: x.id.lower())
133
+
134
+ return models
@@ -1,75 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import List
4
-
5
- from together.abstract import api_requestor
6
- from together.together_response import TogetherResponse
7
- from together.types import (
8
- ModelObject,
9
- TogetherClient,
10
- TogetherRequest,
11
- )
12
-
13
-
14
- class Models:
15
- def __init__(self, client: TogetherClient) -> None:
16
- self._client = client
17
-
18
- def list(
19
- self,
20
- ) -> List[ModelObject]:
21
- """
22
- Method to return list of models on the API
23
-
24
- Returns:
25
- List[ModelObject]: List of model objects
26
- """
27
-
28
- requestor = api_requestor.APIRequestor(
29
- client=self._client,
30
- )
31
-
32
- response, _, _ = requestor.request(
33
- options=TogetherRequest(
34
- method="GET",
35
- url="models",
36
- ),
37
- stream=False,
38
- )
39
-
40
- assert isinstance(response, TogetherResponse)
41
- assert isinstance(response.data, list)
42
-
43
- return [ModelObject(**model) for model in response.data]
44
-
45
-
46
- class AsyncModels:
47
- def __init__(self, client: TogetherClient) -> None:
48
- self._client = client
49
-
50
- async def list(
51
- self,
52
- ) -> List[ModelObject]:
53
- """
54
- Async method to return list of models on API
55
-
56
- Returns:
57
- List[ModelObject]: List of model objects
58
- """
59
-
60
- requestor = api_requestor.APIRequestor(
61
- client=self._client,
62
- )
63
-
64
- response, _, _ = await requestor.arequest(
65
- options=TogetherRequest(
66
- method="GET",
67
- url="models",
68
- ),
69
- stream=False,
70
- )
71
-
72
- assert isinstance(response, TogetherResponse)
73
- assert isinstance(response.data, list)
74
-
75
- return [ModelObject(**model) for model in response.data]
File without changes
File without changes
File without changes