From 2a9151616b5eeb68671dbd4df94d809a4a971598 Mon Sep 17 00:00:00 2001 From: Hendrik Liebau Date: Fri, 30 Aug 2024 15:18:08 +0200 Subject: [PATCH] Test new `createStreamableUI` --- package-lock.json | 213 ++++++++++++++++++++++++++++++++++++---------- package.json | 8 +- 2 files changed, 171 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7dc4a3f..3ed6cf7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,13 +9,15 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@ai-sdk/openai": "^0.0.9", + "@ai-sdk/openai": "^0.0.33", + "@ai-sdk/react": "^0.0.6", + "@ai-sdk/ui-utils": "^0.0.5", "@mfng/core": "^4.1.4", "@upstash/ratelimit": "^1.0.1", "@upstash/redis": "^1.28.4", - "ai": "^3.1.1", + "ai": "3.2.5", "clsx": "^1.2.1", - "openai": "^4.40.1", + "openai": "4.52.6", "react": "19.0.0-rc-06d0b89e-20240801", "react-dom": "19.0.0-rc-06d0b89e-20240801", "react-markdown": "^9.0.1", @@ -78,12 +80,43 @@ } }, "node_modules/@ai-sdk/openai": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-0.0.9.tgz", - "integrity": "sha512-SSZGtX4KFDXWYmQ9JuhVumo1XOx1JAdHybYy08iwVXuCud9xdjZjjxgZkNPytQK9gRxFsYDOw1h0V/WXO7XgfQ==", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-0.0.33.tgz", + "integrity": "sha512-siVeHnagh08UFgdwflPdUKTdrVvfU/JWqSa8nCsMy6DvSri8T7zTzPZoCxXiMKPXkhQDd/KsaXhweOShGLQ1uQ==", + "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "0.0.3", - "@ai-sdk/provider-utils": "0.0.5" + "@ai-sdk/provider": "0.0.10", + "@ai-sdk/provider-utils": "0.0.16" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "zod": "^3.0.0" + } + }, + "node_modules/@ai-sdk/provider": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.10.tgz", + "integrity": "sha512-NzkrtREQpHID1cTqY/C4CI30PVOaXWKYytDR2EcytmFgnP7Z6+CrGIA/YCnNhYAuUm6Nx+nGpRL/Hmyrv7NYzg==", + "license": "Apache-2.0", + "dependencies": { + "json-schema": "0.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ai-sdk/provider-utils": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-0.0.16.tgz", + "integrity": "sha512-W2zUZ+C5uDr2P9/KZwtV4r4F0l2RlD0AvtJyug7ER5g3hGHAfKrPM0y2hSlRxNfph5BTCC6YQX0nFLyBph+6bQ==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider": "0.0.10", + "eventsource-parser": "1.1.2", + "nanoid": "3.3.6", + "secure-json-parse": "2.7.0" }, "engines": { "node": ">=18" @@ -97,25 +130,83 @@ } } }, - "node_modules/@ai-sdk/provider": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-0.0.3.tgz", - "integrity": "sha512-0B8P6VZpJ6F9yS9BpmJBYSqIaIfeRtL5tD5SP+qgR8y0pPwalIbRMUFiLz9YUT6g70MJsCLpm/2/fX3cfAYCJw==", + "node_modules/@ai-sdk/react": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@ai-sdk/react/-/react-0.0.6.tgz", + "integrity": "sha512-k0gpsiUxDTkDMYsdWl0WhujXVPMZvfPMCSbxZtzGvEao0YZNFQ/9ct+SZJvb5t9126oiNG0a344COO9CZ1OdLg==", + "license": "Apache-2.0", "dependencies": { - "json-schema": "0.4.0" + "@ai-sdk/provider-utils": "0.0.16", + "@ai-sdk/ui-utils": "0.0.5", + "swr": "2.2.0" }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "react": "^18 || ^19", + "zod": "^3.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "zod": { + "optional": true + } } }, - "node_modules/@ai-sdk/provider-utils": { + "node_modules/@ai-sdk/solid": { "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-0.0.5.tgz", - "integrity": "sha512-VVy9eQS+vS2j6cqTEQ9htMHz2nW/HFAkDXLvNFPoi1pZkviknJZEzb+DZUna6Od+jBf/TVA0HZwYnyGDaeI9cQ==", + "resolved": "https://registry.npmjs.org/@ai-sdk/solid/-/solid-0.0.5.tgz", + "integrity": "sha512-h43y+Vt4if2/6ms2u5OtPCzrA64FqyrpLJCnM2wcCF1WNiu11GGJI+GMHKWZrNPDqokD+PYeh1GG9Xd9DCppKA==", + "license": "Apache-2.0", "dependencies": { - "@ai-sdk/provider": "0.0.3", - "eventsource-parser": "1.1.2", - "nanoid": "3.3.6", + "@ai-sdk/ui-utils": "0.0.5", + "solid-swr-store": "0.10.7", + "swr-store": "0.10.6" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "solid-js": "^1.7.7" + }, + "peerDependenciesMeta": { + "solid-js": { + "optional": true + } + } + }, + "node_modules/@ai-sdk/svelte": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@ai-sdk/svelte/-/svelte-0.0.5.tgz", + "integrity": "sha512-5Jqww5Jtuyyg5NGRxS4GjxnWaSG5bkLPd/lOQnCj+RhS1DqGfjw0Qz76OYNXnjR/5AeJoAU4FTU45P8z5Kmy2A==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider-utils": "0.0.16", + "@ai-sdk/ui-utils": "0.0.5", + "sswr": "2.1.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "svelte": "^3.0.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, + "node_modules/@ai-sdk/ui-utils": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@ai-sdk/ui-utils/-/ui-utils-0.0.5.tgz", + "integrity": "sha512-Ug2qsKVLLxzZtJMu8Omw7wA1p8RqX82M4OeAZ2/oCPlZSAVAte+VnuXl6q6lUsAUfprVCDpzDDm9GJOOOYZg2Q==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider-utils": "0.0.16", "secure-json-parse": "2.7.0" }, "engines": { @@ -130,6 +221,27 @@ } } }, + "node_modules/@ai-sdk/vue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@ai-sdk/vue/-/vue-0.0.5.tgz", + "integrity": "sha512-G4wdK2LKD7QevNvbnroatnkQ/V2X4H6iif4+wdFhlPo9am24+mgf4bXjvuIwNIgCVd0wwQ3hE+2kGuBDATu9gA==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/ui-utils": "0.0.5", + "swrv": "1.0.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "vue": "^3.3.4" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } + } + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -2162,47 +2274,45 @@ } }, "node_modules/ai": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/ai/-/ai-3.1.1.tgz", - "integrity": "sha512-pJZc6q7SLd2/NenxN62iagMw9HHQ4Q8FyKqkrZUJntupRTHHgN3fL7exzJU/ICHDAbtn/EcJXOau6P61QgUtKQ==", - "dependencies": { - "@ai-sdk/provider": "0.0.3", - "@ai-sdk/provider-utils": "0.0.5", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/ai/-/ai-3.2.5.tgz", + "integrity": "sha512-Af4prTiDL+PKGLuAkNmaCSc3JJWTefjYTuzoLqghj/jsHz61ldyV91JT0Lra3wa9Yt/uDBc8wf4wHd7vCOXbfg==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider": "0.0.10", + "@ai-sdk/provider-utils": "0.0.16", + "@ai-sdk/react": "0.0.6", + "@ai-sdk/solid": "0.0.5", + "@ai-sdk/svelte": "0.0.5", + "@ai-sdk/ui-utils": "0.0.5", + "@ai-sdk/vue": "0.0.5", "eventsource-parser": "1.1.2", "json-schema": "0.4.0", "jsondiffpatch": "0.6.0", "nanoid": "3.3.6", "secure-json-parse": "2.7.0", - "solid-swr-store": "0.10.7", - "sswr": "2.0.0", - "swr": "2.2.0", - "swr-store": "0.10.6", - "swrv": "1.0.4", + "sswr": "2.1.0", "zod-to-json-schema": "3.22.5" }, "engines": { "node": ">=18" }, "peerDependencies": { - "react": "^18.2.0", - "solid-js": "^1.7.7", + "openai": "^4.42.0", + "react": "^18 || ^19", "svelte": "^3.0.0 || ^4.0.0", - "vue": "^3.3.4", "zod": "^3.0.0" }, "peerDependenciesMeta": { - "react": { + "openai": { "optional": true }, - "solid-js": { + "react": { "optional": true }, "svelte": { "optional": true }, - "vue": { - "optional": true - }, "zod": { "optional": true } @@ -4278,6 +4388,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-1.1.2.tgz", "integrity": "sha512-v0eOBUbiaFojBu2s2NPBfYUoRR9GjcDNvCXVaqEf5vVfpIAh9f8RCo4vXTP8c63QRKCFwoLpMpTdPwwhEKVgzA==", + "license": "MIT", "engines": { "node": ">=14.18" } @@ -5188,7 +5299,8 @@ "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { "version": "1.0.0", @@ -6452,6 +6564,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -6571,9 +6684,10 @@ } }, "node_modules/openai": { - "version": "4.40.1", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.40.1.tgz", - "integrity": "sha512-mS7LerF4fY1/we0aKGGwIWtosTJFLKuNbBWMBR/G1TAZUHoktAdod0dqIrlQvSD39uS6jNEEbT7jRsXmzfEPBw==", + "version": "4.52.6", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.52.6.tgz", + "integrity": "sha512-mT4SblnPXkzgiGY/cByU57sDDCqNUt3GQV8mzt4rL/xP6PHIQyTqwJ/WxwGhHRQ9okxgsDNgKQ6asdq8Dynw+g==", + "license": "Apache-2.0", "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", @@ -8208,6 +8322,7 @@ "version": "0.10.7", "resolved": "https://registry.npmjs.org/solid-swr-store/-/solid-swr-store-0.10.7.tgz", "integrity": "sha512-A6d68aJmRP471aWqKKPE2tpgOiR5fH4qXQNfKIec+Vap+MGQm3tvXlT8n0I8UgJSlNAsSAUuw2VTviH2h3Vv5g==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -8280,14 +8395,15 @@ } }, "node_modules/sswr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sswr/-/sswr-2.0.0.tgz", - "integrity": "sha512-mV0kkeBHcjcb0M5NqKtKVg/uTIYNlIIniyDfSGrSfxpEdM9C365jK0z55pl9K0xAkNTJi2OAOVFQpgMPUk+V0w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sswr/-/sswr-2.1.0.tgz", + "integrity": "sha512-Cqc355SYlTAaUt8iDPaC/4DPPXK925PePLMxyBKuWd5kKc5mwsG3nT9+Mq2tyguL5s7b4Jg+IRMpTRsNTAfpSQ==", + "license": "MIT", "dependencies": { "swrev": "^4.0.0" }, "peerDependencies": { - "svelte": "^4.0.0" + "svelte": "^4.0.0 || ^5.0.0-next.0" } }, "node_modules/string-width": { @@ -8577,6 +8693,7 @@ "version": "0.10.6", "resolved": "https://registry.npmjs.org/swr-store/-/swr-store-0.10.6.tgz", "integrity": "sha512-xPjB1hARSiRaNNlUQvWSVrG5SirCjk2TmaUyzzvk69SZQan9hCJqw/5rG9iL7xElHU784GxRPISClq4488/XVw==", + "license": "MIT", "dependencies": { "dequal": "^2.0.3" }, @@ -8587,12 +8704,14 @@ "node_modules/swrev": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/swrev/-/swrev-4.0.0.tgz", - "integrity": "sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA==" + "integrity": "sha512-LqVcOHSB4cPGgitD1riJ1Hh4vdmITOp+BkmfmXRh4hSF/t7EnS4iD+SOTmq7w5pPm/SiPeto4ADbKS6dHUDWFA==", + "license": "MIT" }, "node_modules/swrv": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/swrv/-/swrv-1.0.4.tgz", "integrity": "sha512-zjEkcP8Ywmj+xOJW3lIT65ciY/4AL4e/Or7Gj0MzU3zBJNMdJiT8geVZhINavnlHRMMCcJLHhraLTAiDOTmQ9g==", + "license": "Apache-2.0", "peerDependencies": { "vue": ">=3.2.26 < 4" } diff --git a/package.json b/package.json index 9563fd4..122d175 100644 --- a/package.json +++ b/package.json @@ -26,13 +26,15 @@ "watch:dev": "webpack --mode development --watch" }, "dependencies": { - "@ai-sdk/openai": "^0.0.9", + "@ai-sdk/openai": "^0.0.33", + "@ai-sdk/react": "^0.0.6", + "@ai-sdk/ui-utils": "^0.0.5", "@mfng/core": "^4.1.4", "@upstash/ratelimit": "^1.0.1", "@upstash/redis": "^1.28.4", - "ai": "^3.1.1", + "ai": "3.2.5", "clsx": "^1.2.1", - "openai": "^4.40.1", + "openai": "4.52.6", "react": "19.0.0-rc-06d0b89e-20240801", "react-dom": "19.0.0-rc-06d0b89e-20240801", "react-markdown": "^9.0.1",