together 1.2.9__py3-none-any.whl → 1.2.11__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,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import json
2
4
  from textwrap import wrap
3
5
 
@@ -14,7 +14,7 @@ class Complete:
14
14
  def create(
15
15
  cls,
16
16
  prompt: str,
17
- **kwargs,
17
+ **kwargs: Any,
18
18
  ) -> Dict[str, Any]:
19
19
  """Legacy completion function."""
20
20
 
@@ -36,7 +36,7 @@ class Complete:
36
36
  def create_streaming(
37
37
  cls,
38
38
  prompt: str,
39
- **kwargs,
39
+ **kwargs: Any,
40
40
  ) -> Iterator[Dict[str, Any]]:
41
41
  """Legacy streaming completion function."""
42
42
 
@@ -59,7 +59,7 @@ class Completion:
59
59
  def create(
60
60
  cls,
61
61
  prompt: str,
62
- **kwargs,
62
+ **kwargs: Any,
63
63
  ) -> CompletionResponse | Iterator[CompletionChunk]:
64
64
  """Completion function."""
65
65
 
@@ -79,7 +79,7 @@ class AsyncComplete:
79
79
  async def create(
80
80
  cls,
81
81
  prompt: str,
82
- **kwargs,
82
+ **kwargs: Any,
83
83
  ) -> CompletionResponse | AsyncGenerator[CompletionChunk, None]:
84
84
  """Async completion function."""
85
85
 
@@ -11,7 +11,7 @@ class Embeddings:
11
11
  def create(
12
12
  cls,
13
13
  input: str,
14
- **kwargs,
14
+ **kwargs: Any,
15
15
  ) -> Dict[str, Any]:
16
16
  """Legacy embeddings function."""
17
17
 
together/legacy/images.py CHANGED
@@ -11,7 +11,7 @@ class Image:
11
11
  def create(
12
12
  cls,
13
13
  prompt: str,
14
- **kwargs,
14
+ **kwargs: Any,
15
15
  ) -> Dict[str, Any]:
16
16
  """Legacy image function."""
17
17
 
@@ -40,6 +40,7 @@ class ChatCompletions:
40
40
  response_format: Dict[str, str | Dict[str, Any]] | None = None,
41
41
  tools: Dict[str, str | Dict[str, Any]] | None = None,
42
42
  tool_choice: str | Dict[str, str | Dict[str, str]] | None = None,
43
+ **kwargs: Any,
43
44
  ) -> ChatCompletionResponse | Iterator[ChatCompletionChunk]:
44
45
  """
45
46
  Method to generate completions based on a given prompt using a specified model.
@@ -131,6 +132,7 @@ class ChatCompletions:
131
132
  response_format=response_format,
132
133
  tools=tools,
133
134
  tool_choice=tool_choice,
135
+ **kwargs,
134
136
  ).model_dump(exclude_none=True)
135
137
 
136
138
  response, _, _ = requestor.request(
@@ -177,6 +179,7 @@ class AsyncChatCompletions:
177
179
  response_format: Dict[str, Any] | None = None,
178
180
  tools: Dict[str, str | Dict[str, str | Dict[str, Any]]] | None = None,
179
181
  tool_choice: str | Dict[str, str | Dict[str, str]] | None = None,
182
+ **kwargs: Any,
180
183
  ) -> AsyncGenerator[ChatCompletionChunk, None] | ChatCompletionResponse:
181
184
  """
182
185
  Async method to generate completions based on a given prompt using a specified model.
@@ -268,6 +271,7 @@ class AsyncChatCompletions:
268
271
  response_format=response_format,
269
272
  tools=tools,
270
273
  tool_choice=tool_choice,
274
+ **kwargs,
271
275
  ).model_dump(exclude_none=True)
272
276
 
