Skip to content

Commit

Permalink
Merge pull request #254 from prompt-foundry/release-please--branches-…
Browse files Browse the repository at this point in the history
…-main--changes--next--components--typescript-sdk

release: 1.17.0
  • Loading branch information
anthonyjgrove authored Aug 22, 2024
2 parents e20bc0a + 2a209a0 commit c5493bb
Show file tree
Hide file tree
Showing 90 changed files with 345 additions and 250 deletions.
Empty file modified .devcontainer/Dockerfile
100644 → 100755
Empty file.
Empty file modified .devcontainer/devcontainer.json
100644 → 100755
Empty file.
Empty file modified .eslintrc.js
100644 → 100755
Empty file.
Empty file modified .github/workflows/ci.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/publish-npm.yml
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .github/workflows/release-doctor.yml
100644 → 100755
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.PROMPT_FOUNDRY_NPM_TOKEN || secrets.NPM_TOKEN }}

1 change: 0 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ dist
/*.tgz
.idea/

build/tsconfig.tsbuildinfo
Empty file modified .prettierignore
100644 → 100755
Empty file.
Empty file modified .prettierrc.json
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.16.0"
".": "1.17.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-9cff8ea13f14bd0899df69243fe78b4f88d4d0172263aa260af1ea66a7d0484e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/prompt-foundry%2Fprompt-foundry-sdk-84eb1e848fd165a965df78740df71651a8b413f023e5fdb6eb1acb9cce08e006.yml
Empty file modified Brewfile
100644 → 100755
Empty file.
83 changes: 83 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified SECURITY.md
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions api.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Methods:

Types:

- <code><a href="./src/resources/prompts.ts">ModelParameters</a></code>
- <code><a href="./src/resources/prompts.ts">Parameters</a></code>
- <code><a href="./src/resources/prompts.ts">PromptConfiguration</a></code>
- <code><a href="./src/resources/prompts.ts">PromptListResponse</a></code>
- <code><a href="./src/resources/prompts.ts">PromptDeleteResponse</a></code>
Expand All @@ -24,7 +24,7 @@ Methods:
- <code title="get /sdk/v1/prompts">client.prompts.<a href="./src/resources/prompts.ts">list</a>() -> PromptListResponse</code>
- <code title="delete /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">delete</a>(id) -> PromptDeleteResponse</code>
- <code title="get /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">get</a>(id) -> PromptConfiguration</code>
- <code title="post /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">getParameters</a>(id, { ...params }) -> ModelParameters</code>
- <code title="post /sdk/v1/prompts/{id}">client.prompts.<a href="./src/resources/prompts.ts">getParameters</a>(id, { ...params }) -> Parameters</code>

# Tools

Expand Down
1 change: 1 addition & 0 deletions bin/check-release-environment
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ if [[ lenErrors -gt 0 ]]; then
fi

echo "The environment is ready to push releases!"

20 changes: 18 additions & 2 deletions bin/publish-npm
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@

set -eux

npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"

# Build the project
yarn build

# Navigate to the dist directory
cd dist
yarn publish --access public

# Get the version from package.json
VERSION="$(node -p "require('./package.json').version")"

# Extract the pre-release tag if it exists
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
# Extract the part before any dot in the pre-release identifier
TAG="${BASH_REMATCH[1]}"
else
TAG="latest"
fi

# Publish with the appropriate tag
yarn publish --access public --tag "$TAG"
Empty file modified examples/.keep
100644 → 100755
Empty file.
Empty file modified jest.config.ts
100644 → 100755
Empty file.
17 changes: 3 additions & 14 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
{
"name": "@prompt-foundry/typescript-sdk",
"version": "1.16.0",
"description": "The prompt engineering, prompt management, and prompt evaluation tool for TypeScript, JavaScript, and NodeJS.",
"keywords": [
"typescript",
"javascript",
"nodejs",
"sdk",
"prompt",
"prompt-engineering",
"prompt-management",
"prompt-testing",
"openai"
],
"version": "1.17.0",
"description": "The official TypeScript library for the Prompt Foundry API",
"author": "Prompt Foundry <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand All @@ -32,7 +21,7 @@
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "./scripts/lint",
"fix": "eslint --fix --ext ts,js ."
"fix": "./scripts/format"
},
"dependencies": {
"@types/node": "^18.11.18",
Expand Down
Empty file modified release-please-config.json
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
cd "$(dirname "$0")/.."

echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix --ext ts,js .
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js .
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
cd "$(dirname "$0")/.."

echo "==> Running eslint"
./node_modules/.bin/eslint --ext ts,js .
ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js .
4 changes: 2 additions & 2 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stainless-api/[email protected].5 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
Expand All @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec --package=@stainless-api/[email protected].4 -- prism mock "$URL"
npm exec --package=@stainless-api/[email protected].5 -- prism mock "$URL"
fi
Empty file modified scripts/utils/check-version.cjs
100644 → 100755
Empty file.
Empty file modified scripts/utils/fix-index-exports.cjs
100644 → 100755
Empty file.
Empty file modified scripts/utils/make-dist-package-json.cjs
100644 → 100755
Empty file.
Empty file modified scripts/utils/postprocess-files.cjs
100644 → 100755
Empty file.
Empty file modified src/_shims/MultipartBody.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/README.md
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/runtime-bun.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/runtime-deno.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/runtime-node.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/runtime.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/types-deno.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/types-node.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/types.d.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/types.js
100644 → 100755
Empty file.
Empty file modified src/_shims/auto/types.mjs
100644 → 100755
Empty file.
Empty file modified src/_shims/bun-runtime.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/index-deno.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/index.d.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/index.js
100644 → 100755
Empty file.
Empty file modified src/_shims/index.mjs
100644 → 100755
Empty file.
Empty file modified src/_shims/manual-types.d.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/manual-types.js
100644 → 100755
Empty file.
Empty file modified src/_shims/manual-types.mjs
100644 → 100755
Empty file.
Empty file modified src/_shims/node-runtime.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/node-types.d.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/node-types.js
100644 → 100755
Empty file.
Empty file modified src/_shims/node-types.mjs
100644 → 100755
Empty file.
Empty file modified src/_shims/registry.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/web-runtime.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/web-types.d.ts
100644 → 100755
Empty file.
Empty file modified src/_shims/web-types.js
100644 → 100755
Empty file.
Empty file modified src/_shims/web-types.mjs
100644 → 100755
Empty file.
Empty file modified src/core.ts
100644 → 100755
Empty file.
Empty file modified src/error.ts
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/index.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export namespace PromptFoundry {
export import CompletionCreateParams = API.CompletionCreateParams;

export import Prompts = API.Prompts;
export import ModelParameters = API.ModelParameters;
export import Parameters = API.Parameters;
export import PromptConfiguration = API.PromptConfiguration;
export import PromptListResponse = API.PromptListResponse;
export import PromptDeleteResponse = API.PromptDeleteResponse;
Expand Down
Empty file modified src/lib/.keep
100644 → 100755
Empty file.
Empty file modified src/resource.ts
100644 → 100755
Empty file.
19 changes: 13 additions & 6 deletions src/resources/completion.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ export interface CompletionCreateResponse {
*/
message: CompletionCreateResponse.Message;

