From c400ce26723b1b148c86030a4c28f90746808903 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 05:01:35 +0000 Subject: [PATCH 1/5] Update all non-major dev dependencies --- package-lock.json | 198 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 84 insertions(+), 116 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84126e2..bc1def0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "eslint-plugin-prettier": "^5.0.0", "husky": "^8.0.0", "jest": "^29.6.2", - "langchain": "^0.0.181", + "langchain": "^0.0.194", "lint-staged": "^15.0.0", "openai": "^4.11.1", "prettier": "^3.0.0", @@ -57,9 +57,9 @@ } }, "node_modules/@anthropic-ai/sdk": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.6.2.tgz", - "integrity": "sha512-fB9PUj9RFT+XjkL+E9Ol864ZIJi+1P8WnbHspN3N3/GK2uSzjd0cbVIKTGgf4v3N8MwaQu+UWnU7C4BG/fap/g==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.9.1.tgz", + "integrity": "sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==", "dev": true, "dependencies": { "@types/node": "^18.11.18", @@ -69,7 +69,8 @@ "digest-fetch": "^1.3.0", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" + "node-fetch": "^2.6.7", + "web-streams-polyfill": "^3.2.1" } }, "node_modules/@anthropic-ai/sdk/node_modules/@types/node": { @@ -78,6 +79,15 @@ "integrity": "sha512-t3rNFBgJRugIhackit2mVcLfF6IRc0JE4oeizPQL8Zrm8n2WY/0wOdpOPhdtG0V9Q2TlW/axbF1MJ6z+Yj/kKQ==", "dev": true }, + "node_modules/@anthropic-ai/sdk/node_modules/web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", @@ -1158,9 +1168,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", - "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", + "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -3217,15 +3227,15 @@ } }, "node_modules/eslint": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", - "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", + "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.53.0", + "@eslint/js": "8.54.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -4901,12 +4911,12 @@ } }, "node_modules/langchain": { - "version": "0.0.181", - "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.0.181.tgz", - "integrity": "sha512-S1jamhe1oekoWNKmWpV6pq4U7JN8pBL2GZF9b3uQmVoXMtjp1MWWPT49aUAManvJnpJDUYmylPwky+tq+ONgdw==", + "version": "0.0.194", + "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.0.194.tgz", + "integrity": "sha512-EbpVWL0l5V2byMmEnHf+xpkpPWQ1CgFINjM1RPk6+D3zm7HtkOWYoU0gTrWA5mmL9L1EB1w8r1xIh8E63Ts/HQ==", "dev": true, "dependencies": { - "@anthropic-ai/sdk": "^0.6.2", + "@anthropic-ai/sdk": "^0.9.1", "ansi-styles": "^5.0.0", "binary-extensions": "^2.2.0", "camelcase": "6", @@ -4919,14 +4929,14 @@ "langchainhub": "~0.0.6", "langsmith": "~0.0.48", "ml-distance": "^4.0.0", - "openai": "~4.4.0", + "openai": "^4.19.0", "openapi-types": "^12.1.3", "p-queue": "^6.6.2", "p-retry": "4", "uuid": "^9.0.0", "yaml": "^2.2.1", "zod": "^3.22.3", - "zod-to-json-schema": "^3.20.4" + "zod-to-json-schema": "3.20.3" }, "engines": { "node": ">=18" @@ -4947,9 +4957,9 @@ "@elastic/elasticsearch": "^8.4.0", "@getmetal/metal-sdk": "*", "@getzep/zep-js": "^0.9.0", - "@gomomento/sdk": "^1.44.1", - "@gomomento/sdk-core": "^1.44.1", - "@gomomento/sdk-web": "^1.44.1", + "@gomomento/sdk": "^1.47.1", + "@gomomento/sdk-core": "^1.47.1", + "@gomomento/sdk-web": "^1.47.1", "@google-ai/generativelanguage": "^0.2.1", "@google-cloud/storage": "^6.10.1", "@huggingface/inference": "^2.6.4", @@ -4960,6 +4970,7 @@ "@planetscale/database": "^1.8.0", "@qdrant/js-client-rest": "^1.2.0", "@raycast/api": "^1.55.2", + "@rockset/client": "^0.9.1", "@smithy/eventstream-codec": "^2.0.5", "@smithy/protocol-http": "^3.0.6", "@smithy/signature-v4": "^2.0.10", @@ -4999,7 +5010,7 @@ "ignore": "^5.2.0", "ioredis": "^5.3.2", "jsdom": "*", - "llmonitor": "^0.5.8", + "llmonitor": "^0.5.9", "lodash": "^4.17.21", "mammoth": "*", "mongodb": "^5.2.0", @@ -5115,6 +5126,9 @@ "@raycast/api": { "optional": true }, + "@rockset/client": { + "optional": true + }, "@smithy/eventstream-codec": { "optional": true }, @@ -5324,15 +5338,6 @@ } } }, - "node_modules/langchain/node_modules/@types/node": { - "version": "18.18.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", - "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, "node_modules/langchain/node_modules/ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -5357,23 +5362,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/langchain/node_modules/openai": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.4.0.tgz", - "integrity": "sha512-JN0t628Kh95T0IrXl0HdBqnlJg+4Vq0Bnh55tio+dfCnyzHvMLiWyCM9m726MAJD2YkDU4/8RQB6rNbEq9ct2w==", + "node_modules/langchain/node_modules/zod-to-json-schema": { + "version": "3.20.3", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.20.3.tgz", + "integrity": "sha512-/Q3wnyxAfCt94ZcrGiXXoiAfRqasxl9CX64LZ9fj+4dKH68zulUtU0uk1WMxQPfAxQ0ZI70dKzcoW7hHj+DwSQ==", "dev": true, - "dependencies": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - }, - "bin": { - "openai": "bin/cli" + "peerDependencies": { + "zod": "^3.20.0" } }, "node_modules/langchainhub": { @@ -6170,9 +6165,9 @@ } }, "node_modules/openai": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.17.4.tgz", - "integrity": "sha512-ThRFkl6snLbcAKS58St7N3CaKuI5WdYUvIjPvf4s+8SdymgNtOfzmZcZXVcCefx04oKFnvZJvIcTh3eAFUUhAQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.19.0.tgz", + "integrity": "sha512-cJbl0noZyAaXVKBTMMq6X5BAvP1pm2rWYDBnZes99NL+Zh5/4NmlAwyuhTZEru5SqGGZIoiYKeMPXy4bm9DI0w==", "dev": true, "dependencies": { "@types/node": "^18.11.18", @@ -6190,9 +6185,9 @@ } }, "node_modules/openai/node_modules/@types/node": { - "version": "18.18.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", - "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", + "version": "18.18.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.10.tgz", + "integrity": "sha512-luANqZxPmjTll8bduz4ACs/lNTCLuWssCyjqTY9yLdsv1xnViQp3ISKwsEWOIecO13JWUqjVdig/Vjjc09o8uA==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -8582,15 +8577,6 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } - }, - "node_modules/zod-to-json-schema": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.21.4.tgz", - "integrity": "sha512-fjUZh4nQ1s6HMccgIeE0VP4QG/YRGPmyjO9sAh890aQKPEk3nqbfUXhMFaC+Dr5KvYBm8BCyvfpZf2jY9aGSsw==", - "dev": true, - "peerDependencies": { - "zod": "^3.21.4" - } } }, "dependencies": { @@ -8611,9 +8597,9 @@ } }, "@anthropic-ai/sdk": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.6.2.tgz", - "integrity": "sha512-fB9PUj9RFT+XjkL+E9Ol864ZIJi+1P8WnbHspN3N3/GK2uSzjd0cbVIKTGgf4v3N8MwaQu+UWnU7C4BG/fap/g==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.9.1.tgz", + "integrity": "sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==", "dev": true, "requires": { "@types/node": "^18.11.18", @@ -8623,7 +8609,8 @@ "digest-fetch": "^1.3.0", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" + "node-fetch": "^2.6.7", + "web-streams-polyfill": "^3.2.1" }, "dependencies": { "@types/node": { @@ -8631,6 +8618,12 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.4.tgz", "integrity": "sha512-t3rNFBgJRugIhackit2mVcLfF6IRc0JE4oeizPQL8Zrm8n2WY/0wOdpOPhdtG0V9Q2TlW/axbF1MJ6z+Yj/kKQ==", "dev": true + }, + "web-streams-polyfill": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "dev": true } } }, @@ -9342,9 +9335,9 @@ } }, "@eslint/js": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", - "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", + "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", "dev": true }, "@humanwhocodes/config-array": { @@ -10849,15 +10842,15 @@ "dev": true }, "eslint": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", - "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", + "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.53.0", + "@eslint/js": "8.54.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -12083,12 +12076,12 @@ "dev": true }, "langchain": { - "version": "0.0.181", - "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.0.181.tgz", - "integrity": "sha512-S1jamhe1oekoWNKmWpV6pq4U7JN8pBL2GZF9b3uQmVoXMtjp1MWWPT49aUAManvJnpJDUYmylPwky+tq+ONgdw==", + "version": "0.0.194", + "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.0.194.tgz", + "integrity": "sha512-EbpVWL0l5V2byMmEnHf+xpkpPWQ1CgFINjM1RPk6+D3zm7HtkOWYoU0gTrWA5mmL9L1EB1w8r1xIh8E63Ts/HQ==", "dev": true, "requires": { - "@anthropic-ai/sdk": "^0.6.2", + "@anthropic-ai/sdk": "^0.9.1", "ansi-styles": "^5.0.0", "binary-extensions": "^2.2.0", "camelcase": "6", @@ -12101,25 +12094,16 @@ "langchainhub": "~0.0.6", "langsmith": "~0.0.48", "ml-distance": "^4.0.0", - "openai": "~4.4.0", + "openai": "^4.19.0", "openapi-types": "^12.1.3", "p-queue": "^6.6.2", "p-retry": "4", "uuid": "^9.0.0", "yaml": "^2.2.1", "zod": "^3.22.3", - "zod-to-json-schema": "^3.20.4" + "zod-to-json-schema": "3.20.3" }, "dependencies": { - "@types/node": { - "version": "18.18.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", - "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", - "dev": true, - "requires": { - "undici-types": "~5.26.4" - } - }, "ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -12132,21 +12116,12 @@ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, - "openai": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.4.0.tgz", - "integrity": "sha512-JN0t628Kh95T0IrXl0HdBqnlJg+4Vq0Bnh55tio+dfCnyzHvMLiWyCM9m726MAJD2YkDU4/8RQB6rNbEq9ct2w==", + "zod-to-json-schema": { + "version": "3.20.3", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.20.3.tgz", + "integrity": "sha512-/Q3wnyxAfCt94ZcrGiXXoiAfRqasxl9CX64LZ9fj+4dKH68zulUtU0uk1WMxQPfAxQ0ZI70dKzcoW7hHj+DwSQ==", "dev": true, - "requires": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - } + "requires": {} } } }, @@ -12710,9 +12685,9 @@ } }, "openai": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.17.4.tgz", - "integrity": "sha512-ThRFkl6snLbcAKS58St7N3CaKuI5WdYUvIjPvf4s+8SdymgNtOfzmZcZXVcCefx04oKFnvZJvIcTh3eAFUUhAQ==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.19.0.tgz", + "integrity": "sha512-cJbl0noZyAaXVKBTMMq6X5BAvP1pm2rWYDBnZes99NL+Zh5/4NmlAwyuhTZEru5SqGGZIoiYKeMPXy4bm9DI0w==", "dev": true, "requires": { "@types/node": "^18.11.18", @@ -12727,9 +12702,9 @@ }, "dependencies": { "@types/node": { - "version": "18.18.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.9.tgz", - "integrity": "sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ==", + "version": "18.18.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.10.tgz", + "integrity": "sha512-luANqZxPmjTll8bduz4ACs/lNTCLuWssCyjqTY9yLdsv1xnViQp3ISKwsEWOIecO13JWUqjVdig/Vjjc09o8uA==", "dev": true, "requires": { "undici-types": "~5.26.4" @@ -14206,13 +14181,6 @@ "version": "3.22.4", "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" - }, - "zod-to-json-schema": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.21.4.tgz", - "integrity": "sha512-fjUZh4nQ1s6HMccgIeE0VP4QG/YRGPmyjO9sAh890aQKPEk3nqbfUXhMFaC+Dr5KvYBm8BCyvfpZf2jY9aGSsw==", - "dev": true, - "requires": {} } } } diff --git a/package.json b/package.json index 5b69f3e..0475e8e 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "eslint-plugin-prettier": "^5.0.0", "husky": "^8.0.0", "jest": "^29.6.2", - "langchain": "^0.0.181", + "langchain": "^0.0.194", "lint-staged": "^15.0.0", "openai": "^4.11.1", "prettier": "^3.0.0", From 616588e91a746a870b409e65258fa4b2feae5d4a Mon Sep 17 00:00:00 2001 From: Nicole White Date: Mon, 20 Nov 2023 10:27:49 -0500 Subject: [PATCH 2/5] Read from file --- test/langchain.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/langchain.spec.ts b/test/langchain.spec.ts index f694bca..d52c447 100644 --- a/test/langchain.spec.ts +++ b/test/langchain.spec.ts @@ -1,5 +1,5 @@ import crypto from 'crypto'; - +import { readFileSync } from 'fs'; import { AutoblocksCallbackHandler } from '../src/langchain/index'; import { LLMChain } from 'langchain/chains'; @@ -16,9 +16,9 @@ import { DynamicTool } from 'langchain/tools'; jest.setTimeout(60000); // Used to verify we're sending the correct version -// This will need to be updated if we update our version of -// langchain in devDependencies -const CURRENT_LANGCHAIN_VERSION = '0.0.181'; +const CURRENT_LANGCHAIN_VERSION = JSON.parse( + readFileSync('node_modules/langchain/package.json', 'utf8'), +).version; const mockHandlerPost = (handler: AutoblocksCallbackHandler) => { const mockPost = jest From b7526b5d8cb095ca3c2f319d132122520794b366 Mon Sep 17 00:00:00 2001 From: Nicole White Date: Mon, 20 Nov 2023 10:42:11 -0500 Subject: [PATCH 3/5] Update test --- test/openai.spec.ts | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/test/openai.spec.ts b/test/openai.spec.ts index 8257839..bfdc400 100644 --- a/test/openai.spec.ts +++ b/test/openai.spec.ts @@ -163,14 +163,16 @@ describe('traceOpenAI', () => { }); it('generates a new traceId for every openai call', async () => { - await openai.chat.completions.create({ - messages: [{ role: 'system', content: 'You are a helpful assistant.' }], - model: 'gpt-3.5-turbo', - }); - await openai.chat.completions.create({ - messages: [{ role: 'system', content: 'You are a helpful assistant.' }], - model: 'gpt-3.5-turbo', - }); + await Promise.all([ + openai.chat.completions.create({ + messages: [{ role: 'system', content: 'Hello!' }], + model: 'gpt-3.5-turbo', + }), + openai.chat.completions.create({ + messages: [{ role: 'system', content: 'You are a helpful assistant.' }], + model: 'gpt-3.5-turbo', + }), + ]); const calls = mockPost.mock.calls; expect(calls.length).toEqual(4); @@ -181,18 +183,19 @@ describe('traceOpenAI', () => { expect(messages).toEqual([ 'ai.completion.request', - 'ai.completion.response', 'ai.completion.request', 'ai.completion.response', + 'ai.completion.response', ]); - expect(traceIds[0]).toEqual(traceIds[1]); - expect(traceIds[2]).toEqual(traceIds[3]); - expect(traceIds[0]).not.toEqual(traceIds[2]); + expect(traceIds[0]).not.toEqual(traceIds[1]); + expect(spanIds[0]).not.toEqual(spanIds[1]); + + expect(traceIds.every(Boolean)).toBe(true); + expect(spanIds.every(Boolean)).toBe(true); - expect(spanIds[0]).toEqual(spanIds[1]); - expect(spanIds[2]).toEqual(spanIds[3]); - expect(spanIds[0]).not.toEqual(spanIds[2]); + expect(new Set(traceIds).size).toEqual(2); + expect(new Set(spanIds).size).toEqual(2); }); it('completions.create (error)', async () => { From fe05078d98e39b9ce2d3f9e0ed10c41293812788 Mon Sep 17 00:00:00 2001 From: Nicole White Date: Mon, 20 Nov 2023 11:02:32 -0500 Subject: [PATCH 4/5] Bump timeout --- test/openai.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/openai.spec.ts b/test/openai.spec.ts index bfdc400..d683d5d 100644 --- a/test/openai.spec.ts +++ b/test/openai.spec.ts @@ -3,7 +3,7 @@ import { OpenAI } from 'openai'; import { AutoblocksTracer } from '../src'; import { traceOpenAI } from '../src/openai'; -jest.setTimeout(100000); +jest.setTimeout(200000); const checkAllEqualAndDefined = (xs: string[]) => { expect(xs.every((x) => x === xs[0])).toBe(true); From 750c7c4ff1b22e9e041f1d0a21c4732150562ca7 Mon Sep 17 00:00:00 2001 From: Nicole White Date: Mon, 20 Nov 2023 12:21:24 -0500 Subject: [PATCH 5/5] Update tests --- .github/workflows/ci.yml | 1 + test/langchain.spec.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1f0910..29a9480 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: - '16' diff --git a/test/langchain.spec.ts b/test/langchain.spec.ts index d52c447..ae00393 100644 --- a/test/langchain.spec.ts +++ b/test/langchain.spec.ts @@ -13,7 +13,7 @@ import { StringOutputParser } from 'langchain/schema/output_parser'; import { initializeAgentExecutorWithOptions } from 'langchain/agents'; import { DynamicTool } from 'langchain/tools'; -jest.setTimeout(60000); +jest.setTimeout(200000); // Used to verify we're sending the correct version const CURRENT_LANGCHAIN_VERSION = JSON.parse(