273
277
  response, _, _ = await requestor.arequest(
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import AsyncGenerator, Dict, Iterator, List
3
+ from typing import AsyncGenerator, Dict, Iterator, List, Any
4
4
 
5
5
  from together.abstract import api_requestor
6
6
  from together.together_response import TogetherResponse
@@ -37,6 +37,7 @@ class Completions:
37
37
  echo: bool | None = None,
38
38
  n: int | None = None,
39
39
  safety_model: str | None = None,
40
+ **kwargs: Any,
40
41
  ) -> CompletionResponse | Iterator[CompletionChunk]:
41
42
  """
42
43
  Method to generate completions based on a given prompt using a specified model.
@@ -113,6 +114,7 @@ class Completions:
113
114
  echo=echo,
114
115
  n=n,
115
116
  safety_model=safety_model,
117
+ **kwargs,
116
118
  ).model_dump(exclude_none=True)
117
119
 
118
120
  response, _, _ = requestor.request(
@@ -156,6 +158,7 @@ class AsyncCompletions:
156
158
  echo: bool | None = None,
157
159
  n: int | None = None,
158
160
  safety_model: str | None = None,
161
+ **kwargs: Any,
159
162
  ) -> AsyncGenerator[CompletionChunk, None] | CompletionResponse:
160
163
  """
161
164
  Async method to generate completions based on a given prompt using a specified model.
@@ -232,6 +235,7 @@ class AsyncCompletions:
232
235
  echo=echo,
233
236
  n=n,
234
237
  safety_model=safety_model,
238
+ **kwargs,
235
239
  ).model_dump(exclude_none=True)
236
240
 
237
241
  response, _, _ = await requestor.arequest(
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import List
3
+ from typing import List, Any
4
4
 
5
5
  from together.abstract import api_requestor
6
6
  from together.together_response import TogetherResponse
@@ -21,6 +21,7 @@ class Embeddings:
21
21
  *,
22
22
  input: str | List[str],
23
23
  model: str,
24
+ **kwargs: Any,
24
25
  ) -> EmbeddingResponse:
25
26
  """
26
27
  Method to generate completions based on a given prompt using a specified model.
@@ -40,6 +41,7 @@ class Embeddings:
40
41
  parameter_payload = EmbeddingRequest(
41
42
  input=input,
42
43
  model=model,
44
+ **kwargs,
43
45
  ).model_dump(exclude_none=True)
44
46
 
45
47
  response, _, _ = requestor.request(
@@ -65,6 +67,7 @@ class AsyncEmbeddings:
65
67
  *,
66
68
  input: str | List[str],
67
69
  model: str,
70
+ **kwargs: Any,
68
71
  ) -> EmbeddingResponse:
69
72
  """
70
73
  Async method to generate completions based on a given prompt using a specified model.
@@ -84,6 +87,7 @@ class AsyncEmbeddings:
84
87
  parameter_payload = EmbeddingRequest(
85
88
  input=input,
86
89
  model=model,
90
+ **kwargs,
87
91
  ).model_dump(exclude_none=True)
88
92
 
89
93
  response, _, _ = await requestor.arequest(
@@ -1,5 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from typing import Any
4
+
3
5
  from together.abstract import api_requestor
4
6
  from together.together_response import TogetherResponse
5
7
  from together.types import (
@@ -25,6 +27,7 @@ class Images:
25
27
  height: int | None = 1024,
26
28
  width: int | None = 1024,
27
29
  negative_prompt: str | None = None,
30
+ **kwargs: Any,
28
31
  ) -> ImageResponse:
29
32
  """
30
33
  Method to generate images based on a given prompt using a specified model.
@@ -67,6 +70,7 @@ class Images:
67
70
  height=height,
68
71
  width=width,
69
72
  negative_prompt=negative_prompt,
73
+ **kwargs,
70
74
  ).model_dump(exclude_none=True)
71
75
 
72
76
  response, _, _ = requestor.request(
@@ -98,6 +102,7 @@ class AsyncImages:
98
102
  height: int | None = 1024,
99
103
  width: int | None = 1024,
100
104
  negative_prompt: str | None = None,
105
+ **kwargs: Any,
101
106
  ) -> ImageResponse:
102
107
  """
103
108
  Async method to generate images based on a given prompt using a specified model.
@@ -140,6 +145,7 @@ class AsyncImages:
140
145
  height=height,
141
146
  width=width,
142
147
  negative_prompt=negative_prompt,
148
+ **kwargs,
143
149
  ).model_dump(exclude_none=True)