name: string;

/**
* The LLM model provider.
*/
provider: 'ANTHROPIC' | 'OPENAI';

stats: CompletionCreateResponse.Stats;
}

Expand All @@ -45,7 +52,7 @@ export namespace CompletionCreateResponse {
*/
export interface Message {
content: Array<
| Message.TextContentBlockSchema
| Message.TextContentBlock
| Message.ImageBase64ContentBlock
| Message.ToolCallContentBlock
| Message.ToolResultContentBlock
Expand All @@ -55,7 +62,7 @@ export namespace CompletionCreateResponse {
}

export namespace Message {
export interface TextContentBlockSchema {
export interface TextContentBlock {
text: string;

type: 'TEXT';
Expand Down Expand Up @@ -167,7 +174,7 @@ export interface CompletionCreateParams {
export namespace CompletionCreateParams {
export interface AppendMessage {
content: Array<
| AppendMessage.TextContentBlockSchema
| AppendMessage.TextContentBlock
| AppendMessage.ImageBase64ContentBlock
| AppendMessage.ToolCallContentBlock
| AppendMessage.ToolResultContentBlock
Expand All @@ -177,7 +184,7 @@ export namespace CompletionCreateParams {
}

export namespace AppendMessage {
export interface TextContentBlockSchema {
export interface TextContentBlock {
text: string;

type: 'TEXT';
Expand Down Expand Up @@ -241,7 +248,7 @@ export namespace CompletionCreateParams {

export interface OverrideMessage {
content: Array<
| OverrideMessage.TextContentBlockSchema
| OverrideMessage.TextContentBlock
| OverrideMessage.ImageBase64ContentBlock
| OverrideMessage.ToolCallContentBlock
| OverrideMessage.ToolResultContentBlock
Expand All @@ -251,7 +258,7 @@ export namespace CompletionCreateParams {
}

export namespace OverrideMessage {
export interface TextContentBlockSchema {
export interface TextContentBlock {
text: string;

type: 'TEXT';
Expand Down
Empty file modified src/resources/evaluation-assertions.ts
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions src/resources/evaluations.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface Evaluation {
export namespace Evaluation {
export interface AppendedMessage {
content: Array<
| AppendedMessage.TextContentBlockSchema
| AppendedMessage.TextContentBlock
| AppendedMessage.ImageBase64ContentBlock
| AppendedMessage.ToolCallContentBlock
| AppendedMessage.ToolResultContentBlock
Expand All @@ -84,7 +84,7 @@ export namespace Evaluation {
}

export namespace AppendedMessage {
export interface TextContentBlockSchema {
export interface TextContentBlock {
text: string;

type: 'TEXT';
Expand Down Expand Up @@ -180,7 +180,7 @@ export interface EvaluationCreateParams {
export namespace EvaluationCreateParams {
export interface AppendedMessage {
content: Array<
| AppendedMessage.TextContentBlockSchema
| AppendedMessage.TextContentBlock
| AppendedMessage.ImageBase64ContentBlock
| AppendedMessage.ToolCallContentBlock
| AppendedMessage.ToolResultContentBlock
Expand All @@ -190,7 +190,7 @@ export namespace EvaluationCreateParams {
}

export namespace AppendedMessage {
export interface TextContentBlockSchema {
export interface TextContentBlock {
text: string;

type: 'TEXT';
Expand Down Expand Up @@ -280,7 +280,7 @@ export interface EvaluationUpdateParams {
export namespace EvaluationUpdateParams {
export interface AppendedMessage {
content: Array<
| AppendedMessage.TextContentBlockSchema
| AppendedMessage.TextContentBlock
| AppendedMessage.ImageBase64ContentBlock
| AppendedMessage.ToolCallContentBlock
| AppendedMessage.ToolResultContentBlock
Expand All @@ -290,7 +290,7 @@ export namespace EvaluationUpdateParams {
}

export namespace AppendedMessage {
export interface TextContentBlockSchema {
export interface TextContentBlock {
text: string;

type: 'TEXT';
Expand Down
2 changes: 1 addition & 1 deletion src/resources/index.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export {
EvaluationAssertions,
} from './evaluation-assertions';
export {
ModelParameters,
Parameters,
PromptConfiguration,
PromptListResponse,
PromptDeleteResponse,
Expand Down
Loading

0 comments on commit c5493bb

Please sign in to comment.