Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2809941
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
ef0da68
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
a809793
chore: mention unit type in timeout docs
stainless-app[bot] Jul 3, 2025
45de86e
fix(client): don't send `Content-Type` for bodyless methods
stainless-app[bot] Jul 3, 2025
b4735a7
chore: make some internal functions async
stainless-app[bot] Jul 10, 2025
a57dbf7
chore(internal): remove redundant imports config
stainless-app[bot] Jul 30, 2025
e57abef
chore(internal): move publish config
stainless-app[bot] Aug 7, 2025
2544f05
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 9, 2025
163ed61
chore(internal): update comment in script
stainless-app[bot] Aug 9, 2025
0bb99c6
chore(deps): update dependency node-fetch to v2.6.13
stainless-app[bot] Aug 16, 2025
8adc883
chore(internal): formatting change
stainless-app[bot] Aug 16, 2025
62383c8
chore: update CI script
stainless-app[bot] Aug 23, 2025
db161b6
chore: ci build action
stainless-app[bot] Sep 6, 2025
9e92ff2
fix: coerce nullable values to undefined
stainless-app[bot] Sep 9, 2025
9af4cee
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 20, 2025
b9c2e0d
perf: faster formatting
stainless-app[bot] Sep 26, 2025
fd8c0ef
chore(internal): remove deprecated `compilerOptions.baseUrl` from tsc…
stainless-app[bot] Sep 26, 2025
7fd8f47
chore(internal): fix incremental formatting in some cases
stainless-app[bot] Sep 27, 2025
361b687
chore(internal): codegen related update
stainless-app[bot] Sep 27, 2025
cac8b8d
chore(internal): ignore .eslintcache
stainless-app[bot] Sep 27, 2025
542afa1
chore(internal): remove .eslintcache
stainless-app[bot] Oct 7, 2025
74c21de
chore(internal): use npm pack for build uploads
stainless-app[bot] Oct 7, 2025
58018a4
fix(mcp): return correct lines on typescript errors
stainless-app[bot] Dec 6, 2025
f7038e7
chore(internal): codegen related update
stainless-app[bot] Dec 6, 2025
30a9be9
fix(mcp): correct code tool API endpoint
stainless-app[bot] Dec 6, 2025
b6e941f
chore(internal): codegen related update
stainless-app[bot] Dec 6, 2025
5bcd066
chore(internal): codegen related update
stainless-app[bot] Jan 6, 2026
eb75799
chore: break long lines in snippets into multiline
stainless-app[bot] Jan 7, 2026
1047c88
chore(internal): upgrade babel, qs, js-yaml
stainless-app[bot] Jan 15, 2026
c8e64cd
chore(internal): update `actions/checkout` version
stainless-app[bot] Jan 17, 2026
521a8f6
chore(ci): upgrade `actions/github-script`
stainless-app[bot] Jan 24, 2026
1902d34
chore(client): do not parse responses with empty content-length
stainless-app[bot] Feb 3, 2026
2eab2e2
chore: update mock server docs
stainless-app[bot] Feb 20, 2026
93d9117
fix(docs/contributing): correct pnpm link command
stainless-app[bot] Feb 24, 2026
c348d38
chore(internal): move stringifyQuery implementation to internal function
stainless-app[bot] Feb 27, 2026
1acd9fd
chore(internal): codegen related update
stainless-app[bot] Mar 7, 2026
ccf05f5
chore(test): do not count install time for mock server timeout
stainless-app[bot] Mar 7, 2026
b7da287
chore(ci): skip uploading artifacts on stainless-internal branches
stainless-app[bot] Mar 8, 2026
c16e922
fix(client): preserve URL params already embedded in path
stainless-app[bot] Mar 8, 2026
003fc8d
chore(internal): tweak CI branches
stainless-app[bot] Mar 17, 2026
b5c9613
refactor(tests): switch from prism to steady
stainless-app[bot] Mar 20, 2026
b69b6f3
chore(tests): bump steady to v0.19.4
stainless-app[bot] Mar 21, 2026
8482b3a
chore(tests): bump steady to v0.19.5
stainless-app[bot] Mar 21, 2026
f3598f8
chore(internal): update gitignore
stainless-app[bot] Mar 24, 2026
d9d0b13
chore(tests): bump steady to v0.19.6
stainless-app[bot] Mar 24, 2026
a993c1d
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 25, 2026
27e696f
chore(tests): bump steady to v0.19.7
stainless-app[bot] Mar 25, 2026
07171db
chore(internal): update multipart form array serialization
stainless-app[bot] Mar 27, 2026
3e7a690
chore(tests): bump steady to v0.20.1
stainless-app[bot] Apr 1, 2026
521b5ad
chore(tests): bump steady to v0.20.2
stainless-app[bot] Apr 1, 2026
57b0ff9
chore(internal): codegen related update
stainless-app[bot] Apr 9, 2026
e5678dd
chore(tests): bump steady to v0.22.1
stainless-app[bot] Apr 18, 2026
934e560
chore(internal): more robust bootstrap script
stainless-app[bot] Apr 23, 2026
23c4ec3
feat: support setting headers via env
stainless-app[bot] Apr 28, 2026
baaafb2
codegen metadata
stainless-app[bot] Apr 30, 2026
f886039
codegen metadata
stainless-app[bot] May 1, 2026
935218f
ci: pin GitHub Actions to commit SHAs
stainless-app[bot] May 13, 2026
41b0138
release: 0.4.0
stainless-app[bot] May 13, 2026
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
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode"
]
"extensions": ["esbenp.prettier-vscode"]
}
}
}
39 changes: 24 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,11 +19,12 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/patronus-api-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '18'

