together 1.2.11__py3-none-any.whl → 2.0.0a8__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.
- together/__init__.py +101 -63
- together/_base_client.py +1995 -0
- together/_client.py +1033 -0
- together/_compat.py +219 -0
- together/_constants.py +14 -0
- together/_exceptions.py +108 -0
- together/_files.py +123 -0
- together/_models.py +857 -0
- together/_qs.py +150 -0
- together/_resource.py +43 -0
- together/_response.py +830 -0
- together/_streaming.py +370 -0
- together/_types.py +260 -0
- together/_utils/__init__.py +64 -0
- together/_utils/_compat.py +45 -0
- together/_utils/_datetime_parse.py +136 -0
- together/_utils/_logs.py +25 -0
- together/_utils/_proxy.py +65 -0
- together/_utils/_reflection.py +42 -0
- together/_utils/_resources_proxy.py +24 -0
- together/_utils/_streams.py +12 -0
- together/_utils/_sync.py +58 -0
- together/_utils/_transform.py +457 -0
- together/_utils/_typing.py +156 -0
- together/_utils/_utils.py +421 -0
- together/_version.py +4 -0
- together/lib/.keep +4 -0
- together/lib/__init__.py +23 -0
- together/lib/cli/api/endpoints.py +467 -0
- together/lib/cli/api/evals.py +588 -0
- together/{cli → lib/cli}/api/files.py +20 -17
- together/lib/cli/api/fine_tuning.py +566 -0
- together/lib/cli/api/models.py +140 -0
- together/lib/cli/api/utils.py +50 -0
- together/{cli → lib/cli}/cli.py +17 -23
- together/lib/constants.py +61 -0
- together/lib/resources/__init__.py +11 -0
- together/lib/resources/files.py +999 -0
- together/lib/resources/fine_tuning.py +280 -0
- together/lib/resources/models.py +35 -0
- together/lib/types/__init__.py +13 -0
- together/lib/types/error.py +9 -0
- together/lib/types/fine_tuning.py +455 -0
- together/{utils → lib/utils}/__init__.py +7 -10
- together/{utils → lib/utils}/_log.py +18 -13
- together/lib/utils/files.py +628 -0
- together/lib/utils/serializer.py +10 -0
- together/{utils → lib/utils}/tools.py +17 -2
- together/resources/__init__.py +225 -24
- together/resources/audio/__init__.py +75 -0
- together/resources/audio/audio.py +198 -0
- together/resources/audio/speech.py +605 -0
- together/resources/audio/transcriptions.py +282 -0
- together/resources/audio/translations.py +256 -0
- together/resources/audio/voices.py +135 -0
- together/resources/batches.py +417 -0
- together/resources/chat/__init__.py +30 -21
- together/resources/chat/chat.py +102 -0
- together/resources/chat/completions.py +1063 -257
- together/resources/code_interpreter/__init__.py +33 -0
- together/resources/code_interpreter/code_interpreter.py +258 -0
- together/resources/code_interpreter/sessions.py +135 -0
- together/resources/completions.py +890 -225
- together/resources/embeddings.py +172 -68
- together/resources/endpoints.py +711 -0
- together/resources/evals.py +452 -0
- together/resources/files.py +397 -120
- together/resources/fine_tuning.py +1033 -0
- together/resources/hardware.py +181 -0
- together/resources/images.py +256 -108
- together/resources/jobs.py +214 -0
- together/resources/models.py +251 -44
- together/resources/rerank.py +190 -92
- together/resources/videos.py +374 -0
- together/types/__init__.py +66 -73
- together/types/audio/__init__.py +10 -0
- together/types/audio/speech_create_params.py +75 -0
- together/types/audio/transcription_create_params.py +54 -0
- together/types/audio/transcription_create_response.py +111 -0
- together/types/audio/translation_create_params.py +40 -0
- together/types/audio/translation_create_response.py +70 -0
- together/types/audio/voice_list_response.py +23 -0
- together/types/audio_speech_stream_chunk.py +16 -0
- together/types/autoscaling.py +13 -0
- together/types/autoscaling_param.py +15 -0
- together/types/batch_create_params.py +24 -0
- together/types/batch_create_response.py +14 -0
- together/types/batch_job.py +45 -0
- together/types/batch_list_response.py +10 -0
- together/types/chat/__init__.py +18 -0
- together/types/chat/chat_completion.py +60 -0
- together/types/chat/chat_completion_chunk.py +61 -0
- together/types/chat/chat_completion_structured_message_image_url_param.py +18 -0
- together/types/chat/chat_completion_structured_message_text_param.py +13 -0
- together/types/chat/chat_completion_structured_message_video_url_param.py +18 -0
- together/types/chat/chat_completion_usage.py +13 -0
- together/types/chat/chat_completion_warning.py +9 -0
- together/types/chat/completion_create_params.py +329 -0
- together/types/code_interpreter/__init__.py +5 -0
- together/types/code_interpreter/session_list_response.py +31 -0
- together/types/code_interpreter_execute_params.py +45 -0
- together/types/completion.py +42 -0
- together/types/completion_chunk.py +66 -0
- together/types/completion_create_params.py +138 -0
- together/types/dedicated_endpoint.py +44 -0
- together/types/embedding.py +24 -0
- together/types/embedding_create_params.py +31 -0
- together/types/endpoint_create_params.py +43 -0
- together/types/endpoint_list_avzones_response.py +11 -0
- together/types/endpoint_list_params.py +18 -0
- together/types/endpoint_list_response.py +41 -0
- together/types/endpoint_update_params.py +27 -0
- together/types/eval_create_params.py +263 -0
- together/types/eval_create_response.py +16 -0
- together/types/eval_list_params.py +21 -0
- together/types/eval_list_response.py +10 -0
- together/types/eval_status_response.py +100 -0
- together/types/evaluation_job.py +139 -0
- together/types/execute_response.py +108 -0
- together/types/file_delete_response.py +13 -0
- together/types/file_list.py +12 -0
- together/types/file_purpose.py +9 -0
- together/types/file_response.py +31 -0
- together/types/file_type.py +7 -0
- together/types/fine_tuning_cancel_response.py +194 -0
- together/types/fine_tuning_content_params.py +24 -0
- together/types/fine_tuning_delete_params.py +11 -0
- together/types/fine_tuning_delete_response.py +12 -0
- together/types/fine_tuning_list_checkpoints_response.py +21 -0
- together/types/fine_tuning_list_events_response.py +12 -0
- together/types/fine_tuning_list_response.py +199 -0
- together/types/finetune_event.py +41 -0
- together/types/finetune_event_type.py +33 -0
- together/types/finetune_response.py +177 -0
- together/types/hardware_list_params.py +16 -0
- together/types/hardware_list_response.py +58 -0
- together/types/image_data_b64.py +15 -0
- together/types/image_data_url.py +15 -0
- together/types/image_file.py +23 -0
- together/types/image_generate_params.py +85 -0
- together/types/job_list_response.py +47 -0
- together/types/job_retrieve_response.py +43 -0
- together/types/log_probs.py +18 -0
- together/types/model_list_response.py +10 -0
- together/types/model_object.py +42 -0
- together/types/model_upload_params.py +36 -0
- together/types/model_upload_response.py +23 -0
- together/types/rerank_create_params.py +36 -0
- together/types/rerank_create_response.py +36 -0
- together/types/tool_choice.py +23 -0
- together/types/tool_choice_param.py +23 -0
- together/types/tools_param.py +23 -0
- together/types/training_method_dpo.py +22 -0
- together/types/training_method_sft.py +18 -0
- together/types/video_create_params.py +86 -0
- together/types/video_job.py +57 -0
- together-2.0.0a8.dist-info/METADATA +680 -0
- together-2.0.0a8.dist-info/RECORD +164 -0
- {together-1.2.11.dist-info → together-2.0.0a8.dist-info}/WHEEL +1 -1
- together-2.0.0a8.dist-info/entry_points.txt +2 -0
- {together-1.2.11.dist-info → together-2.0.0a8.dist-info/licenses}/LICENSE +1 -1
- together/abstract/api_requestor.py +0 -723
- together/cli/api/chat.py +0 -276
- together/cli/api/completions.py +0 -119
- together/cli/api/finetune.py +0 -272
- together/cli/api/images.py +0 -82
- together/cli/api/models.py +0 -42
- together/client.py +0 -157
- together/constants.py +0 -31
- together/error.py +0 -191
- together/filemanager.py +0 -388
- together/legacy/__init__.py +0 -0
- together/legacy/base.py +0 -27
- together/legacy/complete.py +0 -93
- together/legacy/embeddings.py +0 -27
- together/legacy/files.py +0 -146
- together/legacy/finetune.py +0 -177
- together/legacy/images.py +0 -27
- together/legacy/models.py +0 -44
- together/resources/finetune.py +0 -489
- together/together_response.py +0 -50
- together/types/abstract.py +0 -26
- together/types/chat_completions.py +0 -171
- together/types/common.py +0 -65
- together/types/completions.py +0 -104
- together/types/embeddings.py +0 -35
- together/types/error.py +0 -16
- together/types/files.py +0 -89
- together/types/finetune.py +0 -265
- together/types/images.py +0 -42
- together/types/models.py +0 -44
- together/types/rerank.py +0 -43
- together/utils/api_helpers.py +0 -84
- together/utils/files.py +0 -204
- together/version.py +0 -6
- together-1.2.11.dist-info/METADATA +0 -408
- together-1.2.11.dist-info/RECORD +0 -58
- together-1.2.11.dist-info/entry_points.txt +0 -3
- /together/{abstract → lib/cli}/__init__.py +0 -0
- /together/{cli → lib/cli/api}/__init__.py +0 -0
- /together/{cli/api/__init__.py → py.typed} +0 -0
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import warnings
|
|
4
|
-
from enum import Enum
|
|
5
|
-
from typing import Any, Dict, List
|
|
6
|
-
|
|
7
|
-
from pydantic import model_validator
|
|
8
|
-
from typing_extensions import Self
|
|
9
|
-
|
|
10
|
-
from together.types.abstract import BaseModel
|
|
11
|
-
from together.types.common import (
|
|
12
|
-
DeltaContent,
|
|
13
|
-
FinishReason,
|
|
14
|
-
LogprobsPart,
|
|
15
|
-
ObjectType,
|
|
16
|
-
PromptPart,
|
|
17
|
-
UsageData,
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class MessageRole(str, Enum):
|
|
22
|
-
ASSISTANT = "assistant"
|
|
23
|
-
SYSTEM = "system"
|
|
24
|
-
USER = "user"
|
|
25
|
-
TOOL = "tool"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class ResponseFormatType(str, Enum):
|
|
29
|
-
JSON_OBJECT = "json_object"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class FunctionCall(BaseModel):
|
|
33
|
-
name: str | None = None
|
|
34
|
-
arguments: str | None = None
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class ToolCalls(BaseModel):
|
|
38
|
-
id: str | None = None
|
|
39
|
-
type: str | None = None
|
|
40
|
-
function: FunctionCall | None = None
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class ChatCompletionMessage(BaseModel):
|
|
44
|
-
role: MessageRole
|
|
45
|
-
content: str | None = None
|
|
46
|
-
tool_calls: List[ToolCalls] | None = None
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class ResponseFormat(BaseModel):
|
|
50
|
-
type: ResponseFormatType
|
|
51
|
-
schema_: Dict[str, Any] | None = None
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
-
return {"schema": self.schema_, "type": self.type}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class FunctionTool(BaseModel):
|
|
58
|
-
description: str | None = None
|
|
59
|
-
name: str
|
|
60
|
-
parameters: Dict[str, Any] | None = None
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class FunctionToolChoice(BaseModel):
|
|
64
|
-
name: str
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class Tools(BaseModel):
|
|
68
|
-
type: str
|
|
69
|
-
function: FunctionTool
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
class ToolChoice(BaseModel):
|
|
73
|
-
type: str
|
|
74
|
-
function: FunctionToolChoice
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class ToolChoiceEnum(str, Enum):
|
|
78
|
-
Auto = "auto"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class ChatCompletionRequest(BaseModel):
|
|
82
|
-
# list of messages
|
|
83
|
-
messages: List[ChatCompletionMessage]
|
|
84
|
-
# model name
|
|
85
|
-
model: str
|
|
86
|
-
# stopping criteria: max tokens to generate
|
|
87
|
-
max_tokens: int | None = None
|
|
88
|
-
# stopping criteria: list of strings to stop generation
|
|
89
|
-
stop: List[str] | None = None
|
|
90
|
-
# sampling hyperparameters
|
|
91
|
-
temperature: float | None = None
|
|
92
|
-
top_p: float | None = None
|
|
93
|
-
top_k: int | None = None
|
|
94
|
-
repetition_penalty: float | None = None
|
|
95
|
-
presence_penalty: float | None = None
|
|
96
|
-
frequency_penalty: float | None = None
|
|
97
|
-
min_p: float | None = None
|
|
98
|
-
logit_bias: Dict[str, float] | None = None
|
|
99
|
-
# stream SSE token chunks
|
|
100
|
-
stream: bool = False
|
|
101
|
-
# return logprobs
|
|
102
|
-
logprobs: int | None = None
|
|
103
|
-
# echo prompt.
|
|
104
|
-
# can be used with logprobs to return prompt logprobs
|
|
105
|
-
echo: bool | None = None
|
|
106
|
-
# number of output generations
|
|
107
|
-
n: int | None = None
|
|
108
|
-
# moderation model
|
|
109
|
-
safety_model: str | None = None
|
|
110
|
-
# constraints
|
|
111
|
-
response_format: ResponseFormat | None = None
|
|
112
|
-
tools: List[Tools] | None = None
|
|
113
|
-
tool_choice: ToolChoice | ToolChoiceEnum | None = None
|
|
114
|
-
|
|
115
|
-
# Raise warning if repetition_penalty is used with presence_penalty or frequency_penalty
|
|
116
|
-
@model_validator(mode="after")
|
|
117
|
-
def verify_parameters(self) -> Self:
|
|
118
|
-
if self.repetition_penalty:
|
|
119
|
-
if self.presence_penalty or self.frequency_penalty:
|
|
120
|
-
warnings.warn(
|
|
121
|
-
"repetition_penalty is not advisable to be used alongside presence_penalty or frequency_penalty"
|
|
122
|
-
)
|
|
123
|
-
return self
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
class ChatCompletionChoicesData(BaseModel):
|
|
127
|
-
index: int | None = None
|
|
128
|
-
logprobs: LogprobsPart | None = None
|
|
129
|
-
finish_reason: FinishReason | None = None
|
|
130
|
-
message: ChatCompletionMessage | None = None
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
class ChatCompletionResponse(BaseModel):
|
|
134
|
-
# request id
|
|
135
|
-
id: str | None = None
|
|
136
|
-
# object type
|
|
137
|
-
object: ObjectType | None = None
|
|
138
|
-
# created timestamp
|
|
139
|
-
created: int | None = None
|
|
140
|
-
# model name
|
|
141
|
-
model: str | None = None
|
|
142
|
-
# choices list
|
|
143
|
-
choices: List[ChatCompletionChoicesData] | None = None
|
|
144
|
-
# prompt list
|
|
145
|
-
prompt: List[PromptPart] | List[None] | None = None
|
|
146
|
-
# token usage data
|
|
147
|
-
usage: UsageData | None = None
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
class ChatCompletionChoicesChunk(BaseModel):
|
|
151
|
-
index: int | None = None
|
|
152
|
-
logprobs: float | None = None
|
|
153
|
-
finish_reason: FinishReason | None = None
|
|
154
|
-
delta: DeltaContent | None = None
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
class ChatCompletionChunk(BaseModel):
|
|
158
|
-
# request id
|
|
159
|
-
id: str | None = None
|
|
160
|
-
# object type
|
|
161
|
-
object: ObjectType | None = None
|
|
162
|
-
# created timestamp
|
|
163
|
-
created: int | None = None
|
|
164
|
-
# model name
|
|
165
|
-
model: str | None = None
|
|
166
|
-
# delta content
|
|
167
|
-
choices: List[ChatCompletionChoicesChunk] | None = None
|
|
168
|
-
# finish reason
|
|
169
|
-
finish_reason: FinishReason | None = None
|
|
170
|
-
# token usage data
|
|
171
|
-
usage: UsageData | None = None
|
together/types/common.py
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from enum import Enum
|
|
4
|
-
from typing import Any, Dict, List
|
|
5
|
-
|
|
6
|
-
from pydantic import ConfigDict
|
|
7
|
-
from tqdm.utils import CallbackIOWrapper
|
|
8
|
-
|
|
9
|
-
from together.types.abstract import BaseModel
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Generation finish reason
|
|
13
|
-
class FinishReason(str, Enum):
|
|
14
|
-
Length = "length"
|
|
15
|
-
StopSequence = "stop"
|
|
16
|
-
EOS = "eos"
|
|
17
|
-
ToolCalls = "tool_calls"
|
|
18
|
-
Error = "error"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class UsageData(BaseModel):
|
|
22
|
-
prompt_tokens: int
|
|
23
|
-
completion_tokens: int
|
|
24
|
-
total_tokens: int
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class ObjectType(str, Enum):
|
|
28
|
-
Completion = "text.completion"
|
|
29
|
-
CompletionChunk = "completion.chunk"
|
|
30
|
-
ChatCompletion = "chat.completion"
|
|
31
|
-
ChatCompletionChunk = "chat.completion.chunk"
|
|
32
|
-
Embedding = "embedding"
|
|
33
|
-
FinetuneEvent = "fine-tune-event"
|
|
34
|
-
File = "file"
|
|
35
|
-
Model = "model"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class LogprobsPart(BaseModel):
|
|
39
|
-
# token list
|
|
40
|
-
tokens: List[str | None] | None = None
|
|
41
|
-
# token logprob list
|
|
42
|
-
token_logprobs: List[float | None] | None = None
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class PromptPart(BaseModel):
|
|
46
|
-
# prompt string
|
|
47
|
-
text: str | None = None
|
|
48
|
-
# list of prompt logprobs
|
|
49
|
-
logprobs: LogprobsPart | None = None
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class DeltaContent(BaseModel):
|
|
53
|
-
content: str | None = None
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class TogetherRequest(BaseModel):
|
|
57
|
-
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
58
|
-
|
|
59
|
-
method: str
|
|
60
|
-
url: str
|
|
61
|
-
headers: Dict[str, str] | None = None
|
|
62
|
-
params: Dict[str, Any] | CallbackIOWrapper | None = None
|
|
63
|
-
files: Dict[str, Any] | None = None
|
|
64
|
-
allow_redirects: bool = True
|
|
65
|
-
override_headers: bool = False
|
together/types/completions.py
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import warnings
|
|
4
|
-
from typing import Dict, List
|
|
5
|
-
|
|
6
|
-
from pydantic import model_validator
|
|
7
|
-
from typing_extensions import Self
|
|
8
|
-
|
|
9
|
-
from together.types.abstract import BaseModel
|
|
10
|
-
from together.types.common import (
|
|
11
|
-
DeltaContent,
|
|
12
|
-
FinishReason,
|
|
13
|
-
LogprobsPart,
|
|
14
|
-
ObjectType,
|
|
15
|
-
PromptPart,
|
|
16
|
-
UsageData,
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class CompletionRequest(BaseModel):
|
|
21
|
-
# prompt to complete
|
|
22
|
-
prompt: str
|
|
23
|
-
# query model
|
|
24
|
-
model: str
|
|
25
|
-
# stopping criteria: max tokens to generate
|
|
26
|
-
max_tokens: int | None = None
|
|
27
|
-
# stopping criteria: list of strings to stop generation
|
|
28
|
-
stop: List[str] | None = None
|
|
29
|
-
# sampling hyperparameters
|
|
30
|
-
temperature: float | None = None
|
|
31
|
-
top_p: float | None = None
|
|
32
|
-
top_k: int | None = None
|
|
33
|
-
repetition_penalty: float | None = None
|
|
34
|
-
presence_penalty: float | None = None
|
|
35
|
-
frequency_penalty: float | None = None
|
|
36
|
-
min_p: float | None = None
|
|
37
|
-
logit_bias: Dict[str, float] | None = None
|
|
38
|
-
# stream SSE token chunks
|
|
39
|
-
stream: bool = False
|
|
40
|
-
# return logprobs
|
|
41
|
-
logprobs: int | None = None
|
|
42
|
-
# echo prompt.
|
|
43
|
-
# can be used with logprobs to return prompt logprobs
|
|
44
|
-
echo: bool | None = None
|
|
45
|
-
# number of output generations
|
|
46
|
-
n: int | None = None
|
|
47
|
-
# moderation model
|
|
48
|
-
safety_model: str | None = None
|
|
49
|
-
|
|
50
|
-
# Raise warning if repetition_penalty is used with presence_penalty or frequency_penalty
|
|
51
|
-
@model_validator(mode="after")
|
|
52
|
-
def verify_parameters(self) -> Self:
|
|
53
|
-
if self.repetition_penalty:
|
|
54
|
-
if self.presence_penalty or self.frequency_penalty:
|
|
55
|
-
warnings.warn(
|
|
56
|
-
"repetition_penalty is not advisable to be used alongside presence_penalty or frequency_penalty"
|
|
57
|
-
)
|
|
58
|
-
return self
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
class CompletionChoicesData(BaseModel):
|
|
62
|
-
index: int
|
|
63
|
-
logprobs: LogprobsPart | None = None
|
|
64
|
-
finish_reason: FinishReason | None = None
|
|
65
|
-
text: str
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class CompletionChoicesChunk(BaseModel):
|
|
69
|
-
index: int | None = None
|
|
70
|
-
logprobs: float | None = None
|
|
71
|
-
finish_reason: FinishReason | None = None
|
|
72
|
-
delta: DeltaContent | None = None
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class CompletionResponse(BaseModel):
|
|
76
|
-
# request id
|
|
77
|
-
id: str | None = None
|
|
78
|
-
# object type
|
|
79
|
-
object: ObjectType | None = None
|
|
80
|
-
# created timestamp
|
|
81
|
-
created: int | None = None
|
|
82
|
-
# model name
|
|
83
|
-
model: str | None = None
|
|
84
|
-
# choices list
|
|
85
|
-
choices: List[CompletionChoicesData] | None = None
|
|
86
|
-
# prompt list
|
|
87
|
-
prompt: List[PromptPart] | None = None
|
|
88
|
-
# token usage data
|
|
89
|
-
usage: UsageData | None = None
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class CompletionChunk(BaseModel):
|
|
93
|
-
# request id
|
|
94
|
-
id: str | None = None
|
|
95
|
-
# object type
|
|
96
|
-
object: ObjectType | None = None
|
|
97
|
-
# created timestamp
|
|
98
|
-
created: int | None = None
|
|
99
|
-
# model name
|
|
100
|
-
model: str | None = None
|
|
101
|
-
# choices list
|
|
102
|
-
choices: List[CompletionChoicesChunk] | None = None
|
|
103
|
-
# token usage data
|
|
104
|
-
usage: UsageData | None = None
|
together/types/embeddings.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import List, Literal
|
|
4
|
-
|
|
5
|
-
from together.types.abstract import BaseModel
|
|
6
|
-
from together.types.common import (
|
|
7
|
-
ObjectType,
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class EmbeddingRequest(BaseModel):
|
|
12
|
-
# input or list of inputs
|
|
13
|
-
input: str | List[str]
|
|
14
|
-
# model to query
|
|
15
|
-
model: str
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class EmbeddingChoicesData(BaseModel):
|
|
19
|
-
# response index
|
|
20
|
-
index: int
|
|
21
|
-
# object type
|
|
22
|
-
object: ObjectType
|
|
23
|
-
# embedding response
|
|
24
|
-
embedding: List[float] | None = None
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class EmbeddingResponse(BaseModel):
|
|
28
|
-
# job id
|
|
29
|
-
id: str | None = None
|
|
30
|
-
# query model
|
|
31
|
-
model: str | None = None
|
|
32
|
-
# object type
|
|
33
|
-
object: Literal["list"] | None = None
|
|
34
|
-
# list of embedding choices
|
|
35
|
-
data: List[EmbeddingChoicesData] | None = None
|
together/types/error.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from pydantic import Field
|
|
4
|
-
|
|
5
|
-
from together.types.abstract import BaseModel
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class TogetherErrorResponse(BaseModel):
|
|
9
|
-
# error message
|
|
10
|
-
message: str | None = None
|
|
11
|
-
# error type
|
|
12
|
-
type_: str | None = Field(None, alias="type")
|
|
13
|
-
# param causing error
|
|
14
|
-
param: str | None = None
|
|
15
|
-
# error code
|
|
16
|
-
code: str | None = None
|
together/types/files.py
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from enum import Enum
|
|
4
|
-
from typing import List, Literal
|
|
5
|
-
|
|
6
|
-
from pydantic import Field
|
|
7
|
-
|
|
8
|
-
from together.types.abstract import BaseModel
|
|
9
|
-
from together.types.common import (
|
|
10
|
-
ObjectType,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class FilePurpose(str, Enum):
|
|
15
|
-
FineTune = "fine-tune"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class FileType(str, Enum):
|
|
19
|
-
jsonl = "jsonl"
|
|
20
|
-
parquet = "parquet"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class FileRequest(BaseModel):
|
|
24
|
-
"""
|
|
25
|
-
Files request type
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
# training file ID
|
|
29
|
-
training_file: str
|
|
30
|
-
# base model string
|
|
31
|
-
model: str
|
|
32
|
-
# number of epochs to train for
|
|
33
|
-
n_epochs: int
|
|
34
|
-
# training learning rate
|
|
35
|
-
learning_rate: float
|
|
36
|
-
# number of checkpoints to save
|
|
37
|
-
n_checkpoints: int | None = None
|
|
38
|
-
# training batch size
|
|
39
|
-
batch_size: int | None = None
|
|
40
|
-
# up to 40 character suffix for output model name
|
|
41
|
-
suffix: str | None = None
|
|
42
|
-
# weights & biases api key
|
|
43
|
-
wandb_api_key: str | None = None
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class FileResponse(BaseModel):
|
|
47
|
-
"""
|
|
48
|
-
Files API response type
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
id: str
|
|
52
|
-
object: Literal[ObjectType.File]
|
|
53
|
-
# created timestamp
|
|
54
|
-
created_at: int | None = None
|
|
55
|
-
type: FileType | None = None
|
|
56
|
-
purpose: FilePurpose | None = None
|
|
57
|
-
filename: str | None = None
|
|
58
|
-
# file byte size
|
|
59
|
-
bytes: int | None = None
|
|
60
|
-
# JSONL line count
|
|
61
|
-
line_count: int | None = Field(None, alias="LineCount")
|
|
62
|
-
processed: bool | None = Field(None, alias="Processed")
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class FileList(BaseModel):
|
|
66
|
-
# object type
|
|
67
|
-
object: Literal["list"] | None = None
|
|
68
|
-
# list of fine-tune job objects
|
|
69
|
-
data: List[FileResponse] | None = None
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
class FileDeleteResponse(BaseModel):
|
|
73
|
-
# file id
|
|
74
|
-
id: str
|
|
75
|
-
# object type
|
|
76
|
-
object: Literal[ObjectType.File]
|
|
77
|
-
# is deleted
|
|
78
|
-
deleted: bool
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
class FileObject(BaseModel):
|
|
82
|
-
# object type
|
|
83
|
-
object: Literal["local"] | None = None
|
|
84
|
-
# fine-tune job id
|
|
85
|
-
id: str | None = None
|
|
86
|
-
# local path filename
|
|
87
|
-
filename: str | None = None
|
|
88
|
-
# size in bytes
|
|
89
|
-
size: int | None = None
|