From 1fed037b9d383974f1ae9f110a18155070511d0b Mon Sep 17 00:00:00 2001 From: Ken Collins Date: Fri, 23 Aug 2024 21:16:54 -0400 Subject: [PATCH] Add esbuild for dev to dual package approach. --- .github/workflows/publish.yml | 4 + CHANGELOG.md | 6 + README.md | 2 + bin/build | 4 + bin/setup | 7 +- build.js | 27 ++ package-lock.json | 428 +++++++++++++++++++++++- package.json | 14 +- test/experts/assistant.test.js | 2 +- test/experts/thread.test.js | 2 +- test/fixtures/accountsAssistant.js | 4 +- test/fixtures/creativeAssistant.js | 4 +- test/fixtures/dataTool.js | 2 +- test/fixtures/echoAssistant.js | 2 +- test/fixtures/echoTool.js | 2 +- test/fixtures/eventedAssistant.js | 2 +- test/fixtures/htmlAssistant.js | 4 +- test/fixtures/oddFactsAssistant.js | 2 +- test/fixtures/productsAssistant.js | 2 +- test/fixtures/productsOpenSearchTool.js | 2 +- test/fixtures/productsTool.js | 2 +- test/fixtures/routerAssistant.js | 2 +- test/fixtures/testAssistant.js | 2 +- 23 files changed, 501 insertions(+), 27 deletions(-) create mode 100755 bin/build create mode 100644 build.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 47e378f..9fccba9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18 + - name: Install dependencies + run: npm ci + - name: Build + run: ./bin/build - name: Publish uses: JS-DevTools/npm-publish@v3 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dc162a..f4af61e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ See this http://keepachangelog.com link for information on how we want this document formatted. +## v1.5.0 + +### Added/Changed + +Use dual package approach. Now supports both ES6 import syntax and CommonJS require statements. + ## v1.4.3 ### Added diff --git a/README.md b/README.md index 08fa787..962ef51 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Install via npm. Usage is very simple, there are only three objects to import. npm install experts ``` +Experts.js supports both ES6 import syntax and CommonJS require statements. + ```javascript import { Assistant, Tool, Thread } from "experts"; ``` diff --git a/bin/build b/bin/build new file mode 100755 index 0000000..6427456 --- /dev/null +++ b/bin/build @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +node build.js diff --git a/bin/setup b/bin/setup index 8fd1740..a8509ad 100755 --- a/bin/setup +++ b/bin/setup @@ -1,6 +1,11 @@ #!/bin/sh set -e -npm install +if [ "$CI" = "true" ]; then + npm ci +else + npm install +fi + node test/products/create.js node test/products/index.js diff --git a/build.js b/build.js new file mode 100644 index 0000000..3cc7d7b --- /dev/null +++ b/build.js @@ -0,0 +1,27 @@ +import * as esbuild from "esbuild"; + +async function build() { + // Build ESM version + await esbuild.build({ + entryPoints: ["src/index.js"], + outfile: "dist/index.js", + format: "esm", + platform: "node", + target: "node14", + bundle: true, + }); + + // Build CommonJS version + await esbuild.build({ + entryPoints: ["src/index.js"], + outfile: "dist/index.cjs", + format: "cjs", + platform: "node", + target: "node14", + bundle: true, + }); + + console.log("Build complete"); +} + +build().catch(console.error); diff --git a/package-lock.json b/package-lock.json index 47f1fcb..9190be8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "experts", - "version": "1.4.3", + "version": "1.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "experts", - "version": "1.4.3", + "version": "1.5.0", "license": "MIT", "dependencies": { "eventemitter2": "^6.4.9", @@ -19,6 +19,7 @@ "babel-jest": "^29.7.0", "dotenv": "^16.4.5", "ejs": "^3.1.10", + "esbuild": "^0.23.1", "file-type": "^19.0.0", "jest": "^29.7.0", "jest-environment-node": "^29.7.0", @@ -591,6 +592,390 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1720,6 +2105,45 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", diff --git a/package.json b/package.json index 046b11c..d9f0dfd 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,20 @@ { "name": "experts", - "version": "1.4.3", + "version": "1.5.0", "description": "An opinionated panel of experts implementation using OpenAI's Assistants API", "type": "module", "main": "./src/index.js", "exports": { - ".": "./src/index.js", - "./thread": "./src/thread.js", - "./assistant": "./src/assistant.js", - "./tool": "./src/tool.js" + ".": { + "import": "./dist/index.js", + "require": "./dist/index.cjs" + } }, "scripts": { "setup": "./bin/setup", "test": "./bin/test", - "cleanup": "./bin/cleanup" + "cleanup": "./bin/cleanup", + "build": "./bin/build" }, "author": "Ken COllins", "license": "MIT", @@ -24,6 +25,7 @@ "babel-jest": "^29.7.0", "dotenv": "^16.4.5", "ejs": "^3.1.10", + "esbuild": "^0.23.1", "file-type": "^19.0.0", "jest": "^29.7.0", "jest-environment-node": "^29.7.0", diff --git a/test/experts/assistant.test.js b/test/experts/assistant.test.js index f451a83..2475aee 100644 --- a/test/experts/assistant.test.js +++ b/test/experts/assistant.test.js @@ -7,7 +7,7 @@ import { helperThreadID, } from "../helpers.js"; import { TestAssistant, TestIDAssistant } from "../fixtures.js"; -import { Thread } from "../../src/experts/thread.js"; +import { Thread } from "../../src/index.js"; beforeEach(() => { delete process.env.TEST_ASSISTANT_ID; diff --git a/test/experts/thread.test.js b/test/experts/thread.test.js index ab4d20b..0b444a9 100644 --- a/test/experts/thread.test.js +++ b/test/experts/thread.test.js @@ -1,7 +1,7 @@ import { helperThreadID, helperFindAssistant } from "../helpers.js"; import { TestAssistant } from "../fixtures.js"; -import { Thread } from "../../src/experts/thread.js"; +import { Thread } from "../../src/index.js"; test("creates a thread", async () => { const thread = await Thread.create(); diff --git a/test/fixtures/accountsAssistant.js b/test/fixtures/accountsAssistant.js index c6f43f7..c9fb750 100644 --- a/test/fixtures/accountsAssistant.js +++ b/test/fixtures/accountsAssistant.js @@ -1,6 +1,6 @@ import { helperName } from "../helpers.js"; -import { Tool } from "../../src/experts/tool.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Tool } from "../../src/index.js"; +import { Assistant } from "../../src/index.js"; class AccountsTool extends Tool { constructor() { diff --git a/test/fixtures/creativeAssistant.js b/test/fixtures/creativeAssistant.js index d156ca7..31bdc73 100644 --- a/test/fixtures/creativeAssistant.js +++ b/test/fixtures/creativeAssistant.js @@ -1,6 +1,6 @@ import { helperName } from "../helpers.js"; -import { Tool } from "../../src/experts/tool.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Tool } from "../../src/index.js"; +import { Assistant } from "../../src/index.js"; import { z } from "zod"; import { zodFunction, zodResponseFormat } from "openai/helpers/zod"; diff --git a/test/fixtures/dataTool.js b/test/fixtures/dataTool.js index e120a7f..5ec4744 100644 --- a/test/fixtures/dataTool.js +++ b/test/fixtures/dataTool.js @@ -1,7 +1,7 @@ import fs from "fs"; import { helperName, helperPath } from "../helpers.js"; import { openai } from "../../src/openai.js"; -import { Tool } from "../../src/experts/tool.js"; +import { Tool } from "../../src/index.js"; class DataTool extends Tool { constructor() { diff --git a/test/fixtures/echoAssistant.js b/test/fixtures/echoAssistant.js index 3d7a186..8170daa 100644 --- a/test/fixtures/echoAssistant.js +++ b/test/fixtures/echoAssistant.js @@ -1,5 +1,5 @@ import { helperName } from "../helpers.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Assistant } from "../../src/index.js"; class EchoAssistant extends Assistant { constructor() { diff --git a/test/fixtures/echoTool.js b/test/fixtures/echoTool.js index e0bf8a9..d8cc51e 100644 --- a/test/fixtures/echoTool.js +++ b/test/fixtures/echoTool.js @@ -1,5 +1,5 @@ import { helperName } from "../helpers.js"; -import { Tool } from "../../src/experts/tool.js"; +import { Tool } from "../../src/index.js"; class BasicEchoTool extends Tool { constructor() { diff --git a/test/fixtures/eventedAssistant.js b/test/fixtures/eventedAssistant.js index ecf4e4d..6a20116 100644 --- a/test/fixtures/eventedAssistant.js +++ b/test/fixtures/eventedAssistant.js @@ -1,5 +1,5 @@ import { helperName } from "../helpers.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Assistant } from "../../src/index.js"; class EventedAssistant extends Assistant { constructor() { diff --git a/test/fixtures/htmlAssistant.js b/test/fixtures/htmlAssistant.js index 2d075c7..9fafbfc 100644 --- a/test/fixtures/htmlAssistant.js +++ b/test/fixtures/htmlAssistant.js @@ -1,5 +1,5 @@ -import { Tool } from "../../src/experts/tool.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Tool } from "../../src/index.js"; +import { Assistant } from "../../src/index.js"; import { helperName } from "../helpers.js"; class MockDataTool extends Tool { diff --git a/test/fixtures/oddFactsAssistant.js b/test/fixtures/oddFactsAssistant.js index ae93c2b..7ee2ad1 100644 --- a/test/fixtures/oddFactsAssistant.js +++ b/test/fixtures/oddFactsAssistant.js @@ -1,6 +1,6 @@ import fs from "fs"; import { openai } from "../../src/openai.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Assistant } from "../../src/index.js"; import { helperName, helperPath } from "../helpers.js"; class OddFactsAssistant extends Assistant { diff --git a/test/fixtures/productsAssistant.js b/test/fixtures/productsAssistant.js index c0936f8..6d8c364 100644 --- a/test/fixtures/productsAssistant.js +++ b/test/fixtures/productsAssistant.js @@ -1,5 +1,5 @@ import { helperName } from "../helpers.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Assistant } from "../../src/index.js"; import { ProductsTool } from "./productsTool.js"; const INSTRUCTIONS = ` diff --git a/test/fixtures/productsOpenSearchTool.js b/test/fixtures/productsOpenSearchTool.js index af82100..4902d7b 100644 --- a/test/fixtures/productsOpenSearchTool.js +++ b/test/fixtures/productsOpenSearchTool.js @@ -1,7 +1,7 @@ import { openai } from "../../src/openai.js"; import { opensearch } from "../products/opensearch.js"; import { helperName, helperInstructions } from "../helpers.js"; -import { Tool } from "../../src/experts/tool.js"; +import { Tool } from "../../src/index.js"; import { Categories } from "../products/categories.js"; const INSTRUCTIONS = helperInstructions("productsOpenSearch.md", { diff --git a/test/fixtures/productsTool.js b/test/fixtures/productsTool.js index bee2f19..ea2f3bd 100644 --- a/test/fixtures/productsTool.js +++ b/test/fixtures/productsTool.js @@ -3,7 +3,7 @@ import axios from "axios"; import { fileTypeFromBuffer } from "file-type"; import { openai } from "../../src/openai.js"; import { helperName } from "../helpers.js"; -import { Tool } from "../../src/experts/tool.js"; +import { Tool } from "../../src/index.js"; import { ProductsOpenSearchTool } from "./productsOpenSearchTool.js"; const INSTRUCTIONS = ` diff --git a/test/fixtures/routerAssistant.js b/test/fixtures/routerAssistant.js index aae3023..a88e2ab 100644 --- a/test/fixtures/routerAssistant.js +++ b/test/fixtures/routerAssistant.js @@ -1,5 +1,5 @@ import { helperName } from "../helpers.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Assistant } from "../../src/index.js"; import { EchoTool } from "./echoTool.js"; class RouterAssistant extends Assistant { diff --git a/test/fixtures/testAssistant.js b/test/fixtures/testAssistant.js index 5cef0f1..aca7cda 100644 --- a/test/fixtures/testAssistant.js +++ b/test/fixtures/testAssistant.js @@ -1,5 +1,5 @@ import { helperName } from "../helpers.js"; -import { Assistant } from "../../src/experts/assistant.js"; +import { Assistant } from "../../src/index.js"; class TestAssistant extends Assistant { static get name() {