144
150
 
145
151
  response, _, _ = await requestor.arequest(
@@ -25,6 +25,7 @@ class Rerank:
25
25
  top_n: int | None = None,
26
26
  return_documents: bool = False,
27
27
  rank_fields: List[str] | None = None,
28
+ **kwargs: Any,
28
29
  ) -> RerankResponse:
29
30
  """
30
31
  Method to generate completions based on a given prompt using a specified model.
@@ -52,6 +53,7 @@ class Rerank:
52
53
  top_n=top_n,
53
54
  return_documents=return_documents,
54
55
  rank_fields=rank_fields,
56
+ **kwargs,
55
57
  ).model_dump(exclude_none=True)
56
58
 
57
59
  response, _, _ = requestor.request(
@@ -81,6 +83,7 @@ class AsyncRerank:
81
83
  top_n: int | None = None,
82
84
  return_documents: bool = False,
83
85
  rank_fields: List[str] | None = None,
86
+ **kwargs: Any,
84
87
  ) -> RerankResponse:
85
88
  """
86
89
  Async method to generate completions based on a given prompt using a specified model.
@@ -108,6 +111,7 @@ class AsyncRerank:
108
111
  top_n=top_n,
109
112
  return_documents=return_documents,
110
113
  rank_fields=rank_fields,
114
+ **kwargs,
111
115
  ).model_dump(exclude_none=True)
112
116
 
