From b1093976c3be6e8389d65d127ebe856d2a34ff9b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 21:51:24 +0000 Subject: [PATCH 01/31] feat(api): OpenAPI spec update via Stainless API (#296) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From 2b8b0d7841454afe4a164217a1cccd7e3d58e2a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 21:53:55 +0000 Subject: [PATCH 02/31] chore(ci): check for build errors (#297) --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d791adb..a955a76 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,25 @@ jobs: - name: Check types run: ./scripts/lint + + build: + name: build + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install dependencies + run: yarn install + + - name: Check build + run: ./scripts/build test: name: test runs-on: ubuntu-latest From 22df253af20a541055c4343da65e7ef0774980b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:18:49 +0000 Subject: [PATCH 03/31] feat(api): OpenAPI spec update via Stainless API (#298) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From aeb5bd3613548139d4fbf332a2f48ef110ac87b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 05:27:47 +0000 Subject: [PATCH 04/31] feat(api): OpenAPI spec update via Stainless API (#299) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From ab92cbf32a5e3373825d653b8b19ecdbd93c6fe7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 06:19:39 +0000 Subject: [PATCH 05/31] feat(api): OpenAPI spec update via Stainless API (#300) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From 0cd49b4545499086879da70f5f620e90b189a6e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:07:47 +0000 Subject: [PATCH 06/31] feat(api): OpenAPI spec update via Stainless API (#301) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From c78917fe2d358ba099969afb3a7982614c693c75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:19:08 +0000 Subject: [PATCH 07/31] feat(api): OpenAPI spec update via Stainless API (#302) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From dd0b8fb614803dd001962871ad6964c0c48b8751 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:29:04 +0000 Subject: [PATCH 08/31] feat(api): OpenAPI spec update via Stainless API (#303) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From cdd4c5fa4a07b7e7e84e424bd6c56e92f0c16559 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:19:22 +0000 Subject: [PATCH 09/31] feat(api): OpenAPI spec update via Stainless API (#304) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From 9d85271e34f76fbf1dcb2b9f37e05d88f10bdb2e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 03:59:41 +0000 Subject: [PATCH 10/31] feat(api): OpenAPI spec update via Stainless API (#305) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From e19c47f427c47c2a645f03e1b1e2934acd5bc27e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 04:02:30 +0000 Subject: [PATCH 11/31] chore: run tsc as part of lint script (#306) --- scripts/lint | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/lint b/scripts/lint index 4af1de0..6ba75df 100755 --- a/scripts/lint +++ b/scripts/lint @@ -6,3 +6,6 @@ cd "$(dirname "$0")/.." echo "==> Running eslint" ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js . + +echo "==> Running tsc" +./node_modules/.bin/tsc --noEmit From 8b757ee63f894eb9498d575f2155732703d10995 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 04:04:40 +0000 Subject: [PATCH 12/31] chore(ci): install deps via ./script/bootstrap (#307) --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a955a76..e3530dc 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: with: node-version: '18' - - name: Install dependencies - run: yarn install + - name: Bootstrap + run: ./scripts/bootstrap - name: Check types run: ./scripts/lint @@ -41,8 +41,8 @@ jobs: with: node-version: '18' - - name: Install dependencies - run: yarn install + - name: Bootstrap + run: ./scripts/bootstrap - name: Check build run: ./scripts/build From 1c39d23aaf9c86dd2eebd094ca2f768bd4ea2291 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 04:17:38 +0000 Subject: [PATCH 13/31] feat(api): OpenAPI spec update via Stainless API (#308) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From 719efef3e883619cc6af5430406a5d3a3a51c26b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 30 Aug 2024 18:08:56 +0000 Subject: [PATCH 14/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From e4cdb056ce717fd48e982109d96b194fd4cc9ada Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 30 Aug 2024 18:17:49 +0000 Subject: [PATCH 15/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From 0e176b1847a5bcdb20d32ee44ddc6d24e639174f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 4 Sep 2024 15:21:44 +0000 Subject: [PATCH 16/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From 30fb68e1fa8fcbecc0372d6357d7258fa04655b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:22:36 +0000 Subject: [PATCH 17/31] fix(client): correct File construction from node-fetch Responses (#309) --- src/uploads.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/uploads.ts b/src/uploads.ts index 081827c..a920351 100755 --- a/src/uploads.ts +++ b/src/uploads.ts @@ -114,7 +114,12 @@ export async function toFile( const blob = await value.blob(); name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file'; - return new File([blob as any], name, options); + // we need to convert the `Blob` into an array buffer because the `Blob` class + // that `node-fetch` defines is incompatible with the web standard which results + // in `new File` interpreting it as a string instead of binary data. + const data = isBlobLike(blob) ? [(await blob.arrayBuffer()) as any] : [blob]; + + return new File(data, name, options); } const bits = await getBytes(value); From 7cf7730c08d3f7cf6586f8c35ee718bce1f0a1af Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 4 Sep 2024 16:18:01 +0000 Subject: [PATCH 18/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From b35232007f841270a7b36192b0c2ebc8a1b025ee Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 4 Sep 2024 21:21:27 +0000 Subject: [PATCH 19/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From ca507177e4428be08d48145dd6017aa289bf559f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 4 Sep 2024 22:19:10 +0000 Subject: [PATCH 20/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From fb61fb79cd91dd831c2283c9e890b105f5260859 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 5 Sep 2024 02:47:51 +0000 Subject: [PATCH 21/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From 1f4716cf1535b867ef1a81b0887de5f0186f809f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 5 Sep 2024 03:18:27 +0000 Subject: [PATCH 22/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From 2f958c9f6e8fa6b867ef30bfbf3df6aece0dd92a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 5 Sep 2024 04:14:16 +0000 Subject: [PATCH 23/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 112acec..7ae105a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml From 472f6ac378bbcf362ca14c61ddff9e47f7a3b1dc Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 5 Sep 2024 04:18:48 +0000 Subject: [PATCH 24/31] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae105a..112acec 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-6c87a6d2f0a1447fab78657f8b44e2d1ea2c282d2c9f92458bcd25f543944c6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml From bf9ac81e12d9c8846a4cef4285dc5c9a012faf71 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 6 Sep 2024 13:03:45 -0400 Subject: [PATCH 25/31] fix file permissions --- .devcontainer/Dockerfile | 0 .devcontainer/devcontainer.json | 0 .eslintrc.js | 0 .github/workflows/ci.yml | 0 .github/workflows/publish-npm.yml | 0 .github/workflows/release-doctor.yml | 0 .gitignore | 0 .prettierignore | 0 .prettierrc.json | 0 .release-please-manifest.json | 0 .stats.yml | 0 Brewfile | 0 CONTRIBUTING.md | 0 LICENSE | 0 README.md | 0 SECURITY.md | 0 api.md | 0 bin/check-release-environment | 0 bin/publish-npm | 0 examples/.keep | 0 jest.config.ts | 0 package.json | 0 release-please-config.json | 0 scripts/utils/check-version.cjs | 0 scripts/utils/fix-index-exports.cjs | 0 scripts/utils/make-dist-package-json.cjs | 0 scripts/utils/postprocess-files.cjs | 0 src/_shims/MultipartBody.ts | 0 src/_shims/README.md | 0 src/_shims/auto/runtime-bun.ts | 0 src/_shims/auto/runtime-deno.ts | 0 src/_shims/auto/runtime-node.ts | 0 src/_shims/auto/runtime.ts | 0 src/_shims/auto/types-deno.ts | 0 src/_shims/auto/types-node.ts | 0 src/_shims/auto/types.d.ts | 0 src/_shims/auto/types.js | 0 src/_shims/auto/types.mjs | 0 src/_shims/bun-runtime.ts | 0 src/_shims/index-deno.ts | 0 src/_shims/index.d.ts | 0 src/_shims/index.js | 0 src/_shims/index.mjs | 0 src/_shims/manual-types.d.ts | 0 src/_shims/manual-types.js | 0 src/_shims/manual-types.mjs | 0 src/_shims/node-runtime.ts | 0 src/_shims/node-types.d.ts | 0 src/_shims/node-types.js | 0 src/_shims/node-types.mjs | 0 src/_shims/registry.ts | 0 src/_shims/web-runtime.ts | 0 src/_shims/web-types.d.ts | 0 src/_shims/web-types.js | 0 src/_shims/web-types.mjs | 0 src/core.ts | 0 src/error.ts | 0 src/index.ts | 0 src/lib/.keep | 0 src/resource.ts | 0 src/resources/completion.ts | 0 src/resources/evaluation-assertions.ts | 0 src/resources/evaluations.ts | 0 src/resources/index.ts | 0 src/resources/prompts.ts | 0 src/resources/tools.ts | 0 src/shims/node.ts | 0 src/shims/web.ts | 0 src/uploads.ts | 0 src/version.ts | 0 tests/api-resources/completion.test.ts | 0 tests/api-resources/evaluation-assertions.test.ts | 0 tests/api-resources/evaluations.test.ts | 0 tests/api-resources/prompts.test.ts | 0 tests/api-resources/tools.test.ts | 0 tests/form.test.ts | 0 tests/index.test.ts | 0 tests/responses.test.ts | 0 tests/stringifyQuery.test.ts | 0 tests/uploads.test.ts | 0 tsc-multi.json | 0 tsconfig.build.json | 0 tsconfig.deno.json | 0 tsconfig.dist-src.json | 0 tsconfig.json | 0 85 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .devcontainer/Dockerfile mode change 100755 => 100644 .devcontainer/devcontainer.json mode change 100755 => 100644 .eslintrc.js mode change 100755 => 100644 .github/workflows/ci.yml mode change 100755 => 100644 .github/workflows/publish-npm.yml mode change 100755 => 100644 .github/workflows/release-doctor.yml mode change 100755 => 100644 .gitignore mode change 100755 => 100644 .prettierignore mode change 100755 => 100644 .prettierrc.json mode change 100755 => 100644 .release-please-manifest.json mode change 100755 => 100644 .stats.yml mode change 100755 => 100644 Brewfile mode change 100755 => 100644 CONTRIBUTING.md mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md mode change 100755 => 100644 SECURITY.md mode change 100755 => 100644 api.md mode change 100755 => 100644 bin/check-release-environment mode change 100755 => 100644 bin/publish-npm mode change 100755 => 100644 examples/.keep mode change 100755 => 100644 jest.config.ts mode change 100755 => 100644 package.json mode change 100755 => 100644 release-please-config.json mode change 100755 => 100644 scripts/utils/check-version.cjs mode change 100755 => 100644 scripts/utils/fix-index-exports.cjs mode change 100755 => 100644 scripts/utils/make-dist-package-json.cjs mode change 100755 => 100644 scripts/utils/postprocess-files.cjs mode change 100755 => 100644 src/_shims/MultipartBody.ts mode change 100755 => 100644 src/_shims/README.md mode change 100755 => 100644 src/_shims/auto/runtime-bun.ts mode change 100755 => 100644 src/_shims/auto/runtime-deno.ts mode change 100755 => 100644 src/_shims/auto/runtime-node.ts mode change 100755 => 100644 src/_shims/auto/runtime.ts mode change 100755 => 100644 src/_shims/auto/types-deno.ts mode change 100755 => 100644 src/_shims/auto/types-node.ts mode change 100755 => 100644 src/_shims/auto/types.d.ts mode change 100755 => 100644 src/_shims/auto/types.js mode change 100755 => 100644 src/_shims/auto/types.mjs mode change 100755 => 100644 src/_shims/bun-runtime.ts mode change 100755 => 100644 src/_shims/index-deno.ts mode change 100755 => 100644 src/_shims/index.d.ts mode change 100755 => 100644 src/_shims/index.js mode change 100755 => 100644 src/_shims/index.mjs mode change 100755 => 100644 src/_shims/manual-types.d.ts mode change 100755 => 100644 src/_shims/manual-types.js mode change 100755 => 100644 src/_shims/manual-types.mjs mode change 100755 => 100644 src/_shims/node-runtime.ts mode change 100755 => 100644 src/_shims/node-types.d.ts mode change 100755 => 100644 src/_shims/node-types.js mode change 100755 => 100644 src/_shims/node-types.mjs mode change 100755 => 100644 src/_shims/registry.ts mode change 100755 => 100644 src/_shims/web-runtime.ts mode change 100755 => 100644 src/_shims/web-types.d.ts mode change 100755 => 100644 src/_shims/web-types.js mode change 100755 => 100644 src/_shims/web-types.mjs mode change 100755 => 100644 src/core.ts mode change 100755 => 100644 src/error.ts mode change 100755 => 100644 src/index.ts mode change 100755 => 100644 src/lib/.keep mode change 100755 => 100644 src/resource.ts mode change 100755 => 100644 src/resources/completion.ts mode change 100755 => 100644 src/resources/evaluation-assertions.ts mode change 100755 => 100644 src/resources/evaluations.ts mode change 100755 => 100644 src/resources/index.ts mode change 100755 => 100644 src/resources/prompts.ts mode change 100755 => 100644 src/resources/tools.ts mode change 100755 => 100644 src/shims/node.ts mode change 100755 => 100644 src/shims/web.ts mode change 100755 => 100644 src/uploads.ts mode change 100755 => 100644 src/version.ts mode change 100755 => 100644 tests/api-resources/completion.test.ts mode change 100755 => 100644 tests/api-resources/evaluation-assertions.test.ts mode change 100755 => 100644 tests/api-resources/evaluations.test.ts mode change 100755 => 100644 tests/api-resources/prompts.test.ts mode change 100755 => 100644 tests/api-resources/tools.test.ts mode change 100755 => 100644 tests/form.test.ts mode change 100755 => 100644 tests/index.test.ts mode change 100755 => 100644 tests/responses.test.ts mode change 100755 => 100644 tests/stringifyQuery.test.ts mode change 100755 => 100644 tests/uploads.test.ts mode change 100755 => 100644 tsc-multi.json mode change 100755 => 100644 tsconfig.build.json mode change 100755 => 100644 tsconfig.deno.json mode change 100755 => 100644 tsconfig.dist-src.json mode change 100755 => 100644 tsconfig.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile old mode 100755 new mode 100644 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json old mode 100755 new mode 100644 diff --git a/.eslintrc.js b/.eslintrc.js old mode 100755 new mode 100644 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.prettierignore b/.prettierignore old mode 100755 new mode 100644 diff --git a/.prettierrc.json b/.prettierrc.json old mode 100755 new mode 100644 diff --git a/.release-please-manifest.json b/.release-please-manifest.json old mode 100755 new mode 100644 diff --git a/.stats.yml b/.stats.yml old mode 100755 new mode 100644 diff --git a/Brewfile b/Brewfile old mode 100755 new mode 100644 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/SECURITY.md b/SECURITY.md old mode 100755 new mode 100644 diff --git a/api.md b/api.md old mode 100755 new mode 100644 diff --git a/bin/check-release-environment b/bin/check-release-environment old mode 100755 new mode 100644 diff --git a/bin/publish-npm b/bin/publish-npm old mode 100755 new mode 100644 diff --git a/examples/.keep b/examples/.keep old mode 100755 new mode 100644 diff --git a/jest.config.ts b/jest.config.ts old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/release-please-config.json b/release-please-config.json old mode 100755 new mode 100644 diff --git a/scripts/utils/check-version.cjs b/scripts/utils/check-version.cjs old mode 100755 new mode 100644 diff --git a/scripts/utils/fix-index-exports.cjs b/scripts/utils/fix-index-exports.cjs old mode 100755 new mode 100644 diff --git a/scripts/utils/make-dist-package-json.cjs b/scripts/utils/make-dist-package-json.cjs old mode 100755 new mode 100644 diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs old mode 100755 new mode 100644 diff --git a/src/_shims/MultipartBody.ts b/src/_shims/MultipartBody.ts old mode 100755 new mode 100644 diff --git a/src/_shims/README.md b/src/_shims/README.md old mode 100755 new mode 100644 diff --git a/src/_shims/auto/runtime-bun.ts b/src/_shims/auto/runtime-bun.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/runtime-deno.ts b/src/_shims/auto/runtime-deno.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/runtime-node.ts b/src/_shims/auto/runtime-node.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/runtime.ts b/src/_shims/auto/runtime.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/types-deno.ts b/src/_shims/auto/types-deno.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/types-node.ts b/src/_shims/auto/types-node.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/types.d.ts b/src/_shims/auto/types.d.ts old mode 100755 new mode 100644 diff --git a/src/_shims/auto/types.js b/src/_shims/auto/types.js old mode 100755 new mode 100644 diff --git a/src/_shims/auto/types.mjs b/src/_shims/auto/types.mjs old mode 100755 new mode 100644 diff --git a/src/_shims/bun-runtime.ts b/src/_shims/bun-runtime.ts old mode 100755 new mode 100644 diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts old mode 100755 new mode 100644 diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts old mode 100755 new mode 100644 diff --git a/src/_shims/index.js b/src/_shims/index.js old mode 100755 new mode 100644 diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs old mode 100755 new mode 100644 diff --git a/src/_shims/manual-types.d.ts b/src/_shims/manual-types.d.ts old mode 100755 new mode 100644 diff --git a/src/_shims/manual-types.js b/src/_shims/manual-types.js old mode 100755 new mode 100644 diff --git a/src/_shims/manual-types.mjs b/src/_shims/manual-types.mjs old mode 100755 new mode 100644 diff --git a/src/_shims/node-runtime.ts b/src/_shims/node-runtime.ts old mode 100755 new mode 100644 diff --git a/src/_shims/node-types.d.ts b/src/_shims/node-types.d.ts old mode 100755 new mode 100644 diff --git a/src/_shims/node-types.js b/src/_shims/node-types.js old mode 100755 new mode 100644 diff --git a/src/_shims/node-types.mjs b/src/_shims/node-types.mjs old mode 100755 new mode 100644 diff --git a/src/_shims/registry.ts b/src/_shims/registry.ts old mode 100755 new mode 100644 diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts old mode 100755 new mode 100644 diff --git a/src/_shims/web-types.d.ts b/src/_shims/web-types.d.ts old mode 100755 new mode 100644 diff --git a/src/_shims/web-types.js b/src/_shims/web-types.js old mode 100755 new mode 100644 diff --git a/src/_shims/web-types.mjs b/src/_shims/web-types.mjs old mode 100755 new mode 100644 diff --git a/src/core.ts b/src/core.ts old mode 100755 new mode 100644 diff --git a/src/error.ts b/src/error.ts old mode 100755 new mode 100644 diff --git a/src/index.ts b/src/index.ts old mode 100755 new mode 100644 diff --git a/src/lib/.keep b/src/lib/.keep old mode 100755 new mode 100644 diff --git a/src/resource.ts b/src/resource.ts old mode 100755 new mode 100644 diff --git a/src/resources/completion.ts b/src/resources/completion.ts old mode 100755 new mode 100644 diff --git a/src/resources/evaluation-assertions.ts b/src/resources/evaluation-assertions.ts old mode 100755 new mode 100644 diff --git a/src/resources/evaluations.ts b/src/resources/evaluations.ts old mode 100755 new mode 100644 diff --git a/src/resources/index.ts b/src/resources/index.ts old mode 100755 new mode 100644 diff --git a/src/resources/prompts.ts b/src/resources/prompts.ts old mode 100755 new mode 100644 diff --git a/src/resources/tools.ts b/src/resources/tools.ts old mode 100755 new mode 100644 diff --git a/src/shims/node.ts b/src/shims/node.ts old mode 100755 new mode 100644 diff --git a/src/shims/web.ts b/src/shims/web.ts old mode 100755 new mode 100644 diff --git a/src/uploads.ts b/src/uploads.ts old mode 100755 new mode 100644 diff --git a/src/version.ts b/src/version.ts old mode 100755 new mode 100644 diff --git a/tests/api-resources/completion.test.ts b/tests/api-resources/completion.test.ts old mode 100755 new mode 100644 diff --git a/tests/api-resources/evaluation-assertions.test.ts b/tests/api-resources/evaluation-assertions.test.ts old mode 100755 new mode 100644 diff --git a/tests/api-resources/evaluations.test.ts b/tests/api-resources/evaluations.test.ts old mode 100755 new mode 100644 diff --git a/tests/api-resources/prompts.test.ts b/tests/api-resources/prompts.test.ts old mode 100755 new mode 100644 diff --git a/tests/api-resources/tools.test.ts b/tests/api-resources/tools.test.ts old mode 100755 new mode 100644 diff --git a/tests/form.test.ts b/tests/form.test.ts old mode 100755 new mode 100644 diff --git a/tests/index.test.ts b/tests/index.test.ts old mode 100755 new mode 100644 diff --git a/tests/responses.test.ts b/tests/responses.test.ts old mode 100755 new mode 100644 diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts old mode 100755 new mode 100644 diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts old mode 100755 new mode 100644 diff --git a/tsc-multi.json b/tsc-multi.json old mode 100755 new mode 100644 diff --git a/tsconfig.build.json b/tsconfig.build.json old mode 100755 new mode 100644 diff --git a/tsconfig.deno.json b/tsconfig.deno.json old mode 100755 new mode 100644 diff --git a/tsconfig.dist-src.json b/tsconfig.dist-src.json old mode 100755 new mode 100644 diff --git a/tsconfig.json b/tsconfig.json old mode 100755 new mode 100644 From 80d0a53aefee1441308ae23ef509a3672692a5c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:59:36 +0000 Subject: [PATCH 26/31] feat(api): OpenAPI spec update via Stainless API (#311) --- .stats.yml | 2 +- api.md | 4 +- src/index.ts | 2 +- src/resources/index.ts | 2 +- src/resources/prompts.ts | 443 ++++++++++++++++++++------------------- 5 files changed, 237 insertions(+), 216 deletions(-) diff --git a/.stats.yml b/.stats.yml index 112acec..0222f21 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-d232bc0a3409f271bb778f567e5caeb18bea44e721c3d82a78f475f9ca3faa2b.yml diff --git a/api.md b/api.md index 23342fa..05b561b 100644 --- a/api.md +++ b/api.md @@ -12,10 +12,10 @@ Methods: Types: -- Parameters - PromptConfiguration - PromptListResponse - PromptDeleteResponse +- PromptGetParametersResponse Methods: @@ -24,7 +24,7 @@ Methods: - client.prompts.list() -> PromptListResponse - client.prompts.delete(id) -> PromptDeleteResponse - client.prompts.get(id) -> PromptConfiguration -- client.prompts.getParameters(id, { ...params }) -> Parameters +- client.prompts.getParameters(id, { ...params }) -> PromptGetParametersResponse # Tools diff --git a/src/index.ts b/src/index.ts index 450e5c3..f15b7d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,10 +194,10 @@ export namespace PromptFoundry { export import CompletionCreateParams = API.CompletionCreateParams; export import Prompts = API.Prompts; - export import Parameters = API.Parameters; export import PromptConfiguration = API.PromptConfiguration; export import PromptListResponse = API.PromptListResponse; export import PromptDeleteResponse = API.PromptDeleteResponse; + export import PromptGetParametersResponse = API.PromptGetParametersResponse; export import PromptCreateParams = API.PromptCreateParams; export import PromptUpdateParams = API.PromptUpdateParams; export import PromptGetParametersParams = API.PromptGetParametersParams; diff --git a/src/resources/index.ts b/src/resources/index.ts index e2f5def..1d67965 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -19,10 +19,10 @@ export { EvaluationAssertions, } from './evaluation-assertions'; export { - Parameters, PromptConfiguration, PromptListResponse, PromptDeleteResponse, + PromptGetParametersResponse, PromptCreateParams, PromptUpdateParams, PromptGetParametersParams, diff --git a/src/resources/prompts.ts b/src/resources/prompts.ts index 14f1ce1..b93a556 100644 --- a/src/resources/prompts.ts +++ b/src/resources/prompts.ts @@ -56,13 +56,13 @@ export class Prompts extends APIResource { id: string, body?: PromptGetParametersParams, options?: Core.RequestOptions, - ): Core.APIPromise; - getParameters(id: string, options?: Core.RequestOptions): Core.APIPromise; + ): Core.APIPromise; + getParameters(id: string, options?: Core.RequestOptions): Core.APIPromise; getParameters( id: string, body: PromptGetParametersParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(body)) { return this.getParameters(id, {}, body); } @@ -70,18 +70,207 @@ export class Prompts extends APIResource { } } -export type Parameters = Parameters.AnthropicModelParameters | Parameters.OpenAIModelParameters; +export interface PromptConfiguration { + /** + * Example: "PROMPT_1" + */ + id: string; + + /** + * The configured messages WITHOUT variables replaced. + */ + messages: Array; + + /** + * Example: "Check the weather" + */ + name: string; + + parameters: PromptConfiguration.Parameters; + + tools: Array; +} + +export namespace PromptConfiguration { + export interface Message { + content: Array< + | Message.TextContentBlock + | Message.ImageBase64ContentBlock + | Message.ToolCallContentBlock + | Message.ToolResultContentBlock + >; + + role: 'assistant' | 'system' | 'tool' | 'user'; + } + + export namespace Message { + export interface TextContentBlock { + text: string; + + type: 'TEXT'; + } + + export interface ImageBase64ContentBlock { + imageBase64: string; + + mediaType: string; + + type: 'IMAGE_BASE64'; + } + + export interface ToolCallContentBlock { + toolCall: ToolCallContentBlock.ToolCall; + + type: 'TOOL_CALL'; + } + + export namespace ToolCallContentBlock { + export interface ToolCall { + function: ToolCall.Function; + + /** + * TOOL_CALL_1 + */ + toolCallId: string; + + /** + * The type of the tool. Currently, only `function` is supported. + */ + type: 'function'; + } + + export namespace ToolCall { + export interface Function { + /** + * The arguments to call the function with, as generated by the model in JSON + * format. Note that the model does not always generate valid JSON, and may + * hallucinate parameters not defined by your function schema. Validate the + * arguments in your code before calling your function. + */ + arguments: string; + + /** + * The name of the function to call. + */ + name: string; + } + } + } + + export interface ToolResultContentBlock { + result: string; + + toolCallId: string; + + type: 'TOOL_RESULT'; + } + } + + export interface Parameters { + /** + * Example: 0 + */ + frequencyPenalty: number; + + /** + * Example: 100 + */ + maxTokens: number | null; + + /** + * The name of the model for the provider. + */ + name: string; + + parallelToolCalls: boolean; + + /** + * Example: 0 + */ + presencePenalty: number; + + /** + * The LLM model provider. + */ + provider: 'ANTHROPIC' | 'OPENAI'; + + /** + * Example: PromptResponseFormat.TEXT + */ + responseFormat: 'JSON' | 'TEXT'; + + /** + * Example: 97946543 + */ + seed: number | null; + + stream: boolean; + + /** + * Example: 1 + */ + temperature: number; + + toolChoice: string | null; + + /** + * Example: 50 + */ + topK: number | null; -export namespace Parameters { - export interface AnthropicModelParameters { + /** + * Example: 1 + */ + topP: number; + } + + export interface Tool { + /** + * The initial messages to be included with your call to the LLM API. + */ + id: string; + + /** + * A description of what the tool does, used by the model to choose when and how to + * call the tool. + */ + description: string; + + /** + * The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores + * and dashes, with a maximum length of 64. + */ name: string; - parameters: AnthropicModelParameters.Parameters; + /** + * The parameters the functions accepts, described as a JSON Schema object. This + * schema is designed to match the TypeScript Record, allowing for + * any properties with values of any type. + */ + parameters: Record; + } +} + +export type PromptListResponse = Array; + +export interface PromptDeleteResponse { + success?: boolean; +} + +export type PromptGetParametersResponse = + | PromptGetParametersResponse.AnthropicModelNonStreamingParameters + | PromptGetParametersResponse.OpenAIModelNonStreamingParameters; + +export namespace PromptGetParametersResponse { + export interface AnthropicModelNonStreamingParameters { + name: string; + + parameters: AnthropicModelNonStreamingParameters.Parameters; provider: 'anthropic'; } - export namespace AnthropicModelParameters { + export namespace AnthropicModelNonStreamingParameters { export interface Parameters { max_tokens: number; @@ -94,12 +283,12 @@ export namespace Parameters { | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307'; + stream: false; + metadata?: Parameters.Metadata; stop_sequences?: Array; - stream?: boolean; - system?: string; temperature?: number; @@ -237,15 +426,15 @@ export namespace Parameters { } } - export interface OpenAIModelParameters { + export interface OpenAIModelNonStreamingParameters { name: string; - parameters: OpenAIModelParameters.Parameters; + parameters: OpenAIModelNonStreamingParameters.Parameters; provider: 'openai'; } - export namespace OpenAIModelParameters { + export namespace OpenAIModelNonStreamingParameters { export interface Parameters { messages: Array< | Parameters.OpenAIChatCompletionRequestSystemMessage @@ -257,6 +446,13 @@ export namespace Parameters { model: string; + response_format: + | Parameters.OpenAIResponseFormatText + | Parameters.OpenAIResponseFormatJsonObject + | Parameters.OpenAIResponseFormatJsonSchema; + + stream: false; + frequency_penalty?: number | null; logit_bias?: Record | null; @@ -271,16 +467,10 @@ export namespace Parameters { presence_penalty?: number | null; - response_format?: Parameters.ResponseFormat; - seed?: number | null; stop?: string | Array; - stream?: boolean | null; - - stream_options?: Parameters.StreamOptions | null; - temperature?: number | null; tool_choice?: 'none' | 'auto' | 'required' | Parameters.OpenAIChatCompletionNamedToolChoice; @@ -390,12 +580,30 @@ export namespace Parameters { role: 'function'; } - export interface ResponseFormat { - type?: 'text' | 'json_object'; + export interface OpenAIResponseFormatText { + type: 'text'; + } + + export interface OpenAIResponseFormatJsonObject { + type: 'json_object'; } - export interface StreamOptions { - include_usage: boolean; + export interface OpenAIResponseFormatJsonSchema { + json_schema: OpenAIResponseFormatJsonSchema.JsonSchema; + + type: 'json_schema'; + } + + export namespace OpenAIResponseFormatJsonSchema { + export interface JsonSchema { + name: string; + + strict: boolean | null; + + description?: string; + + schema?: Record; + } } export interface OpenAIChatCompletionNamedToolChoice { @@ -429,193 +637,6 @@ export namespace Parameters { } } -export interface PromptConfiguration { - /** - * Example: "PROMPT_1" - */ - id: string; - - /** - * The configured messages WITHOUT variables replaced. - */ - messages: Array; - - /** - * Example: "Check the weather" - */ - name: string; - - parameters: PromptConfiguration.Parameters; - - tools: Array; -} - -export namespace PromptConfiguration { - export interface Message { - content: Array< - | Message.TextContentBlock - | Message.ImageBase64ContentBlock - | Message.ToolCallContentBlock - | Message.ToolResultContentBlock - >; - - role: 'assistant' | 'system' | 'tool' | 'user'; - } - - export namespace Message { - export interface TextContentBlock { - text: string; - - type: 'TEXT'; - } - - export interface ImageBase64ContentBlock { - imageBase64: string; - - mediaType: string; - - type: 'IMAGE_BASE64'; - } - - export interface ToolCallContentBlock { - toolCall: ToolCallContentBlock.ToolCall; - - type: 'TOOL_CALL'; - } - - export namespace ToolCallContentBlock { - export interface ToolCall { - function: ToolCall.Function; - - /** - * TOOL_CALL_1 - */ - toolCallId: string; - - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; - } - - export namespace ToolCall { - export interface Function { - /** - * The arguments to call the function with, as generated by the model in JSON - * format. Note that the model does not always generate valid JSON, and may - * hallucinate parameters not defined by your function schema. Validate the - * arguments in your code before calling your function. - */ - arguments: string; - - /** - * The name of the function to call. - */ - name: string; - } - } - } - - export interface ToolResultContentBlock { - result: string; - - toolCallId: string; - - type: 'TOOL_RESULT'; - } - } - - export interface Parameters { - /** - * Example: 0 - */ - frequencyPenalty: number; - - /** - * Example: 100 - */ - maxTokens: number | null; - - /** - * The name of the model for the provider. - */ - name: string; - - parallelToolCalls: boolean; - - /** - * Example: 0 - */ - presencePenalty: number; - - /** - * The LLM model provider. - */ - provider: 'ANTHROPIC' | 'OPENAI'; - - /** - * Example: PromptResponseFormat.TEXT - */ - responseFormat: 'JSON' | 'TEXT'; - - /** - * Example: 97946543 - */ - seed: number | null; - - stream: boolean; - - /** - * Example: 1 - */ - temperature: number; - - toolChoice: string | null; - - /** - * Example: 50 - */ - topK: number | null; - - /** - * Example: 1 - */ - topP: number; - } - - export interface Tool { - /** - * The initial messages to be included with your call to the LLM API. - */ - id: string; - - /** - * A description of what the tool does, used by the model to choose when and how to - * call the tool. - */ - description: string; - - /** - * The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores - * and dashes, with a maximum length of 64. - */ - name: string; - - /** - * The parameters the functions accepts, described as a JSON Schema object. This - * schema is designed to match the TypeScript Record, allowing for - * any properties with values of any type. - */ - parameters: Record; - } -} - -export type PromptListResponse = Array; - -export interface PromptDeleteResponse { - success?: boolean; -} - export interface PromptCreateParams { messages: Array; @@ -1091,10 +1112,10 @@ export namespace PromptGetParametersParams { } export namespace Prompts { - export import Parameters = PromptsAPI.Parameters; export import PromptConfiguration = PromptsAPI.PromptConfiguration; export import PromptListResponse = PromptsAPI.PromptListResponse; export import PromptDeleteResponse = PromptsAPI.PromptDeleteResponse; + export import PromptGetParametersResponse = PromptsAPI.PromptGetParametersResponse; export import PromptCreateParams = PromptsAPI.PromptCreateParams; export import PromptUpdateParams = PromptsAPI.PromptUpdateParams; export import PromptGetParametersParams = PromptsAPI.PromptGetParametersParams; From 14613c4fc73afd6fadaae1fb9e1de40af7edc889 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:00:00 +0000 Subject: [PATCH 27/31] chore(internal): codegen related update (#312) --- src/uploads.ts | 8 +++++--- tests/uploads.test.ts | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/uploads.ts b/src/uploads.ts index a920351..8fd2154 100644 --- a/src/uploads.ts +++ b/src/uploads.ts @@ -107,8 +107,10 @@ export async function toFile( // If it's a promise, resolve it. value = await value; - // Use the file's options if there isn't one provided - options ??= isFileLike(value) ? { lastModified: value.lastModified, type: value.type } : {}; + // If we've been given a `File` we don't need to do anything + if (isFileLike(value)) { + return value; + } if (isResponseLike(value)) { const blob = await value.blob(); @@ -126,7 +128,7 @@ export async function toFile( name ||= getName(value) ?? 'unknown_file'; - if (!options.type) { + if (!options?.type) { const type = (bits[0] as any)?.type; if (typeof type === 'string') { options = { ...options, type }; diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index a3d1e4e..bc09a5c 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -54,4 +54,12 @@ describe('toFile', () => { const file = await toFile(input); expect(file.name).toEqual('uploads.test.ts'); }); + + it('does not copy File objects', async () => { + const input = new File(['foo'], 'input.jsonl', { type: 'jsonl' }); + const file = await toFile(input); + expect(file).toBe(input); + expect(file.name).toEqual('input.jsonl'); + expect(file.type).toBe('jsonl'); + }); }); From 694c64f2fa194e9bc5497facd1671efd7b300f5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:00:48 +0000 Subject: [PATCH 28/31] fix(errors): pass message through to APIConnectionError (#313) --- src/error.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.ts b/src/error.ts index 1ab40d7..fc81972 100644 --- a/src/error.ts +++ b/src/error.ts @@ -49,7 +49,7 @@ export class APIError extends PromptFoundryError { headers: Headers | undefined, ) { if (!status) { - return new APIConnectionError({ cause: castToError(errorResponse) }); + return new APIConnectionError({ message, cause: castToError(errorResponse) }); } const error = errorResponse as Record; @@ -101,7 +101,7 @@ export class APIUserAbortError extends APIError { export class APIConnectionError extends APIError { override readonly status: undefined = undefined; - constructor({ message, cause }: { message?: string; cause?: Error | undefined }) { + constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared // @ts-ignore From 2aa9f07f487316818567b6963dce705d48d8233e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:01:12 +0000 Subject: [PATCH 29/31] chore: better object fallback behaviour for casting errors (#314) --- src/core.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core.ts b/src/core.ts index 266498c..99e8d9c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -978,6 +978,11 @@ const validatePositiveInteger = (name: string, n: unknown): number => { export const castToError = (err: any): Error => { if (err instanceof Error) return err; + if (typeof err === 'object' && err !== null) { + try { + return new Error(JSON.stringify(err)); + } catch {} + } return new Error(err); }; From d24e88f6ed1cfc692972c6200d89e6b2d5f2cc07 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:10:02 +0000 Subject: [PATCH 30/31] docs: update CONTRIBUTING.md (#315) --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a23c828..42d1f88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,13 +14,13 @@ This will install all the required dependencies and build output files to `dist/ ## Modifying/Adding code -Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/lib/` and `examples/` directories are exceptions and will never be overridden. +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `src/lib/` and `examples/` directories. ## Adding and running examples -All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or -added to. +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. ```bash // add an example to examples/.ts From 13a8ec8b4240fc80b4451d4bf7efe80b8470bba6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:10:26 +0000 Subject: [PATCH 31/31] release: 1.19.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 38 +++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 18e9f06..d0d087a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.18.0" + ".": "1.19.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e527a3..430e7f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # Changelog +## 1.19.0 (2024-09-14) + +Full Changelog: [v1.18.0...v1.19.0](https://github.com/prompt-foundry/typescript-sdk/compare/v1.18.0...v1.19.0) + +### Features + +* **api:** OpenAPI spec update via Stainless API ([#296](https://github.com/prompt-foundry/typescript-sdk/issues/296)) ([b109397](https://github.com/prompt-foundry/typescript-sdk/commit/b1093976c3be6e8389d65d127ebe856d2a34ff9b)) +* **api:** OpenAPI spec update via Stainless API ([#298](https://github.com/prompt-foundry/typescript-sdk/issues/298)) ([22df253](https://github.com/prompt-foundry/typescript-sdk/commit/22df253af20a541055c4343da65e7ef0774980b0)) +* **api:** OpenAPI spec update via Stainless API ([#299](https://github.com/prompt-foundry/typescript-sdk/issues/299)) ([aeb5bd3](https://github.com/prompt-foundry/typescript-sdk/commit/aeb5bd3613548139d4fbf332a2f48ef110ac87b1)) +* **api:** OpenAPI spec update via Stainless API ([#300](https://github.com/prompt-foundry/typescript-sdk/issues/300)) ([ab92cbf](https://github.com/prompt-foundry/typescript-sdk/commit/ab92cbf32a5e3373825d653b8b19ecdbd93c6fe7)) +* **api:** OpenAPI spec update via Stainless API ([#301](https://github.com/prompt-foundry/typescript-sdk/issues/301)) ([0cd49b4](https://github.com/prompt-foundry/typescript-sdk/commit/0cd49b4545499086879da70f5f620e90b189a6e6)) +* **api:** OpenAPI spec update via Stainless API ([#302](https://github.com/prompt-foundry/typescript-sdk/issues/302)) ([c78917f](https://github.com/prompt-foundry/typescript-sdk/commit/c78917fe2d358ba099969afb3a7982614c693c75)) +* **api:** OpenAPI spec update via Stainless API ([#303](https://github.com/prompt-foundry/typescript-sdk/issues/303)) ([dd0b8fb](https://github.com/prompt-foundry/typescript-sdk/commit/dd0b8fb614803dd001962871ad6964c0c48b8751)) +* **api:** OpenAPI spec update via Stainless API ([#304](https://github.com/prompt-foundry/typescript-sdk/issues/304)) ([cdd4c5f](https://github.com/prompt-foundry/typescript-sdk/commit/cdd4c5fa4a07b7e7e84e424bd6c56e92f0c16559)) +* **api:** OpenAPI spec update via Stainless API ([#305](https://github.com/prompt-foundry/typescript-sdk/issues/305)) ([9d85271](https://github.com/prompt-foundry/typescript-sdk/commit/9d85271e34f76fbf1dcb2b9f37e05d88f10bdb2e)) +* **api:** OpenAPI spec update via Stainless API ([#308](https://github.com/prompt-foundry/typescript-sdk/issues/308)) ([1c39d23](https://github.com/prompt-foundry/typescript-sdk/commit/1c39d23aaf9c86dd2eebd094ca2f768bd4ea2291)) +* **api:** OpenAPI spec update via Stainless API ([#311](https://github.com/prompt-foundry/typescript-sdk/issues/311)) ([80d0a53](https://github.com/prompt-foundry/typescript-sdk/commit/80d0a53aefee1441308ae23ef509a3672692a5c7)) + + +### Bug Fixes + +* **client:** correct File construction from node-fetch Responses ([#309](https://github.com/prompt-foundry/typescript-sdk/issues/309)) ([30fb68e](https://github.com/prompt-foundry/typescript-sdk/commit/30fb68e1fa8fcbecc0372d6357d7258fa04655b8)) +* **errors:** pass message through to APIConnectionError ([#313](https://github.com/prompt-foundry/typescript-sdk/issues/313)) ([694c64f](https://github.com/prompt-foundry/typescript-sdk/commit/694c64f2fa194e9bc5497facd1671efd7b300f5e)) + + +### Chores + +* better object fallback behaviour for casting errors ([#314](https://github.com/prompt-foundry/typescript-sdk/issues/314)) ([2aa9f07](https://github.com/prompt-foundry/typescript-sdk/commit/2aa9f07f487316818567b6963dce705d48d8233e)) +* **ci:** check for build errors ([#297](https://github.com/prompt-foundry/typescript-sdk/issues/297)) ([2b8b0d7](https://github.com/prompt-foundry/typescript-sdk/commit/2b8b0d7841454afe4a164217a1cccd7e3d58e2a5)) +* **ci:** install deps via ./script/bootstrap ([#307](https://github.com/prompt-foundry/typescript-sdk/issues/307)) ([8b757ee](https://github.com/prompt-foundry/typescript-sdk/commit/8b757ee63f894eb9498d575f2155732703d10995)) +* **internal:** codegen related update ([#312](https://github.com/prompt-foundry/typescript-sdk/issues/312)) ([14613c4](https://github.com/prompt-foundry/typescript-sdk/commit/14613c4fc73afd6fadaae1fb9e1de40af7edc889)) +* run tsc as part of lint script ([#306](https://github.com/prompt-foundry/typescript-sdk/issues/306)) ([e19c47f](https://github.com/prompt-foundry/typescript-sdk/commit/e19c47f427c47c2a645f03e1b1e2934acd5bc27e)) + + +### Documentation + +* update CONTRIBUTING.md ([#315](https://github.com/prompt-foundry/typescript-sdk/issues/315)) ([d24e88f](https://github.com/prompt-foundry/typescript-sdk/commit/d24e88f6ed1cfc692972c6200d89e6b2d5f2cc07)) + ## 1.18.0 (2024-08-26) Full Changelog: [v1.17.0...v1.18.0](https://github.com/prompt-foundry/typescript-sdk/compare/v1.17.0...v1.18.0) diff --git a/package.json b/package.json index 6348e0d..9ab7ba8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prompt-foundry/typescript-sdk", - "version": "1.18.0", + "version": "1.19.0", "description": "The official TypeScript library for the Prompt Foundry API", "author": "Prompt Foundry ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 2f0d0ca..0158408 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.18.0'; // x-release-please-version +export const VERSION = '1.19.0'; // x-release-please-version