Skip to content

Commit 789d9a4

Browse files
Merge pull request #348 from togethercomputer/release-please--branches--main--changes--next
release: 2.12.0
2 parents d71f692 + 307ff11 commit 789d9a4

56 files changed

Lines changed: 666 additions & 432 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.11.0"
2+
".": "2.12.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 75
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-19148ebeed55db4be0c1c60d31c81306386c4c71a2aee8d1eeac8ebfa15c1168.yml
3-
openapi_spec_hash: 747224d60adf1ab51760e5752ce1b846
4-
config_hash: 279a64a8df3e6dba241bfa1e18a04f69
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai/togetherai-e1200616b1a93d40e478800d2c9e06ddeb10b508f2a9aa65810ee31878ba4f23.yml
3+
openapi_spec_hash: 23245993d115722da1b697f10799f4f1
4+
config_hash: 6c214c91fad5ead4849be777fd9e8108

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# Changelog
22

3+
## 2.12.0 (2026-05-01)
4+
5+
Full Changelog: [v2.11.0...v2.12.0](https://github.com/togethercomputer/together-py/compare/v2.11.0...v2.12.0)
6+
7+
### Features
8+
9+
* Add default retrieve handler when passing an id to commands ([#345](https://github.com/togethercomputer/together-py/issues/345)) ([984519c](https://github.com/togethercomputer/together-py/commit/984519c038d4b99a794b5665c5c74b7c22f8802c))
10+
* add the pronunciation dict ([f59d672](https://github.com/togethercomputer/together-py/commit/f59d672d1f26abc9b4ad6216209b6d6707cfa88b))
11+
* **api:** add cached_input field to Pricing model ([c03fb18](https://github.com/togethercomputer/together-py/commit/c03fb180dc52531e4c99ebcd2a2ca8acea81dc9b))
12+
* **api:** Update server url to .ai ([2ea6a2d](https://github.com/togethercomputer/together-py/commit/2ea6a2d9201373c8959b4c34749236183a785543))
13+
* ENG-87042: clarify TTS language parameter supports lowercase locales ([95cf65b](https://github.com/togethercomputer/together-py/commit/95cf65b30233791b1e73f823a3cb0e6cdb731ab4))
14+
* ENG-87042: document language on TTS WebSocket and simplify locale note ([14b429f](https://github.com/togethercomputer/together-py/commit/14b429f0e08c8ad9eba4ffb51ba6d8d95d35973d))
15+
* MOSH-2181: Add default note on max-seq-length ([b1edd58](https://github.com/togethercomputer/together-py/commit/b1edd58f1bc7ccc2f3b1016ac5d09eaf2fad16b3))
16+
* Show cache input token pricing in models list cli output ([#350](https://github.com/togethercomputer/together-py/issues/350)) ([1476f70](https://github.com/togethercomputer/together-py/commit/1476f709115b23e6ca08468c4b0ca6e72553d967))
17+
18+
19+
### Bug Fixes
20+
21+
* Properly handle unlinking temp file during fine-tuning download ([#352](https://github.com/togethercomputer/together-py/issues/352)) ([2f1c458](https://github.com/togethercomputer/together-py/commit/2f1c458ee388a14757c50b077e8402c0a063fe01))
22+
* **types:** remove eval-sample, eval-output, eval-summary, batch-generated from FilePurpose ([ea1d61a](https://github.com/togethercomputer/together-py/commit/ea1d61a182cad4f11f0e123a23381284f61b2153))
23+
24+
25+
### Chores
26+
27+
* Improve --json support accross multiple commands ([#347](https://github.com/togethercomputer/together-py/issues/347)) ([949bfa4](https://github.com/togethercomputer/together-py/commit/949bfa4514e34b761727622fab3d345e940a7fe9))
28+
* **internal:** reformat pyproject.toml ([a52e64b](https://github.com/togethercomputer/together-py/commit/a52e64bde79ccfe3f06c9d4a59af5e736889e412))
29+
* Pass agent name in request headers when detected ([#351](https://github.com/togethercomputer/together-py/issues/351)) ([1668cf4](https://github.com/togethercomputer/together-py/commit/1668cf4208e4c32c7ee91a6978b708bc8c4c8256))
30+
* Update references from .xyz to .ai domain ([#349](https://github.com/togethercomputer/together-py/issues/349)) ([0c33450](https://github.com/togethercomputer/together-py/commit/0c334506cfb7f56a7cc8fb0bba4c4b89aed0b408))
31+
32+
33+
### Documentation
34+
35+
* polish CLI help text; introduce Options + Global Options panels ([#346](https://github.com/togethercomputer/together-py/issues/346)) ([4905c1a](https://github.com/togethercomputer/together-py/commit/4905c1ac807de4b317639524720592d51b1d23f9))
36+
337
## 2.11.0 (2026-04-28)
438

539
Full Changelog: [v2.10.0...v2.11.0](https://github.com/togethercomputer/together-py/compare/v2.10.0...v2.11.0)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "together"
3-
version = "2.11.0"
3+
version = "2.12.0"
44
description = "The official Python library for the together API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -177,7 +177,7 @@ show_error_codes = true
177177
#
178178
# We also exclude our `tests` as mypy doesn't always infer
179179
# types correctly and Pyright will still catch any type errors.
180-
exclude = ['src/together/_files.py', '_dev/.*.py', 'tests/.*']
180+
exclude = ["src/together/_files.py", "_dev/.*.py", "tests/.*"]
181181

182182
strict_equality = true
183183
implicit_reexport = true

src/together/_base_client.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import pydantic
3939
from httpx import URL
4040
from pydantic import PrivateAttr
41+
from detect_agent import determine_agent
4142

4243
from . import _exceptions
4344
from ._qs import Querystring
@@ -675,6 +676,7 @@ def default_headers(self) -> dict[str, str | Omit]:
675676
"Content-Type": "application/json",
676677
"User-Agent": self.user_agent,
677678
**self.platform_headers(),
679+
**self.agent_headers(),
678680
**self.auth_headers,
679681
**self._custom_headers,
680682
}
@@ -714,6 +716,12 @@ def platform_headers(self) -> Dict[str, str]:
714716
# https://github.com/python/cpython/issues/88476
715717
return platform_headers(self._version, platform=self._platform)
716718

719+
def agent_headers(self) -> dict[str, str]:
720+
# the actual implementation is in a separate `lru_cache` decorated
721+
# function because adding `lru_cache` to methods will leak memory
722+
# https://github.com/python/cpython/issues/88476
723+
return agent_headers()
724+
717725
def _parse_retry_after_header(self, response_headers: Optional[httpx.Headers] = None) -> float | None:
718726
"""Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified.
719727
@@ -2055,6 +2063,15 @@ def get_platform() -> Platform:
20552063
return "Unknown"
20562064

20572065

2066+
@lru_cache(maxsize=None)
2067+
def agent_headers() -> dict[str, str]:
2068+
agent = determine_agent()
2069+
if agent["is_agent"] and agent["agent"]:
2070+
return {"X-Stainless-Agent": agent["agent"]["name"]}
2071+
2072+
return {}
2073+
2074+
20582075
@lru_cache(maxsize=None)
20592076
def platform_headers(version: str, *, platform: Platform | None) -> Dict[str, str]:
20602077
return {

src/together/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __init__(
128128
base_url = os.environ.get("TOGETHER_BASE_URL")
129129
self._base_url_overridden = base_url is not None
130130
if base_url is None:
131-
base_url = f"https://api.together.xyz/v1"
131+
base_url = f"https://api.together.ai/v1"
132132

133133
custom_headers_env = os.environ.get("TOGETHER_CUSTOM_HEADERS")
134134
if custom_headers_env is not None:
@@ -402,7 +402,7 @@ def __init__(
402402
base_url = os.environ.get("TOGETHER_BASE_URL")
403403
self._base_url_overridden = base_url is not None
404404
if base_url is None:
405-
base_url = f"https://api.together.xyz/v1"
405+
base_url = f"https://api.together.ai/v1"
406406

407407
custom_headers_env = os.environ.get("TOGETHER_CUSTOM_HEADERS")
408408
if custom_headers_env is not None:

src/together/_version.py

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

33
__title__ = "together"
4-
__version__ = "2.11.0" # x-release-please-version
4+
__version__ = "2.12.0" # x-release-please-version

src/together/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
MAX_CONNECTION_RETRIES = 2
3232
MAX_RETRIES = DEFAULT_MAX_RETRIES
3333

34-
BASE_URL = "https://api.together.xyz/v1"
34+
BASE_URL = "https://api.together.ai/v1"

0 commit comments

Comments
 (0)