113
117
  response, _, _ = await requestor.arequest(
@@ -230,7 +230,7 @@ class FinetuneResponse(BaseModel):
230
230
  @field_validator("training_type")
231
231
  @classmethod
232
232
  def validate_training_type(cls, v: TrainingType) -> TrainingType:
233
- if v.type == "Full":
233
+ if v.type == "Full" or v.type == "":
234
234
  return FullTrainingType(**v.model_dump())
235
235
  elif v.type == "Lora":
236
236
  return LoRATrainingType(**v.model_dump())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: together
3
- Version: 1.2.9
3
+ Version: 1.2.11
4
4
  Summary: Python client for Together's Cloud Platform!
5
5
  Home-page: https://github.com/togethercomputer/together-python
6
6
  License: Apache-2.0
@@ -6,7 +6,7 @@ together/cli/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
6
6
  together/cli/api/chat.py,sha256=2PHRb-9T-lUEKhUJFtc7SxJv3shCVx40gq_8pzfsewM,9234
7
7
  together/cli/api/completions.py,sha256=l-Zw5t7hojL3w8xd_mitS2NRB72i5Z0xwkzH0rT5XMc,4263
8
8
  together/cli/api/files.py,sha256=QLYEXRkY8J2Gg1SbTCtzGfoTMvosoeACNK83L_oLubs,3397
9
- together/cli/api/finetune.py,sha256=AevMXoVhq9iF1I-A2_bNy8jx8xkqzNS5kauWnOauJyc,8819
9
+ together/cli/api/finetune.py,sha256=c6-T-5K7sODgQa7ehdqZqyluRaDUzPXCgMeFWm3iIwA,8855
10
10
  together/cli/api/images.py,sha256=01dFYa2sK1HqUwVCD9FlwcjqkYWLoNxFZkzok13EriE,2363
11
11
  together/cli/api/models.py,sha256=xWEzu8ZpxM_Pz9KEjRPRVuv_v22RayYZ4QcgiezT5tE,1126
12
12
  together/cli/cli.py,sha256=RC0tgapkSOFjsRPg8p-8dx9D2LDzm8YmVCHUjk_aVyQ,1977
@@ -16,22 +16,22 @@ together/error.py,sha256=emjhTSsLwiZvW0v1EmYemjacCMtcFIKAXWWK_2IdP18,5419
16
16
  together/filemanager.py,sha256=QHhBn73oVFdgUpSYXYLmJzHJ9c5wYEMJC0ur6ZgDeYo,11269
17
17
  together/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  together/legacy/base.py,sha256=ehrX1SCfRbK5OA83wL1q7-tfF-yuZOUxzjxYfFtdvvQ,727
19
- together/legacy/complete.py,sha256=2W4OoXc9cX6G2ZfoQJRg8RUgisYd42x8Y9U5bL0xL70,2419
20
- together/legacy/embeddings.py,sha256=SSQJlgMlCRgXomlhpOTJktLqZEVPncsl1cMN67Jxeeg,630
19
+ together/legacy/complete.py,sha256=NRJX-vjnkg4HrgDo9LS3jFfhwfXpeGxcl24dcrLPK3A,2439
20
+ together/legacy/embeddings.py,sha256=nyTERjyPLTm7Sc987a9FJt1adnW7gIa7xs2CwXLE9EI,635
21
21
  together/legacy/files.py,sha256=qmAqMiNTPWb6WvLV5Tsv6kxGRfQ31q7OkHZNFwkw8v0,4082
22
22
  together/legacy/finetune.py,sha256=k-lERbZLEZlW1QQ9A9zhhwl5KIPjf_jT0R0LSiLbD2Y,5063
23
- together/legacy/images.py,sha256=fWp5xdmRBENgy9UClG43gEO8XMRdh6c-Psj-VE-Kz_E,621
23
+ together/legacy/images.py,sha256=bJJRs-6C7-NexPyaeyHiYlHOU51yls5-QAiqtO4xrZU,626
24
24
  together/legacy/models.py,sha256=85ZN9Ids_FjdYNDRv5k7sgrtVWPKPHqkDplORtVUGHg,1087
25
25
  together/resources/__init__.py,sha256=7BLdBCNUbgi5mz30EFfdkdIYiGfFCkiUbdNzMY1-igY,792
26
26
  together/resources/chat/__init__.py,sha256=RsTptdP8MeGjcdIjze896-J27cRvCbUoMft0X2BVlQ8,617
27
- together/resources/chat/completions.py,sha256=BFeApiCRSTzy3FXiRudWVhN-dOodC4MMYoM3gdpfURU,14118
28
- together/resources/completions.py,sha256=ouv9_jCsVT-vz49i77T053v35LL9iWhUXT7awa_gH5o,11387
29
- together/resources/embeddings.py,sha256=AddhcJTS7cjhCpW6v8B2mOLoHugeo3AxL9AGrBEKe8o,2580
27
+ together/resources/chat/completions.py,sha256=AOmm2CRwhz9VZpez35LoOUw432IPbtwCeUQXtCd3RK8,14208
28
+ together/resources/completions.py,sha256=C_Djn41zjdWdPn4rnOrAVEHvOaqyBSyxZS4eYqsZdMI,11482
29
+ together/resources/embeddings.py,sha256=PTvLb82yjG_-iQOyuhsilp77Fr7gZ0o6WD2KeRnKoxs,2675
30
30
  together/resources/files.py,sha256=bnPbaF25e4InBRPvHwXHXT-oSX1Z1sZRsnQW5wq82U4,4990
31
31
  together/resources/finetune.py,sha256=t8wOulAyNFKlHjHv_u4-PwdL-rR-klgEvDEfH-efdkQ,15970
32
- together/resources/images.py,sha256=ALTxJyrUHkGnPzfm7R_nySF0fhUwPjrcyg1j3hzZ_WY,4809
32
+ together/resources/images.py,sha256=LQUjKPaFxWTqOAPnyF1Pp7Rz4NLOYhmoKwshpYiprEM,4923
33
33
  together/resources/models.py,sha256=2dtHhXAqTDOOpwSbYLzWcKTC0-m2Szlb7LDYvp7Jr4w,1786
34
- together/resources/rerank.py,sha256=eRSjW37bz2dJ91NXM-gl4sqcH1qAr1s0trmLdRA3yVA,3841
34
+ together/resources/rerank.py,sha256=3Ju_aRSyZ1s_3zCSNZnSnEJErUVmt2xa3M8z1nvejMA,3931
35
35
  together/together_response.py,sha256=MhczUCPem93cjX-A1TOAUrRj3sO-o3SLcEcTsZgVzQI,1319
36
36
  together/types/__init__.py,sha256=ghMiyyR2UzY-Io9Ck3ocwmS6_XSO9VaYWwbLqPDSZfo,1681
37
37
  together/types/abstract.py,sha256=1lFQI_3WjsR_t1128AeKW0aTk6EiM6Gh1J3ZuyLLPao,642
@@ -41,7 +41,7 @@ together/types/completions.py,sha256=yydloTQePGaY97Lx-kbkvgCqBFhHFl7jU5s7uf9Ncg0
41
41
  together/types/embeddings.py,sha256=J7grkYYn7xhqeKaBO2T-8XQRtHhkzYzymovtGdIUK5A,751
42
42
  together/types/error.py,sha256=OVlCs3cx_2WhZK4JzHT8SQyRIIqKOP1AZQ4y1PydjAE,370
43
43
  together/types/files.py,sha256=-rEUfsV6f2vZB9NrFxT4_933ubsDIUNkPB-3OlOFk4A,1954
44
- together/types/finetune.py,sha256=5FQXIeIltjoeKP4W7sxP5OMXUU42hXPkHlRtyhJXx4o,7346
44
+ together/types/finetune.py,sha256=UqZH98L3vVxZ6vykE5rmZFdpYQrqrkTvotZIiyqAME0,7362
45
45
  together/types/images.py,sha256=zX4Vt38tFDKU6yGb_hBY_N5eSTn3KPdpP5Ce_qnRHXQ,915
46
46
  together/types/models.py,sha256=K9Om3cCFexy7qzRSEXUj7gpCy1CVb1hHx7MGG-hvTLw,1035
47
47
  together/types/rerank.py,sha256=qZfuXOn7MZ6ly8hpJ_MZ7OU_Bi1-cgYNSB20Wja8Qkk,1061
@@ -51,8 +51,8 @@ together/utils/api_helpers.py,sha256=RSF7SRhbjHzroMOSWAXscflByM1r1ta_1SpxkAT22iE
51
51
  together/utils/files.py,sha256=gMLthqfP5hKxVAerHMdy7gLXzdfY6lyOXdpW24Y4X3I,7165
52
52
  together/utils/tools.py,sha256=3-lXWP3cBCzOVSZg9tr5zOT1jaVeKAKVWxO2fcXZTh8,1788
53
53
  together/version.py,sha256=p03ivHyE0SyWU4jAnRTBi_sOwywVWoZPU4g2gzRgG-Y,126
54
- together-1.2.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
55
- together-1.2.9.dist-info/METADATA,sha256=LGpQRxQmKUalRDL24prEoT2_iuTa7zqb1vN89L8OC9Y,11812
56
- together-1.2.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
57
- together-1.2.9.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
58
- together-1.2.9.dist-info/RECORD,,
54
+ together-1.2.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
55
+ together-1.2.11.dist-info/METADATA,sha256=dGhkUfJY1_UbjfOmWiFoDIs-QzLFD1ZgBwRy9E7P59Y,11813
56
+ together-1.2.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
57
+ together-1.2.11.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
58
+ together-1.2.11.dist-info/RECORD,,