together 1.5.35__py3-none-any.whl → 2.0.0a7__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 (208) hide show
  1. together/__init__.py +101 -114
  2. together/_base_client.py +1995 -0
  3. together/_client.py +1033 -0
  4. together/_compat.py +219 -0
  5. together/_constants.py +14 -0
  6. together/_exceptions.py +108 -0
  7. together/_files.py +123 -0
  8. together/_models.py +857 -0
  9. together/_qs.py +150 -0
  10. together/_resource.py +43 -0
  11. together/_response.py +830 -0
  12. together/_streaming.py +370 -0
  13. together/_types.py +260 -0
  14. together/_utils/__init__.py +64 -0
  15. together/_utils/_compat.py +45 -0
  16. together/_utils/_datetime_parse.py +136 -0
  17. together/_utils/_logs.py +25 -0
  18. together/_utils/_proxy.py +65 -0
  19. together/_utils/_reflection.py +42 -0
  20. together/_utils/_resources_proxy.py +24 -0
  21. together/_utils/_streams.py +12 -0
  22. together/_utils/_sync.py +58 -0
  23. together/_utils/_transform.py +457 -0
  24. together/_utils/_typing.py +156 -0
  25. together/_utils/_utils.py +421 -0
  26. together/_version.py +4 -0
  27. together/lib/.keep +4 -0
  28. together/lib/__init__.py +23 -0
  29. together/{cli → lib/cli}/api/endpoints.py +66 -84
  30. together/{cli/api/evaluation.py → lib/cli/api/evals.py} +152 -43
  31. together/{cli → lib/cli}/api/files.py +20 -17
  32. together/{cli/api/finetune.py → lib/cli/api/fine_tuning.py} +116 -172
  33. together/{cli → lib/cli}/api/models.py +34 -27
  34. together/lib/cli/api/utils.py +50 -0
  35. together/{cli → lib/cli}/cli.py +16 -26
  36. together/{constants.py → lib/constants.py} +11 -24
  37. together/lib/resources/__init__.py +11 -0
  38. together/lib/resources/files.py +999 -0
  39. together/lib/resources/fine_tuning.py +280 -0
  40. together/lib/resources/models.py +35 -0
  41. together/lib/types/__init__.py +13 -0
  42. together/lib/types/error.py +9 -0
  43. together/lib/types/fine_tuning.py +397 -0
  44. together/{utils → lib/utils}/__init__.py +6 -14
  45. together/{utils → lib/utils}/_log.py +11 -16
  46. together/{utils → lib/utils}/files.py +90 -288
  47. together/lib/utils/serializer.py +10 -0
  48. together/{utils → lib/utils}/tools.py +19 -55
  49. together/resources/__init__.py +225 -39
  50. together/resources/audio/__init__.py +72 -48
  51. together/resources/audio/audio.py +198 -0
  52. together/resources/audio/speech.py +574 -128
  53. together/resources/audio/transcriptions.py +247 -261
  54. together/resources/audio/translations.py +221 -241
  55. together/resources/audio/voices.py +111 -41
  56. together/resources/batches.py +417 -0
  57. together/resources/chat/__init__.py +30 -21
  58. together/resources/chat/chat.py +102 -0
  59. together/resources/chat/completions.py +1063 -263
  60. together/resources/code_interpreter/__init__.py +33 -0
  61. together/resources/code_interpreter/code_interpreter.py +258 -0
  62. together/resources/code_interpreter/sessions.py +135 -0
  63. together/resources/completions.py +884 -225
  64. together/resources/embeddings.py +172 -68
  65. together/resources/endpoints.py +589 -490
  66. together/resources/evals.py +452 -0
  67. together/resources/files.py +397 -129
  68. together/resources/fine_tuning.py +1033 -0
  69. together/resources/hardware.py +181 -0
  70. together/resources/images.py +258 -104
  71. together/resources/jobs.py +214 -0
  72. together/resources/models.py +223 -193
  73. together/resources/rerank.py +190 -92
  74. together/resources/videos.py +286 -214
  75. together/types/__init__.py +66 -167
  76. together/types/audio/__init__.py +10 -0
  77. together/types/audio/speech_create_params.py +75 -0
  78. together/types/audio/transcription_create_params.py +54 -0
  79. together/types/audio/transcription_create_response.py +111 -0
  80. together/types/audio/translation_create_params.py +40 -0
  81. together/types/audio/translation_create_response.py +70 -0
  82. together/types/audio/voice_list_response.py +23 -0
  83. together/types/audio_speech_stream_chunk.py +16 -0
  84. together/types/autoscaling.py +13 -0
  85. together/types/autoscaling_param.py +15 -0
  86. together/types/batch_create_params.py +24 -0
  87. together/types/batch_create_response.py +14 -0
  88. together/types/batch_job.py +45 -0
  89. together/types/batch_list_response.py +10 -0
  90. together/types/chat/__init__.py +18 -0
  91. together/types/chat/chat_completion.py +60 -0
  92. together/types/chat/chat_completion_chunk.py +61 -0
  93. together/types/chat/chat_completion_structured_message_image_url_param.py +18 -0
  94. together/types/chat/chat_completion_structured_message_text_param.py +13 -0
  95. together/types/chat/chat_completion_structured_message_video_url_param.py +18 -0
  96. together/types/chat/chat_completion_usage.py +13 -0
  97. together/types/chat/chat_completion_warning.py +9 -0
  98. together/types/chat/completion_create_params.py +329 -0
  99. together/types/code_interpreter/__init__.py +5 -0
  100. together/types/code_interpreter/session_list_response.py +31 -0
  101. together/types/code_interpreter_execute_params.py +45 -0
  102. together/types/completion.py +42 -0
  103. together/types/completion_chunk.py +66 -0
  104. together/types/completion_create_params.py +138 -0
  105. together/types/dedicated_endpoint.py +44 -0
  106. together/types/embedding.py +24 -0
  107. together/types/embedding_create_params.py +31 -0
  108. together/types/endpoint_create_params.py +43 -0
  109. together/types/endpoint_list_avzones_response.py +11 -0
  110. together/types/endpoint_list_params.py +18 -0
  111. together/types/endpoint_list_response.py +41 -0
  112. together/types/endpoint_update_params.py +27 -0
  113. together/types/eval_create_params.py +263 -0
  114. together/types/eval_create_response.py +16 -0
  115. together/types/eval_list_params.py +21 -0
  116. together/types/eval_list_response.py +10 -0
  117. together/types/eval_status_response.py +100 -0
  118. together/types/evaluation_job.py +139 -0
  119. together/types/execute_response.py +108 -0
  120. together/types/file_delete_response.py +13 -0
  121. together/types/file_list.py +12 -0
  122. together/types/file_purpose.py +9 -0
  123. together/types/file_response.py +31 -0
  124. together/types/file_type.py +7 -0
  125. together/types/fine_tuning_cancel_response.py +194 -0
  126. together/types/fine_tuning_content_params.py +24 -0
  127. together/types/fine_tuning_delete_params.py +11 -0
  128. together/types/fine_tuning_delete_response.py +12 -0
  129. together/types/fine_tuning_list_checkpoints_response.py +21 -0
  130. together/types/fine_tuning_list_events_response.py +12 -0
  131. together/types/fine_tuning_list_response.py +199 -0
  132. together/types/finetune_event.py +41 -0
  133. together/types/finetune_event_type.py +33 -0
  134. together/types/finetune_response.py +177 -0
  135. together/types/hardware_list_params.py +16 -0
  136. together/types/hardware_list_response.py +58 -0
  137. together/types/image_data_b64.py +15 -0
  138. together/types/image_data_url.py +15 -0
  139. together/types/image_file.py +23 -0
  140. together/types/image_generate_params.py +85 -0
  141. together/types/job_list_response.py +47 -0
  142. together/types/job_retrieve_response.py +43 -0
  143. together/types/log_probs.py +18 -0
  144. together/types/model_list_response.py +10 -0
  145. together/types/model_object.py +42 -0
  146. together/types/model_upload_params.py +36 -0
  147. together/types/model_upload_response.py +23 -0
  148. together/types/rerank_create_params.py +36 -0
  149. together/types/rerank_create_response.py +36 -0
  150. together/types/tool_choice.py +23 -0
  151. together/types/tool_choice_param.py +23 -0
  152. together/types/tools_param.py +23 -0
  153. together/types/training_method_dpo.py +22 -0
  154. together/types/training_method_sft.py +18 -0
  155. together/types/video_create_params.py +86 -0
  156. together/types/video_create_response.py +10 -0
  157. together/types/video_job.py +57 -0
  158. together-2.0.0a7.dist-info/METADATA +730 -0
  159. together-2.0.0a7.dist-info/RECORD +165 -0
  160. {together-1.5.35.dist-info → together-2.0.0a7.dist-info}/WHEEL +1 -1
  161. together-2.0.0a7.dist-info/entry_points.txt +2 -0
  162. {together-1.5.35.dist-info → together-2.0.0a7.dist-info}/licenses/LICENSE +1 -1
  163. together/abstract/api_requestor.py +0 -770
  164. together/cli/api/chat.py +0 -298
  165. together/cli/api/completions.py +0 -119
  166. together/cli/api/images.py +0 -93
  167. together/cli/api/utils.py +0 -139
  168. together/client.py +0 -186
  169. together/error.py +0 -194
  170. together/filemanager.py +0 -635
  171. together/legacy/__init__.py +0 -0
  172. together/legacy/base.py +0 -27
  173. together/legacy/complete.py +0 -93
  174. together/legacy/embeddings.py +0 -27
  175. together/legacy/files.py +0 -146
  176. together/legacy/finetune.py +0 -177
  177. together/legacy/images.py +0 -27
  178. together/legacy/models.py +0 -44
  179. together/resources/batch.py +0 -165
  180. together/resources/code_interpreter.py +0 -82
  181. together/resources/evaluation.py +0 -808
  182. together/resources/finetune.py +0 -1388
  183. together/together_response.py +0 -50
  184. together/types/abstract.py +0 -26
  185. together/types/audio_speech.py +0 -311
  186. together/types/batch.py +0 -54
  187. together/types/chat_completions.py +0 -210
  188. together/types/code_interpreter.py +0 -57
  189. together/types/common.py +0 -67
  190. together/types/completions.py +0 -107
  191. together/types/embeddings.py +0 -35
  192. together/types/endpoints.py +0 -123
  193. together/types/error.py +0 -16
  194. together/types/evaluation.py +0 -93
  195. together/types/files.py +0 -93
  196. together/types/finetune.py +0 -465
  197. together/types/images.py +0 -42
  198. together/types/models.py +0 -96
  199. together/types/rerank.py +0 -43
  200. together/types/videos.py +0 -69
  201. together/utils/api_helpers.py +0 -124
  202. together/version.py +0 -6
  203. together-1.5.35.dist-info/METADATA +0 -583
  204. together-1.5.35.dist-info/RECORD +0 -77
  205. together-1.5.35.dist-info/entry_points.txt +0 -3
  206. /together/{abstract → lib/cli}/__init__.py +0 -0
  207. /together/{cli → lib/cli/api}/__init__.py +0 -0
  208. /together/{cli/api/__init__.py → py.typed} +0 -0
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Required, TypedDict
6
+
7
+ __all__ = ["BatchCreateParams"]
8
+
9
+
10
+ class BatchCreateParams(TypedDict, total=False):
11
+ endpoint: Required[str]
12
+ """The endpoint to use for batch processing"""
13
+
14
+ input_file_id: Required[str]
15
+ """ID of the uploaded input file containing batch requests"""
16
+
17
+ completion_window: str
18
+ """Time window for batch completion (optional)"""
19
+
20
+ model_id: str
21
+ """Model to use for processing batch requests"""
22
+
23
+ priority: int
24
+ """Priority for batch processing (optional)"""
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from .._models import BaseModel
6
+ from .batch_job import BatchJob
7
+
8
+ __all__ = ["BatchCreateResponse"]
9
+
10
+
11
+ class BatchCreateResponse(BaseModel):
12
+ job: Optional[BatchJob] = None
13
+
14
+ warning: Optional[str] = None
@@ -0,0 +1,45 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from .._models import BaseModel
10
+
11
+ __all__ = ["BatchJob"]
12
+
13
+
14
+ class BatchJob(BaseModel):
15
+ id: Optional[str] = None
16
+
17
+ completed_at: Optional[datetime] = None
18
+
19
+ created_at: Optional[datetime] = None
20
+
21
+ endpoint: Optional[str] = None
22
+
23
+ error: Optional[str] = None
24
+
25
+ error_file_id: Optional[str] = None
26
+
27
+ file_size_bytes: Optional[int] = None
28
+ """Size of input file in bytes"""
29
+
30
+ input_file_id: Optional[str] = None
31
+
32
+ job_deadline: Optional[datetime] = None
33
+
34
+ x_model_id: Optional[str] = FieldInfo(alias="model_id", default=None)
35
+ """Model used for processing requests"""
36
+
37
+ output_file_id: Optional[str] = None
38
+
39
+ progress: Optional[float] = None
40
+ """Completion progress (0.0 to 100)"""
41
+
42
+ status: Optional[Literal["VALIDATING", "IN_PROGRESS", "COMPLETED", "FAILED", "EXPIRED", "CANCELLED"]] = None
43
+ """Current status of the batch job"""
44
+
45
+ user_id: Optional[str] = None
@@ -0,0 +1,10 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+ from typing_extensions import TypeAlias
5
+
6
+ from .batch_job import BatchJob
7
+
8
+ __all__ = ["BatchListResponse"]
9
+
10
+ BatchListResponse: TypeAlias = List[BatchJob]
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .chat_completion import ChatCompletion as ChatCompletion
6
+ from .chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk
7
+ from .chat_completion_usage import ChatCompletionUsage as ChatCompletionUsage
8
+ from .chat_completion_warning import ChatCompletionWarning as ChatCompletionWarning
9
+ from .completion_create_params import CompletionCreateParams as CompletionCreateParams
10
+ from .chat_completion_structured_message_text_param import (
11
+ ChatCompletionStructuredMessageTextParam as ChatCompletionStructuredMessageTextParam,
12
+ )
13
+ from .chat_completion_structured_message_image_url_param import (
14
+ ChatCompletionStructuredMessageImageURLParam as ChatCompletionStructuredMessageImageURLParam,
15
+ )
16
+ from .chat_completion_structured_message_video_url_param import (
17
+ ChatCompletionStructuredMessageVideoURLParam as ChatCompletionStructuredMessageVideoURLParam,
18
+ )
@@ -0,0 +1,60 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from ..._models import BaseModel
7
+ from ..log_probs import LogProbs
8
+ from ..tool_choice import ToolChoice
9
+ from .chat_completion_usage import ChatCompletionUsage
10
+ from .chat_completion_warning import ChatCompletionWarning
11
+
12
+ __all__ = ["ChatCompletion", "Choice", "ChoiceMessage", "ChoiceMessageFunctionCall"]
13
+
14
+
15
+ class ChoiceMessageFunctionCall(BaseModel):
16
+ arguments: str
17
+
18
+ name: str
19
+
20
+
21
+ class ChoiceMessage(BaseModel):
22
+ content: Optional[str] = None
23
+
24
+ role: Literal["assistant"]
25
+
26
+ function_call: Optional[ChoiceMessageFunctionCall] = None
27
+
28
+ reasoning: Optional[str] = None
29
+
30
+ tool_calls: Optional[List[ToolChoice]] = None
31
+
32
+
33
+ class Choice(BaseModel):
34
+ finish_reason: Optional[Literal["stop", "eos", "length", "tool_calls", "function_call"]] = None
35
+
36
+ index: Optional[int] = None
37
+
38
+ logprobs: Optional[LogProbs] = None
39
+
40
+ message: Optional[ChoiceMessage] = None
41
+
42
+ seed: Optional[int] = None
43
+
44
+ text: Optional[str] = None
45
+
46
+
47
+ class ChatCompletion(BaseModel):
48
+ id: str
49
+
50
+ choices: List[Choice]
51
+
52
+ created: int
53
+
54
+ model: str
55
+
56
+ object: Literal["chat.completion"]
57
+
58
+ usage: Optional[ChatCompletionUsage] = None
59
+
60
+ warnings: Optional[List[ChatCompletionWarning]] = None
@@ -0,0 +1,61 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from ..._models import BaseModel
7
+ from ..tool_choice import ToolChoice
8
+ from .chat_completion_usage import ChatCompletionUsage
9
+ from .chat_completion_warning import ChatCompletionWarning
10
+
11
+ __all__ = ["ChatCompletionChunk", "Choice", "ChoiceDelta", "ChoiceDeltaFunctionCall"]
12
+
13
+
14
+ class ChoiceDeltaFunctionCall(BaseModel):
15
+ arguments: str
16
+
17
+ name: str
18
+
19
+
20
+ class ChoiceDelta(BaseModel):
21
+ role: Literal["system", "user", "assistant", "function", "tool"]
22
+
23
+ content: Optional[str] = None
24
+
25
+ function_call: Optional[ChoiceDeltaFunctionCall] = None
26
+
27
+ reasoning: Optional[str] = None
28
+
29
+ token_id: Optional[int] = None
30
+
31
+ tool_calls: Optional[List[ToolChoice]] = None
32
+
33
+
34
+ class Choice(BaseModel):
35
+ delta: ChoiceDelta
36
+
37
+ finish_reason: Optional[Literal["stop", "eos", "length", "tool_calls", "function_call"]] = None
38
+
39
+ index: int
40
+
41
+ logprobs: Optional[float] = None
42
+
43
+ seed: Optional[int] = None
44
+
45
+
46
+ class ChatCompletionChunk(BaseModel):
47
+ id: str
48
+
49
+ choices: List[Choice]
50
+
51
+ created: int
52
+
53
+ model: str
54
+
55
+ object: Literal["chat.completion.chunk"]
56
+
57
+ system_fingerprint: Optional[str] = None
58
+
59
+ usage: Optional[ChatCompletionUsage] = None
60
+
61
+ warnings: Optional[List[ChatCompletionWarning]] = None
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ __all__ = ["ChatCompletionStructuredMessageImageURLParam", "ImageURL"]
8
+
9
+
10
+ class ImageURL(TypedDict, total=False):
11
+ url: Required[str]
12
+ """The URL of the image"""
13
+
14
+
15
+ class ChatCompletionStructuredMessageImageURLParam(TypedDict, total=False):
16
+ image_url: ImageURL
17
+
18
+ type: Literal["image_url"]
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ __all__ = ["ChatCompletionStructuredMessageTextParam"]
8
+
9
+
10
+ class ChatCompletionStructuredMessageTextParam(TypedDict, total=False):
11
+ text: Required[str]
12
+
13
+ type: Required[Literal["text"]]
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ __all__ = ["ChatCompletionStructuredMessageVideoURLParam", "VideoURL"]
8
+
9
+
10
+ class VideoURL(TypedDict, total=False):
11
+ url: Required[str]
12
+ """The URL of the video"""
13
+
14
+
15
+ class ChatCompletionStructuredMessageVideoURLParam(TypedDict, total=False):
16
+ type: Required[Literal["video_url"]]
17
+
18
+ video_url: Required[VideoURL]
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["ChatCompletionUsage"]
6
+
7
+
8
+ class ChatCompletionUsage(BaseModel):
9
+ completion_tokens: int
10
+
11
+ prompt_tokens: int
12
+
13
+ total_tokens: int
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["ChatCompletionWarning"]
6
+
7
+
8
+ class ChatCompletionWarning(BaseModel):
9
+ message: str
@@ -0,0 +1,329 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Union, Iterable, Optional
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
+
8
+ from ..._types import SequenceNotStr
9
+ from ..tools_param import ToolsParam
10
+ from ..tool_choice_param import ToolChoiceParam
11
+ from .chat_completion_structured_message_text_param import ChatCompletionStructuredMessageTextParam
12
+ from .chat_completion_structured_message_image_url_param import ChatCompletionStructuredMessageImageURLParam
13
+ from .chat_completion_structured_message_video_url_param import ChatCompletionStructuredMessageVideoURLParam
14
+
15
+ __all__ = [
16
+ "CompletionCreateParamsBase",
17
+ "Message",
18
+ "MessageChatCompletionSystemMessageParam",
19
+ "MessageChatCompletionUserMessageParam",
20
+ "MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodal",
21
+ "MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalAudio",
22
+ "MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalAudioAudioURL",
23
+ "MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalInputAudio",
24
+ "MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalInputAudioInputAudio",
25
+ "MessageChatCompletionAssistantMessageParam",
26
+ "MessageChatCompletionAssistantMessageParamFunctionCall",
27
+ "MessageChatCompletionToolMessageParam",
28
+ "MessageChatCompletionFunctionMessageParam",
29
+ "FunctionCall",
30
+ "FunctionCallName",
31
+ "ResponseFormat",
32
+ "ToolChoice",
33
+ "CompletionCreateParamsNonStreaming",
34
+ "CompletionCreateParamsStreaming",
35
+ ]
36
+
37
+
38
+ class CompletionCreateParamsBase(TypedDict, total=False):
39
+ messages: Required[Iterable[Message]]
40
+ """A list of messages comprising the conversation so far."""
41
+
42
+ model: Required[
43
+ Union[
44
+ Literal[
45
+ "Qwen/Qwen2.5-72B-Instruct-Turbo",
46
+ "Qwen/Qwen2.5-7B-Instruct-Turbo",
47
+ "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
48
+ "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
49
+ "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
50
+ ],
51
+ str,
52
+ ]
53
+ ]
54
+ """The name of the model to query.
55
+
56
+ [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
57
+ """
58
+
59
+ context_length_exceeded_behavior: Literal["truncate", "error"]
60
+ """
61
+ Defined the behavior of the API when max_tokens exceed the maximum context
62
+ length of the model. When set to 'error', API will return 400 with appropriate
63
+ error message. When set to 'truncate', override the max_tokens with maximum
64
+ context length of the model.
65
+ """
66
+
67
+ echo: bool
68
+ """If true, the response will contain the prompt.
69
+
70
+ Can be used with `logprobs` to return prompt logprobs.
71
+ """
72
+
73
+ frequency_penalty: float
74
+ """
75
+ A number between -2.0 and 2.0 where a positive value decreases the likelihood of
76
+ repeating tokens that have already been mentioned.
77
+ """
78
+
79
+ function_call: FunctionCall
80
+
81
+ logit_bias: Dict[str, float]
82
+ """Adjusts the likelihood of specific tokens appearing in the generated output."""
83
+
84
+ logprobs: int
85
+ """
86
+ An integer between 0 and 20 of the top k tokens to return log probabilities for
87
+ at each generation step, instead of just the sampled token. Log probabilities
88
+ help assess model confidence in token predictions.
89
+ """
90
+
91
+ max_tokens: int
92
+ """The maximum number of tokens to generate."""
93
+
94
+ min_p: float
95
+ """A number between 0 and 1 that can be used as an alternative to top_p and top-k."""
96
+
97
+ n: int
98
+ """The number of completions to generate for each prompt."""
99
+
100
+ presence_penalty: float
101
+ """
102
+ A number between -2.0 and 2.0 where a positive value increases the likelihood of
103
+ a model talking about new topics.
104
+ """
105
+
106
+ reasoning_effort: Literal["low", "medium", "high"]
107
+ """
108
+ Controls the level of reasoning effort the model should apply when generating
109
+ responses. Higher values may result in more thoughtful and detailed responses
110
+ but may take longer to generate.
111
+ """
112
+
113
+ repetition_penalty: float
114
+ """
115
+ A number that controls the diversity of generated text by reducing the
116
+ likelihood of repeated sequences. Higher values decrease repetition.
117
+ """
118
+
119
+ response_format: ResponseFormat
120
+ """An object specifying the format that the model must output."""
121
+
122
+ safety_model: str
123
+ """The name of the moderation model used to validate tokens.
124
+
125
+ Choose from the available moderation models found
126
+ [here](https://docs.together.ai/docs/inference-models#moderation-models).
127
+ """
128
+
129
+ seed: int
130
+ """Seed value for reproducibility."""
131
+
132
+ stop: SequenceNotStr[str]
133
+ """A list of string sequences that will truncate (stop) inference text output.
134
+
135
+ For example, "</s>" will stop generation as soon as the model generates the
136
+ given token.
137
+ """
138
+
139
+ temperature: float
140
+ """
141
+ A decimal number from 0-1 that determines the degree of randomness in the
142
+ response. A temperature less than 1 favors more correctness and is appropriate
143
+ for question answering or summarization. A value closer to 1 introduces more
144
+ randomness in the output.
145
+ """
146
+
147
+ tool_choice: ToolChoice
148
+ """Controls which (if any) function is called by the model.
149
+
150
+ By default uses `auto`, which lets the model pick between generating a message
151
+ or calling a function.
152
+ """
153
+
154
+ tools: Iterable[ToolsParam]
155
+ """A list of tools the model may call.
156
+
157
+ Currently, only functions are supported as a tool. Use this to provide a list of
158
+ functions the model may generate JSON inputs for.
159
+ """
160
+
161
+ top_k: int
162
+ """
163
+ An integer that's used to limit the number of choices for the next predicted
164
+ word or token. It specifies the maximum number of tokens to consider at each
165
+ step, based on their probability of occurrence. This technique helps to speed up
166
+ the generation process and can improve the quality of the generated text by
167
+ focusing on the most likely options.
168
+ """
169
+
170
+ top_p: float
171
+ """
172
+ A percentage (also called the nucleus parameter) that's used to dynamically
173
+ adjust the number of choices for each predicted token based on the cumulative
174
+ probabilities. It specifies a probability threshold below which all less likely
175
+ tokens are filtered out. This technique helps maintain diversity and generate
176
+ more fluent and natural-sounding text.
177
+ """
178
+
179
+
180
+ class MessageChatCompletionSystemMessageParam(TypedDict, total=False):
181
+ content: Required[str]
182
+
183
+ role: Required[Literal["system"]]
184
+
185
+ name: str
186
+
187
+
188
+ class MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalAudioAudioURL(
189
+ TypedDict, total=False
190
+ ):
191
+ url: Required[str]
192
+ """The URL of the audio"""
193
+
194
+
195
+ class MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalAudio(
196
+ TypedDict, total=False
197
+ ):
198
+ audio_url: Required[
199
+ MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalAudioAudioURL
200
+ ]
201
+
202
+ type: Required[Literal["audio_url"]]
203
+
204
+
205
+ class MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalInputAudioInputAudio(
206
+ TypedDict, total=False
207
+ ):
208
+ data: Required[str]
209
+ """The base64 encoded audio data"""
210
+
211
+ format: Required[Literal["wav"]]
212
+ """The format of the audio data"""
213
+
214
+
215
+ class MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalInputAudio(
216
+ TypedDict, total=False
217
+ ):
218
+ input_audio: Required[
219
+ MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalInputAudioInputAudio
220
+ ]
221
+
222
+ type: Required[Literal["input_audio"]]
223
+
224
+
225
+ MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodal: TypeAlias = Union[
226
+ ChatCompletionStructuredMessageTextParam,
227
+ ChatCompletionStructuredMessageImageURLParam,
228
+ ChatCompletionStructuredMessageVideoURLParam,
229
+ MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalAudio,
230
+ MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodalInputAudio,
231
+ ]
232
+
233
+
234
+ class MessageChatCompletionUserMessageParam(TypedDict, total=False):
235
+ content: Required[
236
+ Union[str, Iterable[MessageChatCompletionUserMessageParamContentChatCompletionUserMessageContentMultimodal]]
237
+ ]
238
+ """
239
+ The content of the message, which can either be a simple string or a structured
240
+ format.
241
+ """
242
+
243
+ role: Required[Literal["user"]]
244
+
245
+ name: str
246
+
247
+
248
+ class MessageChatCompletionAssistantMessageParamFunctionCall(TypedDict, total=False):
249
+ arguments: Required[str]
250
+
251
+ name: Required[str]
252
+
253
+
254
+ class MessageChatCompletionAssistantMessageParam(TypedDict, total=False):
255
+ role: Required[Literal["assistant"]]
256
+
257
+ content: Optional[str]
258
+
259
+ function_call: MessageChatCompletionAssistantMessageParamFunctionCall
260
+
261
+ name: str
262
+
263
+ tool_calls: Iterable[ToolChoiceParam]
264
+
265
+
266
+ class MessageChatCompletionToolMessageParam(TypedDict, total=False):
267
+ content: Required[str]
268
+
269
+ role: Required[Literal["tool"]]
270
+
271
+ tool_call_id: Required[str]
272
+
273
+ name: str
274
+
275
+
276
+ class MessageChatCompletionFunctionMessageParam(TypedDict, total=False):
277
+ content: Required[str]
278
+
279
+ name: Required[str]
280
+
281
+ role: Required[Literal["function"]]
282
+
283
+
284
+ Message: TypeAlias = Union[
285
+ MessageChatCompletionSystemMessageParam,
286
+ MessageChatCompletionUserMessageParam,
287
+ MessageChatCompletionAssistantMessageParam,
288
+ MessageChatCompletionToolMessageParam,
289
+ MessageChatCompletionFunctionMessageParam,
290
+ ]
291
+
292
+
293
+ class FunctionCallName(TypedDict, total=False):
294
+ name: Required[str]
295
+
296
+
297
+ FunctionCall: TypeAlias = Union[Literal["none", "auto"], FunctionCallName]
298
+
299
+
300
+ class ResponseFormat(TypedDict, total=False):
301
+ schema: Dict[str, object]
302
+ """The schema of the response format."""
303
+
304
+ type: str
305
+ """The type of the response format."""
306
+
307
+
308
+ ToolChoice: TypeAlias = Union[str, ToolChoiceParam]
309
+
310
+
311
+ class CompletionCreateParamsNonStreaming(CompletionCreateParamsBase, total=False):
312
+ stream: Literal[False]
313
+ """
314
+ If true, stream tokens as Server-Sent Events as the model generates them instead
315
+ of waiting for the full model response. The stream terminates with
316
+ `data: [DONE]`. If false, return a single JSON object containing the results.
317
+ """
318
+
319
+
320
+ class CompletionCreateParamsStreaming(CompletionCreateParamsBase):
321
+ stream: Required[Literal[True]]
322
+ """
323
+ If true, stream tokens as Server-Sent Events as the model generates them instead
324
+ of waiting for the full model response. The stream terminates with
325
+ `data: [DONE]`. If false, return a single JSON object containing the results.
326
+ """
327
+
328
+
329
+ CompletionCreateParams = Union[CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming]
@@ -0,0 +1,5 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .session_list_response import SessionListResponse as SessionListResponse
@@ -0,0 +1,31 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Union, Optional
4
+ from datetime import datetime
5
+
6
+ from ..._models import BaseModel
7
+
8
+ __all__ = ["SessionListResponse", "Data", "DataSession"]
9
+
10
+
11
+ class DataSession(BaseModel):
12
+ id: str
13
+ """Session Identifier. Used to make follow-up calls."""
14
+
15
+ execute_count: int
16
+
17
+ expires_at: datetime
18
+
19
+ last_execute_at: datetime
20
+
21
+ started_at: datetime
22
+
23
+
24
+ class Data(BaseModel):
25
+ sessions: List[DataSession]
26
+
27
+
28
+ class SessionListResponse(BaseModel):
29
+ data: Optional[Data] = None
30
+
31
+ errors: Optional[List[Union[str, Dict[str, object]]]] = None