Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f1839e8
chore(deps): update dependency @types/node to v20.17.58
stainless-app[bot] Aug 15, 2025
0282025
chore(internal): formatting change
stainless-app[bot] Aug 15, 2025
c768bb9
feat(mcp): add code execution tool
stainless-app[bot] Aug 19, 2025
72025f2
chore: add package to package.json
stainless-app[bot] Aug 21, 2025
a3ead04
codegen metadata
stainless-app[bot] Aug 21, 2025
a9f7b6f
chore(client): qualify global Blob
stainless-app[bot] Aug 21, 2025
99cae2f
chore: update CI script
stainless-app[bot] Aug 22, 2025
e53b252
chore(internal): update global Error reference
stainless-app[bot] Aug 28, 2025
ce742fc
feat(api): add evals api to config
stainless-app[bot] Aug 29, 2025
915a226
feat(api): api update
stainless-app[bot] Sep 2, 2025
a0085ed
codegen metadata
stainless-app[bot] Sep 4, 2025
0f37b32
chore: ci build action
stainless-app[bot] Sep 5, 2025
f6c7e43
fix: coerce nullable values to undefined
stainless-app[bot] Sep 8, 2025
15ba5cf
codegen metadata
stainless-app[bot] Sep 16, 2025
9a5bfb7
feat(api): api update
stainless-app[bot] Sep 17, 2025
b4c3c0a
feat(api): api update
stainless-app[bot] Sep 17, 2025
1050534
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 19, 2025
fa62f35
codegen metadata
stainless-app[bot] Sep 23, 2025
c25ec03
perf: faster formatting
stainless-app[bot] Sep 25, 2025
446dff9
chore(internal): remove deprecated `compilerOptions.baseUrl` from tsc…
stainless-app[bot] Sep 25, 2025
5a42924
chore(internal): fix incremental formatting in some cases
stainless-app[bot] Sep 26, 2025
0ca46c4
chore(internal): codegen related update
stainless-app[bot] Sep 26, 2025
5752a33
chore(internal): ignore .eslintcache
stainless-app[bot] Sep 26, 2025
b41b509
chore(internal): remove .eslintcache
stainless-app[bot] Oct 3, 2025
ef766cd
codegen metadata
stainless-app[bot] Oct 3, 2025
6b54b1d
chore(jsdoc): fix @link annotations to refer only to parts of the pac…
stainless-app[bot] Oct 3, 2025
246a904
chore(internal): use npm pack for build uploads
stainless-app[bot] Oct 6, 2025
437cce9
feat(api): api update
stainless-app[bot] Oct 8, 2025
24e7fc8
feat(api): api update
stainless-app[bot] Oct 10, 2025
b8dbe3d
release: 0.23.0
stainless-app[bot] Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.TOGETHER_NPM_TOKEN || secrets.NPM_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ dist
dist-deno
/*.tgz
.idea/
.eslintcache

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.22.0"
".": "0.23.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 35
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-f95d7f3aa4164abb82f5ba3a1ccc44105e9ce85c5d2bb8f0ac58f8ef18ffc254.yml
openapi_spec_hash: 0b0cac750868ea6ba74b338888169518
config_hash: 2887483246d24a361689cbd1258db7cf
configured_endpoints: 39
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-c726068d4924b141db32af3b6780cfdb4adf6201eb5b73cc48f22e85be84bd94.yml
openapi_spec_hash: 98eafd4bc6d118e15f1f59e0f7f5e18d
config_hash: e2d1be538fd1fb65bfc566a2a168cc16
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# Changelog

## 0.23.0 (2025-10-10)

Full Changelog: [v0.22.0...v0.23.0](https://github.com/togethercomputer/together-typescript/compare/v0.22.0...v0.23.0)

### Features

* **api:** add evals api to config ([ce742fc](https://github.com/togethercomputer/together-typescript/commit/ce742fcb4a95e99fa2c4e9f5c479e294d8dbfc98))
* **api:** api update ([24e7fc8](https://github.com/togethercomputer/together-typescript/commit/24e7fc8228a835369895d809f3690173d06091a6))
* **api:** api update ([437cce9](https://github.com/togethercomputer/together-typescript/commit/437cce9feb367ba4073ea619594a64ee1e2dfeed))
* **api:** api update ([b4c3c0a](https://github.com/togethercomputer/together-typescript/commit/b4c3c0a49f56f2e50e4d9d7e87a0a1db598a56ac))
* **api:** api update ([9a5bfb7](https://github.com/togethercomputer/together-typescript/commit/9a5bfb7d5eabb6f89d8981d46b50061baef28c51))
* **api:** api update ([915a226](https://github.com/togethercomputer/together-typescript/commit/915a226ad75264493a4e67917215a02fb3bae907))
* **mcp:** add code execution tool ([c768bb9](https://github.com/togethercomputer/together-typescript/commit/c768bb9a09001ef9955a3c899e4cfc2d588350f2))


### Bug Fixes

* coerce nullable values to undefined ([f6c7e43](https://github.com/togethercomputer/together-typescript/commit/f6c7e4344493e694fc9752ff48cb976633ead25b))


### Performance Improvements

* faster formatting ([c25ec03](https://github.com/togethercomputer/together-typescript/commit/c25ec03731097381b0a9584a94ff4fa6073fe6cc))


### Chores

* add package to package.json ([72025f2](https://github.com/togethercomputer/together-typescript/commit/72025f28d2156a530f5ad3c41723ee3cc8706426))
* ci build action ([0f37b32](https://github.com/togethercomputer/together-typescript/commit/0f37b32dbee4ad5a5f19a6bb894f92cb2f5c36f4))
* **client:** qualify global Blob ([a9f7b6f](https://github.com/togethercomputer/together-typescript/commit/a9f7b6f6b5634630ea1978a5e362e627df8825ca))
* **deps:** update dependency @types/node to v20.17.58 ([f1839e8](https://github.com/togethercomputer/together-typescript/commit/f1839e85f502ad68c680556340d240dab3b28bd9))
* do not install brew dependencies in ./scripts/bootstrap by default ([1050534](https://github.com/togethercomputer/together-typescript/commit/1050534f4ed0420d6aaa2598211f6f505169f5f0))
* **internal:** codegen related update ([0ca46c4](https://github.com/togethercomputer/together-typescript/commit/0ca46c46bd358a67847f46d013f519aa3ee91325))
* **internal:** fix incremental formatting in some cases ([5a42924](https://github.com/togethercomputer/together-typescript/commit/5a429243535a917a619c682f0e9e181f47b00e25))
* **internal:** formatting change ([0282025](https://github.com/togethercomputer/together-typescript/commit/02820255f3c707f9170d987cefb2a74124aabad3))
* **internal:** ignore .eslintcache ([5752a33](https://github.com/togethercomputer/together-typescript/commit/5752a3320d48e0708d63d07c3a0a3c265bd49b71))
* **internal:** remove .eslintcache ([b41b509](https://github.com/togethercomputer/together-typescript/commit/b41b5092d3273c4013342fa7f7baff1035ab6b99))
* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([446dff9](https://github.com/togethercomputer/together-typescript/commit/446dff9b819d895eaa4c8b71652dc268c8ef695e))
* **internal:** update global Error reference ([e53b252](https://github.com/togethercomputer/together-typescript/commit/e53b25217887ab211b03b93e2c09f3da4b20ef1e))
* **internal:** use npm pack for build uploads ([246a904](https://github.com/togethercomputer/together-typescript/commit/246a9049ff91bb85949e2f0c630b2ad3e684752a))
* **jsdoc:** fix [@link](https://github.com/link) annotations to refer only to parts of the package‘s public interface ([6b54b1d](https://github.com/togethercomputer/together-typescript/commit/6b54b1db48ede95e75def9c722059544fc108237))
* update CI script ([99cae2f](https://github.com/togethercomputer/together-typescript/commit/99cae2f05724e68687d6c704a5b29d31dd5fa11f))

## 0.22.0 (2025-08-13)

Full Changelog: [v0.21.1...v0.22.0](https://github.com/togethercomputer/together-typescript/compare/v0.21.1...v0.22.0)
Expand Down
1 change: 1 addition & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ This affects the following methods:

- `client.endpoints.list()`
- `client.hardware.list()`
- `client.evaluations.list()`

### Removed `httpAgent` in favor of `fetchOptions`

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const client = new Together({

const chatCompletion = await client.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test!' }],
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
});

console.log(chatCompletion.choices);
Expand All @@ -45,7 +45,7 @@ const client = new Together();

const stream = await client.chat.completions.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
stream: true,
});
for await (const chatCompletionChunk of stream) {
Expand All @@ -70,7 +70,7 @@ const client = new Together({

const params: Together.Chat.CompletionCreateParams = {
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
};
const chatCompletion: Together.Chat.ChatCompletion = await client.chat.completions.create(params);
```
Expand Down Expand Up @@ -137,7 +137,7 @@ a subclass of `APIError` will be thrown:
const chatCompletion = await client.chat.completions
.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
})
.catch(async (err) => {
if (err instanceof Together.APIError) {
Expand Down Expand Up @@ -179,7 +179,7 @@ const client = new Together({
});

// Or, configure per-request:
await client.chat.completions.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'mistralai/Mixtral-8x7B-Instruct-v0.1' }, {
await client.chat.completions.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo' }, {
maxRetries: 5,
});
```
Expand All @@ -196,7 +196,7 @@ const client = new Together({
});

// Override per-request:
await client.chat.completions.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'mistralai/Mixtral-8x7B-Instruct-v0.1' }, {
await client.chat.completions.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo' }, {
timeout: 5 * 1000,
});
```
Expand All @@ -222,7 +222,7 @@ const client = new Together();
const response = await client.chat.completions
.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
})
.asResponse();
console.log(response.headers.get('X-My-Header'));
Expand All @@ -231,7 +231,7 @@ console.log(response.statusText); // access the underlying Response object
const { data: chatCompletion, response: raw } = await client.chat.completions
.create({
messages: [{ role: 'user', content: 'Say this is a test' }],
model: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
})
.withResponse();
console.log(raw.headers.get('X-My-Header'));
Expand Down
26 changes: 26 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,29 @@ Methods:
- <code title="post /batches">client.batches.<a href="./src/resources/batches.ts">create</a>({ ...params }) -> BatchCreateResponse</code>
- <code title="get /batches/{id}">client.batches.<a href="./src/resources/batches.ts">retrieve</a>(id) -> BatchRetrieveResponse</code>
- <code title="get /batches">client.batches.<a href="./src/resources/batches.ts">list</a>() -> BatchListResponse</code>

# Evaluation

Types:

- <code><a href="./src/resources/evaluation.ts">EvaluationJudgeModelConfig</a></code>
- <code><a href="./src/resources/evaluation.ts">EvaluationModelRequest</a></code>
- <code><a href="./src/resources/evaluation.ts">EvaluationRetrieveResponse</a></code>
- <code><a href="./src/resources/evaluation.ts">EvaluationGetStatusResponse</a></code>

Methods:

- <code title="get /evaluation/{id}">client.evaluation.<a href="./src/resources/evaluation.ts">retrieve</a>(id) -> EvaluationRetrieveResponse</code>
- <code title="get /evaluation/{id}/status">client.evaluation.<a href="./src/resources/evaluation.ts">getStatus</a>(id) -> EvaluationGetStatusResponse</code>

# Evaluations

Types:

- <code><a href="./src/resources/evaluations.ts">EvaluationListResponse</a></code>
- <code><a href="./src/resources/evaluations.ts">EvaluationGetAllowedModelsResponse</a></code>

Methods:

- <code title="get /evaluations">client.evaluations.<a href="./src/resources/evaluations.ts">list</a>({ ...params }) -> EvaluationListResponse</code>
- <code title="get /evaluations/model-list">client.evaluations.<a href="./src/resources/evaluations.ts">getAllowedModels</a>() -> EvaluationGetAllowedModelsResponse</code>
17 changes: 5 additions & 12 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@ const { spawnSync } = require('child_process');

const commands = {
migrate: {
description:
'Run migrations to update your code using together-ai@0.20.0 to be compatible with together-ai@0.21.0',
description: 'Run migrations to update your code using together-ai@0.20.0 to be compatible with together-ai@0.21.0',
fn: () => {
const result = spawnSync(
'npx',
[
'-y',
'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz',
'--migrationConfig',
require.resolve('./migration-config.json'),
...process.argv.slice(3),
],
['-y', 'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz', '--migrationConfig', require.resolve('./migration-config.json'), ...process.argv.slice(3)],
{ stdio: 'inherit' },
);
if (result.status !== 0) {
process.exit(result.status);
}
},
},
};
}
}
}

function exitWithHelp() {
console.log(`Usage: together-ai <subcommand>`);
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "together-ai",
"version": "0.22.0",
"version": "0.23.0",
"description": "The official TypeScript library for the Together API",
"author": "Together <dev-feedback@TogetherAI.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -49,8 +49,9 @@
"publint": "^0.2.12",
"ts-jest": "^29.1.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.8/tsc-multi.tgz",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
"tsconfig-paths": "^4.0.0",
"tslib": "^2.8.1",
"typescript": "5.8.3",
"typescript-eslint": "8.31.1"
},
Expand Down
16 changes: 12 additions & 4 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
brew bundle
;;
*)
;;
esac
echo
}
fi

echo "==> Installing Node dependencies…"

PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm")

$PACKAGE_MANAGER install
$PACKAGE_MANAGER install "$@"
40 changes: 40 additions & 0 deletions scripts/fast-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

set -euo pipefail

echo "Script started with $# arguments"
echo "Arguments: $*"
echo "Script location: $(dirname "$0")"

cd "$(dirname "$0")/.."
echo "Changed to directory: $(pwd)"

if [ $# -eq 0 ]; then
echo "Usage: $0 <file-with-paths> [additional-formatter-args...]"
echo "The file should contain one file path per line"
exit 1
fi

FILE_LIST="$1"

echo "Looking for file: $FILE_LIST"

if [ ! -f "$FILE_LIST" ]; then
echo "Error: File '$FILE_LIST' not found"
exit 1
fi

echo "==> Running eslint --fix"
ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)"
if ! [ -z "$ESLINT_FILES" ]; then
echo "$ESLINT_FILES" | xargs ./node_modules/.bin/eslint --cache --fix
fi

echo "==> Running prettier --write"
# format things eslint didn't
PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)"
if ! [ -z "$PRETTIER_FILES" ]; then
echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \
--write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \
'!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs'
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Prettier Script Conflicts with Command Exclusions

The script selects JavaScript and JSON files for Prettier, but the prettier command then explicitly excludes JavaScript files (e.g., !**/*.js). This contradictory logic means JavaScript files won't be formatted as intended.

