Skip to content

Commit

Permalink
Merge pull request #15 from jxnl/context-labs-main
Browse files Browse the repository at this point in the history
build, package, publish from sam
  • Loading branch information
jxnl authored Jan 2, 2024
2 parents db078a5 + 2a752d5 commit 29a9e59
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "instructor",
"name": "instructor-js",
"version": "0.0.1",
"description": "structured outputs for llms",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/index.js"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "tsc",
Expand All @@ -26,7 +32,7 @@
},
"homepage": "https://github.com/jxnl/instructor-js#readme",
"dependencies": {
"openai": "^4.24.1",
"openai": "^4.24.1",
"zod": "^3.22.4",
"zod-to-json-schema": "^3.22.3"
},
Expand Down
1 change: 1 addition & 0 deletions src/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export const patch = ({
);
delete args[0].response_model;
delete args[0].max_retries;

while (retries < max_retries) {
try {
response = (await target.apply(
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"declaration": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
"exclude": ["examples", "node_modules", "dist"]
}

0 comments on commit 29a9e59

Please sign in to comment.