Skip to content

Commit 047a427

Browse files
release: 0.38.0 (#212)
* codegen metadata * codegen metadata * codegen metadata * fix(client): avoid removing abort listener too early * codegen metadata * chore: Update descriptions for jig queue methods and properties * codegen metadata * chore(internal): avoid type checking errors with ts-reset * codegen metadata * feat: Update descriptions for endpoints * chore: Fix various docstrings * chore(internal/client): fix form-urlencoded requests * chore: Remove broken field LineCount from FileResponse * codegen metadata * chore: configure new SDK language * chore: Revert adding mcp code. Code additions were unexpected. * chore: update mock server docs * fix(internal): skip tests that depend on mock server * fix(docs/contributing): correct pnpm link command * codegen metadata * chore(internal): move stringifyQuery implementation to internal function * feat: update deployments schemas to include volume versions * feat: Add typing for completion responses related to logprobs * feat: Change TrainingType default to null * feat: Add wandb_entity argument to OpenAPI definition * feat: Update training type for price estimation too * feat: Another try * fix: fix request delays for retrying to be more respectful of high requested delays * chore(test): do not count install time for mock server timeout * feat: Add FT models supported and limits * codegen metadata * chore(ci): skip uploading artifacts on stainless-internal branches * chore: update placeholder string * fix(client): preserve URL params already embedded in path * chore(internal): update dependencies to address dependabot vulnerabilities * fix: fixed autoscaling configs in deployments api * codegen metadata * feat: Update llama 3.1 8b w/ qwen 3.5 9b * chore(internal): tweak CI branches * fix(types): change model to string in chat completions * codegen metadata * feat(api): manual updates * feat(api): manual updates * feat(api): manual updates * chore: Fix broken lint (#213) * release: 0.38.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
1 parent d2dea90 commit 047a427

50 files changed

Lines changed: 964 additions & 380 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: CI
22
on:
33
push:
4-
branches-ignore:
5-
- 'generated'
6-
- 'codegen/**'
7-
- 'integrated/**'
8-
- 'stl-preview-head/**'
9-
- 'stl-preview-base/**'
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
1012
pull_request:
1113
branches-ignore:
1214
- 'stl-preview-head/**'
@@ -55,14 +57,18 @@ jobs:
5557
run: ./scripts/build
5658

5759
- name: Get GitHub OIDC Token
58-
if: github.repository == 'stainless-sdks/togetherai-typescript'
60+
if: |-
61+
github.repository == 'stainless-sdks/togetherai-typescript' &&
62+
!startsWith(github.ref, 'refs/heads/stl/')
5963
id: github-oidc
6064
uses: actions/github-script@v8
6165
with:
6266
script: core.setOutput('github_token', await core.getIDToken());
6367

6468
- name: Upload tarball
65-
if: github.repository == 'stainless-sdks/togetherai-typescript'
69+
if: |-
70+
github.repository == 'stainless-sdks/togetherai-typescript' &&
71+
!startsWith(github.ref, 'refs/heads/stl/')
6672
env:
6773
URL: https://pkg.stainless.com/s
6874
AUTH: ${{ steps.github-oidc.outputs.github_token }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.37.0"
2+
".": "0.38.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-dc45695614158674dec4da8ae843a7564905f24d2ce577e8e6e5246b4a7b0f61.yml
3-
openapi_spec_hash: 46a91a84c8c270792676ee863b33ab99
4-
config_hash: 67b76d1064bef2e591cadf50de08ad19
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-31893d157d3c85caa1d8615b73a5fa431ea2cc126bd2410e0f84f3defd5c7dec.yml
3+
openapi_spec_hash: b652a4d504b4a3dbf585ab803b0f59fc
4+
config_hash: 52d213100a0ca1a4b2cdcd2718936b51

CHANGELOG.md

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

3+
## 0.38.0 (2026-03-18)
4+
5+
Full Changelog: [v0.37.0...v0.38.0](https://github.com/togethercomputer/together-typescript/compare/v0.37.0...v0.38.0)
6+
7+
### Features
8+
9+
* Add FT models supported and limits ([eb83352](https://github.com/togethercomputer/together-typescript/commit/eb83352895441dd6c7b14815bc56fa703bb21cb5))
10+
* Add typing for completion responses related to logprobs ([7be3686](https://github.com/togethercomputer/together-typescript/commit/7be368608be937b1d212c285b4cfd7e3650c4213))
11+
* Add wandb_entity argument to OpenAPI definition ([71e55a9](https://github.com/togethercomputer/together-typescript/commit/71e55a9852f68f467f210f858ef509888db9abed))
12+
* Another try ([d59291f](https://github.com/togethercomputer/together-typescript/commit/d59291f9f6a185443214c1da6c333400b5c9a997))
13+
* **api:** manual updates ([9fe1286](https://github.com/togethercomputer/together-typescript/commit/9fe1286feb663510d56245890237e0b618836be4))
14+
* **api:** manual updates ([eb817bf](https://github.com/togethercomputer/together-typescript/commit/eb817bfbe1034925f5cf6f590fd6b9bc4f5fce51))
15+
* **api:** manual updates ([206ba6d](https://github.com/togethercomputer/together-typescript/commit/206ba6dcc63ec4f638e99b71a65b34d4b4ba7b3c))
16+
* Change TrainingType default to null ([cb4bdcb](https://github.com/togethercomputer/together-typescript/commit/cb4bdcb2cf4ed3d22d3b0e50135af1b8c80d6218))
17+
* update deployments schemas to include volume versions ([1d3a34e](https://github.com/togethercomputer/together-typescript/commit/1d3a34efef57808b89b16ab39791f53380163385))
18+
* Update descriptions for endpoints ([e7a8aaf](https://github.com/togethercomputer/together-typescript/commit/e7a8aafed811633b2a1c2c19df41fb43fd48ae89))
19+
* Update llama 3.1 8b w/ qwen 3.5 9b ([5bd7444](https://github.com/togethercomputer/together-typescript/commit/5bd744484f4c626865c71e7046078077b2ea5c8f))
20+
* Update training type for price estimation too ([52c3b77](https://github.com/togethercomputer/together-typescript/commit/52c3b77ff92751cbd788820ec20b195f040d9d16))
21+
22+
23+
### Bug Fixes
24+
25+
* **client:** avoid removing abort listener too early ([1376258](https://github.com/togethercomputer/together-typescript/commit/137625849136205dc82f3b2493c96709365933ba))
26+
* **client:** preserve URL params already embedded in path ([940974d](https://github.com/togethercomputer/together-typescript/commit/940974d0043587773a3e294c7744ace2008201d9))
27+
* **docs/contributing:** correct pnpm link command ([eab2b6e](https://github.com/togethercomputer/together-typescript/commit/eab2b6e70c14fd53c4913fdaa0d2c51cc42a3e3b))
28+
* fix request delays for retrying to be more respectful of high requested delays ([11669ff](https://github.com/togethercomputer/together-typescript/commit/11669ff27aa05901764cfb300dc33927da4002c7))
29+
* fixed autoscaling configs in deployments api ([4dac51b](https://github.com/togethercomputer/together-typescript/commit/4dac51ba4914f36a26c93f418ffdfa8e12cbf678))
30+
* **internal:** skip tests that depend on mock server ([be7e0e7](https://github.com/togethercomputer/together-typescript/commit/be7e0e717e129fcdca13570d5967d61d8107240f))
31+
* **types:** change model to string in chat completions ([91a8c77](https://github.com/togethercomputer/together-typescript/commit/91a8c775d68930dd539bcce1b059274ae8f91863))
32+
33+
34+
### Chores
35+
36+
* **ci:** skip uploading artifacts on stainless-internal branches ([603c86c](https://github.com/togethercomputer/together-typescript/commit/603c86c65a947e54c0998d5c10c1d4f6489f7f96))
37+
* configure new SDK language ([b6f30b6](https://github.com/togethercomputer/together-typescript/commit/b6f30b6587c51483d7aace93a19350d4acb22061))
38+
* Fix broken lint ([#213](https://github.com/togethercomputer/together-typescript/issues/213)) ([2463a75](https://github.com/togethercomputer/together-typescript/commit/2463a75429bc924bec67a7cf6eb0ef6a8b5fa87b))
39+
* Fix various docstrings ([af4c47f](https://github.com/togethercomputer/together-typescript/commit/af4c47fab26f6ad7599866d2facd2075dfb7f7d7))
40+
* **internal/client:** fix form-urlencoded requests ([d73f69f](https://github.com/togethercomputer/together-typescript/commit/d73f69fb0a280ad9d2c1f15da25d3695ff9c55c7))
41+
* **internal:** avoid type checking errors with ts-reset ([70ad44b](https://github.com/togethercomputer/together-typescript/commit/70ad44b46220b19de3a0def616593e2382bda8dd))
42+
* **internal:** move stringifyQuery implementation to internal function ([54dc83f](https://github.com/togethercomputer/together-typescript/commit/54dc83f02b0df002689776dd098bffbb06299934))
43+
* **internal:** tweak CI branches ([e8d66c5](https://github.com/togethercomputer/together-typescript/commit/e8d66c54b571a1ca83473b00368c25e9d45a537e))
44+
* **internal:** update dependencies to address dependabot vulnerabilities ([e442dfd](https://github.com/togethercomputer/together-typescript/commit/e442dfd169a1809ea915f60d38ec80b2e22e86b9))
45+
* Remove broken field LineCount from FileResponse ([a0c187e](https://github.com/togethercomputer/together-typescript/commit/a0c187e9ae89232655f4e29e82ed08778fa70294))
46+
* Revert adding mcp code. Code additions were unexpected. ([bb39360](https://github.com/togethercomputer/together-typescript/commit/bb39360b1f1815afa03cd59aec365c76f6fa6bf0))
47+
* **test:** do not count install time for mock server timeout ([4f232bf](https://github.com/togethercomputer/together-typescript/commit/4f232bf81907963b78e8bd94b19dbcfa25929954))
48+
* Update descriptions for jig queue methods and properties ([7fdfcca](https://github.com/togethercomputer/together-typescript/commit/7fdfcca72618b3ea51d38ac01f91e6a08ad0863e))
49+
* update mock server docs ([ac14bf7](https://github.com/togethercomputer/together-typescript/commit/ac14bf741e8980c297b657f886d8ea0a88c15dcc))
50+
* update placeholder string ([e481cda](https://github.com/togethercomputer/together-typescript/commit/e481cda9fffbd1ed5ec89a8f9e61258fefef2ac5))
51+
352
## 0.37.0 (2026-02-04)
453

554
Full Changelog: [v0.36.1...v0.37.0](https://github.com/togethercomputer/together-typescript/compare/v0.36.1...v0.37.0)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ $ yarn link together-ai
6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -global together-ai
63+
$ pnpm link --global together-ai
6464
```
6565

6666
## Running tests
6767

6868
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
6969

7070
```sh
71-
$ npx prism mock path/to/your/openapi.yml
71+
$ ./scripts/mock
7272
```
7373

7474
```sh

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Types:
109109
- <code><a href="./src/resources/chat/completions.ts">ChatCompletion</a></code>
110110
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionAssistantMessageParam</a></code>
111111
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionChunk</a></code>
112+
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionPrompt</a></code>
112113
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionFunctionMessageParam</a></code>
113114
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionMessage</a></code>
114115
- <code><a href="./src/resources/chat/completions.ts">ChatCompletionMessageParam</a></code>
@@ -154,7 +155,6 @@ Methods:
154155
Types:
155156

156157
- <code><a href="./src/resources/files.ts">FileList</a></code>
157-
- <code><a href="./src/resources/files.ts">FileObject</a></code>
158158
- <code><a href="./src/resources/files.ts">FilePurpose</a></code>
159159
- <code><a href="./src/resources/files.ts">FileResponse</a></code>
160160
- <code><a href="./src/resources/files.ts">FileType</a></code>

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "together-ai",
3-
"version": "0.37.0",
3+
"version": "0.38.0",
44
"description": "The official TypeScript library for the Together API",
55
"author": "Together <dev-feedback@TogetherAI.com>",
66
"types": "dist/index.d.ts",
@@ -54,6 +54,17 @@
5454
"bin": {
5555
"together-ai": "bin/cli"
5656
},
57+
"overrides": {
58+
"minimatch": "^9.0.5"
59+
},
60+
"pnpm": {
61+
"overrides": {
62+
"minimatch": "^9.0.5"
63+
}
64+
},
65+
"resolutions": {
66+
"minimatch": "^9.0.5"
67+
},
5768
"exports": {
5869
".": {
5970
"import": "./dist/index.mjs",

scripts/mock

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}"
2121

2222
# Run prism mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24+
# Pre-install the package so the download doesn't eat into the startup timeout
25+
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version
26+
2427
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
2528

26-
# Wait for server to come online
29+
# Wait for server to come online (max 30s)
2730
echo -n "Waiting for server"
31+
attempts=0
2832
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
33+
attempts=$((attempts + 1))
34+
if [ "$attempts" -ge 300 ]; then
35+
echo
36+
echo "Timed out waiting for Prism server to start"
37+
cat .prism.log
38+
exit 1
39+
fi
2940
echo -n "."
3041
sleep 0.1
3142
done

src/client.ts

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type { APIResponseProps } from './internal/parse';
1111
import { getPlatformHeaders } from './internal/detect-platform';
1212
import * as Shims from './internal/shims';
1313
import * as Opts from './internal/request-options';
14+
import { stringifyQuery } from './internal/utils/query';
1415
import { VERSION } from './version';
1516
import * as Errors from './core/error';
1617
import * as Uploads from './core/uploads';
@@ -56,15 +57,7 @@ import {
5657
Evals,
5758
EvaluationJob,
5859
} from './resources/evals';
59-
import {
60-
FileDeleteResponse,
61-
FileList,
62-
FileObject,
63-
FilePurpose,
64-
FileResponse,
65-
FileType,
66-
Files,
67-
} from './resources/files';
60+
import { FileDeleteResponse, FileList, FilePurpose, FileResponse, FileType, Files } from './resources/files';
6861
import {
6962
FineTuning,
7063
FineTuningCancelResponse,
@@ -297,21 +290,8 @@ export class Together {
297290
/**
298291
* Basic re-implementation of `qs.stringify` for primitive types.
299292
*/
300-
protected stringifyQuery(query: Record<string, unknown>): string {
301-
return Object.entries(query)
302-
.filter(([_, value]) => typeof value !== 'undefined')
303-
.map(([key, value]) => {
304-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
305-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
306-
}
307-
if (value === null) {
308-
return `${encodeURIComponent(key)}=`;
309-
}
310-
throw new Errors.TogetherError(
311-
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
312-
);
313-
})
314-
.join('&');
293+
protected stringifyQuery(query: object | Record<string, unknown>): string {
294+
return stringifyQuery(query);
315295
}
316296

317297
private getUserAgent(): string {
@@ -343,12 +323,13 @@ export class Together {
343323
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
344324

345325
const defaultQuery = this.defaultQuery();
346-
if (!isEmptyObj(defaultQuery)) {
347-
query = { ...defaultQuery, ...query };
326+
const pathQuery = Object.fromEntries(url.searchParams);
327+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
328+
query = { ...pathQuery, ...defaultQuery, ...query };
348329
}
349330

350331
if (typeof query === 'object' && query && !Array.isArray(query)) {
351-
url.search = this.stringifyQuery(query as Record<string, unknown>);
332+
url.search = this.stringifyQuery(query);
352333
}
353334

354335
return url.toString();
@@ -532,7 +513,7 @@ export class Together {
532513
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
533514

534515
const errText = await response.text().catch((err: any) => castToError(err).message);
535-
const errJSON = safeJSON(errText);
516+
const errJSON = safeJSON(errText) as any;
536517
const errMessage = errJSON ? undefined : errText;
537518

538519
loggerFor(this).debug(
@@ -599,7 +580,6 @@ export class Together {
599580
return await this.fetch.call(undefined, url, fetchOptions);
600581
} finally {
601582
clearTimeout(timeout);
602-
if (signal) signal.removeEventListener('abort', abort);
603583
}
604584
}
605585

@@ -655,9 +635,9 @@ export class Together {
655635
}
656636
}
657637

658-
// If the API asks us to wait a certain amount of time (and it's a reasonable amount),
659-
// just do what it says, but otherwise calculate a default
660-
if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
638+
// If the API asks us to wait a certain amount of time, just do what it
639+
// says, but otherwise calculate a default
640+
if (timeoutMillis === undefined) {
661641
const maxRetries = options.maxRetries ?? this.maxRetries;
662642
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
663643
}
@@ -783,6 +763,14 @@ export class Together {
783763
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
784764
) {
785765
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
766+
} else if (
767+
typeof body === 'object' &&
768+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
769+
) {
770+
return {
771+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
772+
body: this.stringifyQuery(body),
773+
};
786774
} else {
787775
return this.#encoder({ body, headers });
788776
}
@@ -868,7 +856,6 @@ export declare namespace Together {
868856
export {
869857
Files as Files,
870858
type FileList as FileList,
871-
type FileObject as FileObject,
872859
type FilePurpose as FilePurpose,
873860
type FileResponse as FileResponse,
874861
type FileType as FileType,

src/core/streaming.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class Stream<Item> implements AsyncIterable<Item> {
5858
let data;
5959

6060
try {
61-
data = JSON.parse(sse.data);
61+
data = JSON.parse(sse.data) as any;
6262
} catch (e) {
6363
logger.error(`Could not parse message into JSON:`, sse.data);
6464
logger.error(`From chunk:`, sse.raw);
@@ -121,7 +121,7 @@ export class Stream<Item> implements AsyncIterable<Item> {
121121
try {
122122
for await (const line of iterLines()) {
123123
if (done) continue;
124-
if (line) yield JSON.parse(line);
124+
if (line) yield JSON.parse(line) as Item;
125125
}
126126
done = true;
127127
} catch (e) {

0 commit comments

Comments
 (0)