Skip to content

Commit e677e60

Browse files
authored
chore: Minimize breaking changes on common import paths and alias names (#206)
1 parent 92ce60d commit e677e60

File tree

9 files changed

+111
-2
lines changed

9 files changed

+111
-2
lines changed

src/together/constants.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Manually added to minimize breaking changes from V1
2+
from ._constants import (
3+
MAX_RETRY_DELAY as MAX_RETRY_DELAY,
4+
DEFAULT_MAX_RETRIES,
5+
INITIAL_RETRY_DELAY as INITIAL_RETRY_DELAY,
6+
)
7+
from .lib.constants import (
8+
MIN_SAMPLES as MIN_SAMPLES,
9+
DISABLE_TQDM as DISABLE_TQDM,
10+
MAX_IMAGE_BYTES as MAX_IMAGE_BYTES,
11+
NUM_BYTES_IN_GB as NUM_BYTES_IN_GB,
12+
MAX_FILE_SIZE_GB as MAX_FILE_SIZE_GB,
13+
MIN_PART_SIZE_MB as MIN_PART_SIZE_MB,
14+
DOWNLOAD_BLOCK_SIZE as DOWNLOAD_BLOCK_SIZE,
15+
MAX_MULTIPART_PARTS as MAX_MULTIPART_PARTS,
16+
TARGET_PART_SIZE_MB as TARGET_PART_SIZE_MB,
17+
MAX_CONCURRENT_PARTS as MAX_CONCURRENT_PARTS,
18+
MAX_IMAGES_PER_EXAMPLE as MAX_IMAGES_PER_EXAMPLE,
19+
MULTIPART_THRESHOLD_GB as MULTIPART_THRESHOLD_GB,
20+
MAX_BASE64_IMAGE_LENGTH as MAX_BASE64_IMAGE_LENGTH,
21+
MULTIPART_UPLOAD_TIMEOUT as MULTIPART_UPLOAD_TIMEOUT,
22+
PARQUET_EXPECTED_COLUMNS as PARQUET_EXPECTED_COLUMNS,
23+
REQUIRED_COLUMNS_MESSAGE as REQUIRED_COLUMNS_MESSAGE,
24+
JSONL_REQUIRED_COLUMNS_MAP as JSONL_REQUIRED_COLUMNS_MAP,
25+
POSSIBLE_ROLES_CONVERSATION as POSSIBLE_ROLES_CONVERSATION,
26+
DatasetFormat as DatasetFormat,
27+
)
28+
29+
TIMEOUT_SECS = 600
30+
MAX_SESSION_LIFETIME_SECS = 180
31+
MAX_CONNECTION_RETRIES = 2
32+
MAX_RETRIES = DEFAULT_MAX_RETRIES
33+
34+
BASE_URL = "https://api.together.xyz/v1"

src/together/error.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# Manually added to minimize breaking changes from V1
3+
from ._exceptions import (
4+
APIError as APIError,
5+
RateLimitError as RateLimitError,
6+
APITimeoutError,
7+
BadRequestError,
8+
APIConnectionError as APIConnectionError,
9+
AuthenticationError as AuthenticationError,
10+
APIResponseValidationError,
11+
)
12+
13+
Timeout = APITimeoutError
14+
InvalidRequestError = BadRequestError
15+
TogetherException = APIError
16+
ResponseError = APIResponseValidationError

src/together/types/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from __future__ import annotations
3+
from __future__ import annotations # noqa
44

55
from .batch_job import BatchJob as BatchJob
66
from .embedding import Embedding as Embedding
@@ -75,3 +75,14 @@
7575
from .fine_tuning_list_checkpoints_response import (
7676
FineTuningListCheckpointsResponse as FineTuningListCheckpointsResponse,
7777
)
78+
79+
# Manually added to minimize breaking changes from V1
80+
from .chat.chat_completion import ChatCompletion
81+
from .chat.chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk
82+
from .chat.chat_completion_usage import ChatCompletionUsage
83+
UsageData = ChatCompletionUsage
84+
ChatCompletionResponse = ChatCompletion
85+
CompletionResponse = Completion
86+
ListEndpoint = EndpointListResponse
87+
ImageRequest = ImageGenerateParams
88+
ImageResponse = ImageFile
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Manually added to minimize breaking changes from V1
2+
from .tool_choice import ToolChoice
3+
from .chat.chat_completion import ChatCompletion
4+
from .chat.chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk
5+
6+
ChatCompletionResponse = ChatCompletion
7+
ToolCalls = ToolChoice

src/together/types/endpoints.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Manually added to minimize breaking changes from V1
2+
from together.types import DedicatedEndpoint as DedicatedEndpoint
3+
4+
ListEndpoint = DedicatedEndpoint

src/together/types/files.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Manually added to minimize breaking changes from V1
2+
from . import (
3+
FileList as FileList,
4+
FileType as FileType,
5+
FilePurpose as FilePurpose,
6+
FileResponse as FileResponse,
7+
FileDeleteResponse as FileDeleteResponse,
8+
)

src/together/types/finetune.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Manually added to minimize breaking changes from V1
2+
from ..lib.types.fine_tuning import (
3+
COMPLETED_STATUSES as COMPLETED_STATUSES,
4+
TrainingType as TrainingType,
5+
FinetuneEvent as FinetuneEvent,
6+
TrainingMethod as TrainingMethod,
7+
FinetuneRequest as FinetuneRequest,
8+
EmptyLRScheduler as EmptyLRScheduler,
9+
FinetuneProgress as FinetuneProgress,
10+
FinetuneResponse as FinetuneResponse,
11+
FullTrainingType as FullTrainingType,
12+
LoRATrainingType as LoRATrainingType,
13+
CosineLRScheduler as CosineLRScheduler,
14+
FinetuneEventType as FinetuneEventType,
15+
FinetuneJobStatus as FinetuneJobStatus,
16+
LinearLRScheduler as LinearLRScheduler,
17+
TrainingMethodDPO as TrainingMethodDPO,
18+
TrainingMethodSFT as TrainingMethodSFT,
19+
FinetuneEventLevels as FinetuneEventLevels,
20+
FinetuneLRScheduler as FinetuneLRScheduler,
21+
CosineLRSchedulerArgs as CosineLRSchedulerArgs,
22+
LinearLRSchedulerArgs as LinearLRSchedulerArgs,
23+
FinetuneTrainingLimits as FinetuneTrainingLimits,
24+
FinetuneMultimodalParams as FinetuneMultimodalParams,
25+
FinetuneFullTrainingLimits as FinetuneFullTrainingLimits,
26+
FinetuneLoraTrainingLimits as FinetuneLoraTrainingLimits,
27+
)

src/together/types/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Manually added to minimize breaking changes from V1
2+
from together.types import ModelObject as ModelObject

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)