Fix in Cursor Fix in Web

6 changes: 4 additions & 2 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
TARBALL=$(cd dist && npm pack --silent)

UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
--data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
Expand Down
38 changes: 36 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ import {
EndpointUpdateResponse,
Endpoints,
} from './resources/endpoints';
import {
Evaluation,
EvaluationGetStatusResponse,
EvaluationJudgeModelConfig,
EvaluationModelRequest,
EvaluationRetrieveResponse,
} from './resources/evaluation';
import {
EvaluationGetAllowedModelsResponse,
EvaluationListParams,
EvaluationListResponse,
Evaluations,
} from './resources/evaluations';
import {
FileDeleteResponse,
FileListResponse,
Expand Down Expand Up @@ -469,7 +482,7 @@ export class Together {
const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
const headersTime = Date.now();

if (response instanceof Error) {
if (response instanceof globalThis.Error) {
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
if (options.signal?.aborted) {
throw new Errors.APIUserAbortError();
Expand Down Expand Up @@ -776,7 +789,7 @@ export class Together {
// Preserve legacy string encoding behavior for now
headers.values.has('content-type')) ||
// `Blob` is superset of `File`
body instanceof Blob ||
((globalThis as any).Blob && body instanceof (globalThis as any).Blob) ||
// `FormData` -> `multipart/form-data`
body instanceof FormData ||
// `URLSearchParams` -> `application/x-www-form-urlencoded`
Expand Down Expand Up @@ -828,7 +841,10 @@ export class Together {
endpoints: API.Endpoints = new API.Endpoints(this);
hardware: API.Hardware = new API.Hardware(this);
batches: API.Batches = new API.Batches(this);
evaluation: API.Evaluation = new API.Evaluation(this);
evaluations: API.Evaluations = new API.Evaluations(this);
}

Together.Chat = Chat;
Together.Completions = Completions;
Together.Embeddings = Embeddings;
Expand All @@ -842,6 +858,9 @@ Together.Jobs = Jobs;
Together.Endpoints = Endpoints;
Together.Hardware = Hardware;
Together.Batches = Batches;
Together.Evaluation = Evaluation;
Together.Evaluations = Evaluations;

export declare namespace Together {
export type RequestOptions = Opts.RequestOptions;

Expand Down Expand Up @@ -961,4 +980,19 @@ export declare namespace Together {
type BatchListResponse as BatchListResponse,
type BatchCreateParams as BatchCreateParams,
};

export {
Evaluation as Evaluation,
type EvaluationJudgeModelConfig as EvaluationJudgeModelConfig,
type EvaluationModelRequest as EvaluationModelRequest,
type EvaluationRetrieveResponse as EvaluationRetrieveResponse,
type EvaluationGetStatusResponse as EvaluationGetStatusResponse,
};

export {
Evaluations as Evaluations,
type EvaluationListResponse as EvaluationListResponse,
type EvaluationGetAllowedModelsResponse as EvaluationGetAllowedModelsResponse,
type EvaluationListParams as EvaluationListParams,
};
}
Loading