Expand All @@ -35,14 +38,15 @@ jobs:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/patronus-api-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '18'

Expand All @@ -53,14 +57,18 @@ jobs:
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/patronus-api-node'
if: |-
github.repository == 'stainless-sdks/patronus-api-node' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v6
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/patronus-api-node'
if: |-
github.repository == 'stainless-sdks/patronus-api-node' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand All @@ -70,11 +78,12 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/patronus-api-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
with:
node-version: '20'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'patronus-ai/patronus-api-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check release environment
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
node_modules
yarn-error.log
codegen.log
Expand All @@ -7,4 +8,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.3.0"
".": "0.4.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 39
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/patronus-ai%2Fpatronus-api-15b2763ab870cf7d37ae696dc05275e51c9efea6330a5361181c6e183995d0dd.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/patronus-ai/patronus-api-5ea73d3c98f4ff22f13e4ece8b7d0abc7b50ed4d64c6efdff387e02677e4fb2d.yml
openapi_spec_hash: 4ee31808e91294a9af18fab876370449
config_hash: 6115f7b35bce3cda75a4a71daf3220ac
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
# Changelog

## 0.4.0 (2026-05-13)

Full Changelog: [v0.3.0...v0.4.0](https://github.com/patronus-ai/patronus-api-node/compare/v0.3.0...v0.4.0)

### Features

* support setting headers via env ([23c4ec3](https://github.com/patronus-ai/patronus-api-node/commit/23c4ec3ad277a344958a342078ce398530cff435))


### Bug Fixes

* **ci:** release-doctor — report correct token name ([2809941](https://github.com/patronus-ai/patronus-api-node/commit/28099411dc16dc06de452821e65b22c0d6dc6907))
* **client:** don't send `Content-Type` for bodyless methods ([45de86e](https://github.com/patronus-ai/patronus-api-node/commit/45de86e8c180d8647045bbf04ee918e7460bcb8a))
* **client:** preserve URL params already embedded in path ([c16e922](https://github.com/patronus-ai/patronus-api-node/commit/c16e922b0dff2b837156c0bd8ab3ddde5c106d3a))
* coerce nullable values to undefined ([9e92ff2](https://github.com/patronus-ai/patronus-api-node/commit/9e92ff2b766e1c72564aaf7a4693fa3b48e2ffda))
* **docs/contributing:** correct pnpm link command ([93d9117](https://github.com/patronus-ai/patronus-api-node/commit/93d9117bfc6c8075f700a1a3efc763142da6f335))
* **mcp:** correct code tool API endpoint ([30a9be9](https://github.com/patronus-ai/patronus-api-node/commit/30a9be97cdab7b1adfeb69c62738c5168018c769))
* **mcp:** return correct lines on typescript errors ([58018a4](https://github.com/patronus-ai/patronus-api-node/commit/58018a4b3cd8242df5108b3c64ea1fd749947e0e))


### Performance Improvements

* faster formatting ([b9c2e0d](https://github.com/patronus-ai/patronus-api-node/commit/b9c2e0dacbae18f9c90aabab3e087c2747a949fb))


### Chores

* break long lines in snippets into multiline ([eb75799](https://github.com/patronus-ai/patronus-api-node/commit/eb75799b37387a5907d941643023349d8126c899))
* ci build action ([db161b6](https://github.com/patronus-ai/patronus-api-node/commit/db161b624bc24b312681a35e76709df81bf90874))
* **ci:** only run for pushes and fork pull requests ([ef0da68](https://github.com/patronus-ai/patronus-api-node/commit/ef0da68f68f88d84a23f2ebeb6626b145adc7ec6))
* **ci:** skip lint on metadata-only changes ([a993c1d](https://github.com/patronus-ai/patronus-api-node/commit/a993c1de13e2667c7a5474c82348966b08aa1992))
* **ci:** skip uploading artifacts on stainless-internal branches ([b7da287](https://github.com/patronus-ai/patronus-api-node/commit/b7da2875f73e44be4ca24f60c9204a1034bd7cfa))
* **ci:** upgrade `actions/github-script` ([521a8f6](https://github.com/patronus-ai/patronus-api-node/commit/521a8f6c19bd69f7de6170a194d6a8a82d26ddcd))
* **client:** do not parse responses with empty content-length ([1902d34](https://github.com/patronus-ai/patronus-api-node/commit/1902d3496d109542f822a502fca2b4ce5a7bc9ca))
* **deps:** update dependency node-fetch to v2.6.13 ([0bb99c6](https://github.com/patronus-ai/patronus-api-node/commit/0bb99c615b54daa358a136d2263d92470cbbd458))
* do not install brew dependencies in ./scripts/bootstrap by default ([9af4cee](https://github.com/patronus-ai/patronus-api-node/commit/9af4ceea1afc47b8234d2d1bafc48dc6aa5062ba))
* **internal:** codegen related update ([57b0ff9](https://github.com/patronus-ai/patronus-api-node/commit/57b0ff94300a2f50a33c389244707ad4c6b16915))
* **internal:** codegen related update ([1acd9fd](https://github.com/patronus-ai/patronus-api-node/commit/1acd9fd024a71ce2334de7ded2e2b75ee68b95a4))
* **internal:** codegen related update ([5bcd066](https://github.com/patronus-ai/patronus-api-node/commit/5bcd066fe90dbfca0ec2e7d0df3f70eb74df0b84))
* **internal:** codegen related update ([b6e941f](https://github.com/patronus-ai/patronus-api-node/commit/b6e941fdf7534bee6849c4b0ce43b30e7bfc50f2))
* **internal:** codegen related update ([f7038e7](https://github.com/patronus-ai/patronus-api-node/commit/f7038e72a4050bbceff730de03e9d7f794061305))
* **internal:** codegen related update ([361b687](https://github.com/patronus-ai/patronus-api-node/commit/361b687dd98c8142cba0abd0d8c2cb92aad856c7))
* **internal:** fix incremental formatting in some cases ([7fd8f47](https://github.com/patronus-ai/patronus-api-node/commit/7fd8f479d8b19d96fb1fe08433fc485ceef455aa))
* **internal:** formatting change ([8adc883](https://github.com/patronus-ai/patronus-api-node/commit/8adc883618277d7144aec02647833ff68f27fdfd))
* **internal:** ignore .eslintcache ([cac8b8d](https://github.com/patronus-ai/patronus-api-node/commit/cac8b8d73c39014b7f97a8c16d493696b4f60846))
* **internal:** more robust bootstrap script ([934e560](https://github.com/patronus-ai/patronus-api-node/commit/934e560b3f249beca5d346afd107665250ad41d5))
* **internal:** move publish config ([e57abef](https://github.com/patronus-ai/patronus-api-node/commit/e57abefe75df3e6e47a0d5d4791192aa31adcda4))
* **internal:** move stringifyQuery implementation to internal function ([c348d38](https://github.com/patronus-ai/patronus-api-node/commit/c348d381a5a53875989c030bd7ebc2fa9ddbd5ad))
* **internal:** remove .eslintcache ([542afa1](https://github.com/patronus-ai/patronus-api-node/commit/542afa18a2c8586026bacd4c843aee1051606668))
* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([fd8c0ef](https://github.com/patronus-ai/patronus-api-node/commit/fd8c0efd9dd067a05223010f95bec7c762c608e8))
* **internal:** remove redundant imports config ([a57dbf7](https://github.com/patronus-ai/patronus-api-node/commit/a57dbf78d39ea5af9ec409391b7cad07cf775e16))
* **internal:** tweak CI branches ([003fc8d](https://github.com/patronus-ai/patronus-api-node/commit/003fc8dd4df115d8afd2e8594317d3ec1c8a412f))
* **internal:** update `actions/checkout` version ([c8e64cd](https://github.com/patronus-ai/patronus-api-node/commit/c8e64cd1e0dd226a94ed444a0d7a267cbe9b3b28))
* **internal:** update comment in script ([163ed61](https://github.com/patronus-ai/patronus-api-node/commit/163ed6183510ddaaadb033b2efcdcd1ba4028b8d))
* **internal:** update gitignore ([f3598f8](https://github.com/patronus-ai/patronus-api-node/commit/f3598f8d2945df7ef0539d6c29995522ce0b4a26))
* **internal:** update multipart form array serialization ([07171db](https://github.com/patronus-ai/patronus-api-node/commit/07171db7519642629c06c941a08097bc35e92fee))
* **internal:** upgrade babel, qs, js-yaml ([1047c88](https://github.com/patronus-ai/patronus-api-node/commit/1047c883003fd019ffdbf64f9814de5b936ec8c6))
* **internal:** use npm pack for build uploads ([74c21de](https://github.com/patronus-ai/patronus-api-node/commit/74c21de6d625586e2223b9bc1620d0abe1b4f947))
* make some internal functions async ([b4735a7](https://github.com/patronus-ai/patronus-api-node/commit/b4735a70ea1c592b988e3035360cd9975e9bba40))
* mention unit type in timeout docs ([a809793](https://github.com/patronus-ai/patronus-api-node/commit/a80979393761501e5813ab828c098f898666e4a1))
* **test:** do not count install time for mock server timeout ([ccf05f5](https://github.com/patronus-ai/patronus-api-node/commit/ccf05f50b7f4bd1d4e36288f6eec4270348d25d8))
* **tests:** bump steady to v0.19.4 ([b69b6f3](https://github.com/patronus-ai/patronus-api-node/commit/b69b6f3e571e506295226bc4b26caf77bb0fe091))
* **tests:** bump steady to v0.19.5 ([8482b3a](https://github.com/patronus-ai/patronus-api-node/commit/8482b3a954a09fc774c9b8bea4578aad0d79e73b))
* **tests:** bump steady to v0.19.6 ([d9d0b13](https://github.com/patronus-ai/patronus-api-node/commit/d9d0b13b94f6c3a5834913608bcc16d8bbe288e3))
* **tests:** bump steady to v0.19.7 ([27e696f](https://github.com/patronus-ai/patronus-api-node/commit/27e696f46f8d113c15e38da825f0d692bfa0de2b))
* **tests:** bump steady to v0.20.1 ([3e7a690](https://github.com/patronus-ai/patronus-api-node/commit/3e7a6909124c4cfd20768c42c00099085673b39f))
* **tests:** bump steady to v0.20.2 ([521b5ad](https://github.com/patronus-ai/patronus-api-node/commit/521b5adaf58039ce18082129676a659874324f06))
* **tests:** bump steady to v0.22.1 ([e5678dd](https://github.com/patronus-ai/patronus-api-node/commit/e5678ddf6e5ef87bd063ae6094984aa48e992338))
* update @stainless-api/prism-cli to v5.15.0 ([2544f05](https://github.com/patronus-ai/patronus-api-node/commit/2544f05f9eca7f9d189fd9b7f9844d8f5bfe26e6))
* update CI script ([62383c8](https://github.com/patronus-ai/patronus-api-node/commit/62383c887ac72b9444853e5f2ccc3e75a7a9c1f2))
* update mock server docs ([2eab2e2](https://github.com/patronus-ai/patronus-api-node/commit/2eab2e25b3cf1cdc5ff82c2048a9dd3388db884a))


### Refactors

* **tests:** switch from prism to steady ([b5c9613](https://github.com/patronus-ai/patronus-api-node/commit/b5c9613828dfd9d3d6a7026b7285a136e1c9846b))

## 0.3.0 (2025-06-24)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/patronus-ai/patronus-api-node/compare/v0.2.0...v0.3.0)
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ $ yarn link patronus-api
# With pnpm
$ pnpm link --global
$ cd ../my-package
$ pnpm link -global patronus-api
$ pnpm link --global patronus-api
```

## Running tests

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

```sh
$ npx prism mock path/to/your/openapi.yml
$ ./scripts/mock
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Patronus API
Copyright 2026 Patronus API

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
70 changes: 62 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ const client = new PatronusAPI({
});

const response = await client.evaluations.evaluate({
evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }],
evaluators: [
{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
},
],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
Expand All @@ -49,7 +55,13 @@ const client = new PatronusAPI({
});

const params: PatronusAPI.EvaluationEvaluateParams = {
evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }],
evaluators: [
{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
},
],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
Expand All @@ -69,7 +81,13 @@ a subclass of `APIError` will be thrown:
```ts
const response = await client.evaluations
.evaluate({
evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }],
evaluators: [
{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
},
],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
Expand Down Expand Up @@ -114,7 +132,16 @@ const client = new PatronusAPI({
});

// Or, configure per-request:
await client.evaluations.evaluate({ evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }], task_context: 'The blue whale is the largest known animal.', task_input: 'What is the largest animal in the world?', task_output: 'The giant sandworm.' }, {
await client.evaluations.evaluate({
evaluators: [{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
}],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
}, {
maxRetries: 5,
});
```
Expand All @@ -131,7 +158,16 @@ const client = new PatronusAPI({
});

// Override per-request:
await client.evaluations.evaluate({ evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }], task_context: 'The blue whale is the largest known animal.', task_input: 'What is the largest animal in the world?', task_output: 'The giant sandworm.' }, {
await client.evaluations.evaluate({
evaluators: [{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
}],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
}, {
timeout: 5 * 1000,
});
```
Expand All @@ -154,7 +190,13 @@ const client = new PatronusAPI();

const response = await client.evaluations
.evaluate({
evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }],
evaluators: [
{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
},
],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
Expand All @@ -165,7 +207,13 @@ console.log(response.statusText); // access the underlying Response object

const { data: response, response: raw } = await client.evaluations
.evaluate({
evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }],
evaluators: [
{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
},
],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
Expand Down Expand Up @@ -278,7 +326,13 @@ const client = new PatronusAPI({
// Override per-request:
await client.evaluations.evaluate(
{
evaluators: [{ evaluator: 'lynx', criteria: 'patronus:hallucination', explain_strategy: 'always' }],
evaluators: [
{
evaluator: 'lynx',
criteria: 'patronus:hallucination',
explain_strategy: 'always',
},
],
task_context: 'The blue whale is the largest known animal.',
task_input: 'What is the largest animal in the world?',
task_output: 'The giant sandworm.',
Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${NPM_TOKEN}" ]; then
errors+=("The PATRONUS_API_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}
Expand Down
2 changes: 1 addition & 1 deletion bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ else
fi

# Publish with the appropriate tag
yarn publish --access public --tag "$TAG"
yarn publish --tag "$TAG"
Loading
Loading