From 92b0314c144f2b2c8a2375a19c02fb2cdb551d0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:27:02 +0000 Subject: [PATCH 01/10] chore(deps-dev): bump prettier from 2.8.7 to 2.8.8 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.7 to 2.8.8. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.7...2.8.8) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0d6da1c3d..935978627 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "eslint-plugin-prettier": "^4.2.1", "husky": "^8.0.0", "lint-staged": "^13.2.2", - "prettier": "^2.8.7", + "prettier": "^2.8.8", "typescript": "4.9.5", "webpack": "^5.88.1" }, diff --git a/yarn.lock b/yarn.lock index d3ca503cb..70019e58a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4911,10 +4911,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.8.7: - version "2.8.7" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" - integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== +prettier@^2.8.8: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== prop-types@^15.0.0, prop-types@^15.8.1: version "15.8.1" From 0cdee25b5bcb86b1fff1d45ee0875e617634d992 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:27:11 +0000 Subject: [PATCH 02/10] chore(deps): bump rehype-katex from 6.0.2 to 6.0.3 Bumps [rehype-katex](https://github.com/remarkjs/remark-math) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/remarkjs/remark-math/releases) - [Commits](https://github.com/remarkjs/remark-math/compare/rehype-katex@6.0.2...rehype-katex@6.0.3) --- updated-dependencies: - dependency-name: rehype-katex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 82 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 0d6da1c3d..aa5d2d1b5 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "react-markdown": "^8.0.7", "react-router-dom": "^6.10.0", "rehype-highlight": "^6.0.0", - "rehype-katex": "^6.0.2", + "rehype-katex": "^6.0.3", "remark-breaks": "^3.0.2", "remark-gfm": "^3.0.1", "remark-math": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index d3ca503cb..d146bfced 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1462,6 +1462,11 @@ resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5" integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg== +"@types/katex@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.14.0.tgz#b84c0afc3218069a5ad64fe2a95321881021b5fe" + integrity sha512-+2FW2CcT0K3P+JMR8YG846bmDwplKUTsWgT2ENwdQ1UdVfRk3GQrh6Mi4sTopy30gI8Uau5CEqHTDZ6YvWIUPA== + "@types/mdast@^3.0.0": version "3.0.11" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.11.tgz#dc130f7e7d9306124286f6d6cee40cf4d14a3dc0" @@ -2156,7 +2161,7 @@ commander@^2.20.0: resolved "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^8.0.0: +commander@^8.0.0, commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== @@ -3453,6 +3458,35 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" +hast-util-from-dom@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hast-util-from-dom/-/hast-util-from-dom-4.2.0.tgz#25836ddecc3cc0849d32749c2a7aec03e94b59a7" + integrity sha512-t1RJW/OpJbCAJQeKi3Qrj1cAOLA0+av/iPFori112+0X7R3wng+jxLA+kXec8K4szqPRGI8vPxbbpEYvvpwaeQ== + dependencies: + hastscript "^7.0.0" + web-namespaces "^2.0.0" + +hast-util-from-html-isomorphic@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-1.0.0.tgz#592b2bea880d476665b76ca1cf7d1a94925c80ec" + integrity sha512-Yu480AKeOEN/+l5LA674a+7BmIvtDj24GvOt7MtQWuhzUwlaaRWdEPXAh3Qm5vhuthpAipFb2vTetKXWOjmTvw== + dependencies: + "@types/hast" "^2.0.0" + hast-util-from-dom "^4.0.0" + hast-util-from-html "^1.0.0" + unist-util-remove-position "^4.0.0" + +hast-util-from-html@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/hast-util-from-html/-/hast-util-from-html-1.0.2.tgz#2482fd701b2d8270b912b3909d6fb645d4a346cf" + integrity sha512-LhrTA2gfCbLOGJq2u/asp4kwuG0y6NhWTXiPKP+n0qNukKy7hc10whqqCFfyvIA1Q5U5d0sp9HhNim9gglEH4A== + dependencies: + "@types/hast" "^2.0.0" + hast-util-from-parse5 "^7.0.0" + parse5 "^7.0.0" + vfile "^5.0.0" + vfile-message "^3.0.0" + hast-util-from-parse5@^7.0.0: version "7.1.2" resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-7.1.2.tgz#aecfef73e3ceafdfa4550716443e4eb7b02e22b0" @@ -3898,12 +3932,12 @@ katex@^0.13.0: dependencies: commander "^8.0.0" -katex@^0.15.0: - version "0.15.6" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.15.6.tgz#c4e2f6ced2ac4de1ef6f737fe7c67d3026baa0e5" - integrity sha512-UpzJy4yrnqnhXvRPhjEuLA4lcPn6eRngixW7Q3TJErjg3Aw2PuLFBzTkdUb89UtumxjhHTqL3a5GDGETMSwgJA== +katex@^0.16.0: + version "0.16.8" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.8.tgz#89b453f40e8557f423f31a1009e9298dd99d5ceb" + integrity sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg== dependencies: - commander "^8.0.0" + commander "^8.3.0" khroma@^2.0.0: version "2.0.0" @@ -4840,10 +4874,12 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -parse5@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== +parse5@^7.0.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" path-exists@^4.0.0: version "4.0.0" @@ -5102,30 +5138,18 @@ rehype-highlight@^6.0.0: unified "^10.0.0" unist-util-visit "^4.0.0" -rehype-katex@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/rehype-katex/-/rehype-katex-6.0.2.tgz#20197bbc10bdf79f6b999bffa6689d7f17226c35" - integrity sha512-C4gDAlS1+l0hJqctyiU64f9CvT00S03qV1T6HiMzbSuLBgWUtcqydWHY9OpKrm0SpkK16FNd62CDKyWLwV2ppg== +rehype-katex@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/rehype-katex/-/rehype-katex-6.0.3.tgz#83e5b929b0967978e9491c02117f55be3594d7e1" + integrity sha512-ByZlRwRUcWegNbF70CVRm2h/7xy7jQ3R9LaY4VVSvjnoVWwWVhNL60DiZsBpC5tSzYQOCvDbzncIpIjPZWodZA== dependencies: "@types/hast" "^2.0.0" - "@types/katex" "^0.11.0" + "@types/katex" "^0.14.0" + hast-util-from-html-isomorphic "^1.0.0" hast-util-to-text "^3.1.0" - katex "^0.15.0" - rehype-parse "^8.0.0" - unified "^10.0.0" - unist-util-remove-position "^4.0.0" + katex "^0.16.0" unist-util-visit "^4.0.0" -rehype-parse@^8.0.0: - version "8.0.4" - resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-8.0.4.tgz#3d17c9ff16ddfef6bbcc8e6a25a99467b482d688" - integrity sha512-MJJKONunHjoTh4kc3dsM1v3C9kGrrxvA3U8PxZlP2SjH8RNUSrb+lF7Y0KVaUDnGH2QZ5vAn7ulkiajM9ifuqg== - dependencies: - "@types/hast" "^2.0.0" - hast-util-from-parse5 "^7.0.0" - parse5 "^6.0.0" - unified "^10.0.0" - remark-breaks@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/remark-breaks/-/remark-breaks-3.0.2.tgz#f466b9d3474d7323146c0149fc1496dabadd908e" From f3f84e523a6b0c62346a90b4ce9b17580e1ea434 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:27:22 +0000 Subject: [PATCH 03/10] chore(deps): bump @hello-pangea/dnd from 16.2.0 to 16.3.0 Bumps [@hello-pangea/dnd](https://github.com/hello-pangea/dnd) from 16.2.0 to 16.3.0. - [Release notes](https://github.com/hello-pangea/dnd/releases) - [Changelog](https://github.com/hello-pangea/dnd/blob/main/CHANGELOG.md) - [Commits](https://github.com/hello-pangea/dnd/compare/v16.2.0...v16.3.0) --- updated-dependencies: - dependency-name: "@hello-pangea/dnd" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 0d6da1c3d..8b1293381 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@fortaine/fetch-event-source": "^3.0.6", - "@hello-pangea/dnd": "^16.2.0", + "@hello-pangea/dnd": "^16.3.0", "@svgr/webpack": "^6.5.1", "@vercel/analytics": "^0.1.11", "emoji-picker-react": "^4.4.7", diff --git a/yarn.lock b/yarn.lock index d3ca503cb..078c4b891 100644 --- a/yarn.lock +++ b/yarn.lock @@ -954,10 +954,10 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.12.1", "@babel/runtime@^7.19.4", "@babel/runtime@^7.20.7", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" - integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== +"@babel/runtime@^7.12.1", "@babel/runtime@^7.20.7", "@babel/runtime@^7.22.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" + integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== dependencies: regenerator-runtime "^0.13.11" @@ -1037,17 +1037,17 @@ resolved "https://registry.npmmirror.com/@fortaine/fetch-event-source/-/fetch-event-source-3.0.6.tgz#b8552a2ca2c5202f5699b93a92be0188d422b06e" integrity sha512-621GAuLMvKtyZQ3IA6nlDWhV1V/7PGOTNIGLUifxt0KzM+dZIweJ6F3XvQF3QnqeNfS1N7WQ0Kil1Di/lhChEw== -"@hello-pangea/dnd@^16.2.0": - version "16.2.0" - resolved "https://registry.npmmirror.com/@hello-pangea/dnd/-/dnd-16.2.0.tgz#58cbadeb56f8c7a381da696bb7aa3bfbb87876ec" - integrity sha512-inACvMcvvLr34CG0P6+G/3bprVKhwswxjcsFUSJ+fpOGjhvDj9caiA9X3clby0lgJ6/ILIJjyedHZYECB7GAgA== +"@hello-pangea/dnd@^16.3.0": + version "16.3.0" + resolved "https://registry.yarnpkg.com/@hello-pangea/dnd/-/dnd-16.3.0.tgz#3776212f812df4e8e69c42831ec8ab7ff3a087d6" + integrity sha512-RYQ/K8shtJoyNPvFWz0gfXIK7HF3P3mL9UZFGMuHB0ljRSXVgMjVFI/FxcZmakMzw6tO7NflWLriwTNBow/4vw== dependencies: - "@babel/runtime" "^7.19.4" + "@babel/runtime" "^7.22.5" css-box-model "^1.2.1" memoize-one "^6.0.0" raf-schd "^4.0.3" - react-redux "^8.0.4" - redux "^4.2.0" + react-redux "^8.1.1" + redux "^4.2.1" use-memo-one "^1.1.3" "@humanwhocodes/config-array@^0.11.8": @@ -4991,10 +4991,10 @@ react-markdown@^8.0.7: unist-util-visit "^4.0.0" vfile "^5.0.0" -react-redux@^8.0.4: - version "8.0.5" - resolved "https://registry.npmmirror.com/react-redux/-/react-redux-8.0.5.tgz#e5fb8331993a019b8aaf2e167a93d10af469c7bd" - integrity sha512-Q2f6fCKxPFpkXt1qNRZdEDLlScsDWyrgSj0mliK59qU6W5gvBiKkdMEG2lJzhd1rCctf0hb6EtePPLZ2e0m1uw== +react-redux@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-8.1.1.tgz#8e740f3fd864a4cd0de5ba9cdc8ad39cc9e7c81a" + integrity sha512-5W0QaKtEhj+3bC0Nj0NkqkhIv8gLADH/2kYFMTHxCVqQILiWzLv6MaLuV5wJU3BQEdHKzTfcvPN0WMS6SC1oyA== dependencies: "@babel/runtime" "^7.12.1" "@types/hoist-non-react-statics" "^3.3.1" @@ -5032,9 +5032,9 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -redux@^4.2.0: +redux@^4.2.1: version "4.2.1" - resolved "https://registry.npmmirror.com/redux/-/redux-4.2.1.tgz#c08f4306826c49b5e9dc901dee0452ea8fce6197" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.1.tgz#c08f4306826c49b5e9dc901dee0452ea8fce6197" integrity sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w== dependencies: "@babel/runtime" "^7.9.2" From 2dc122831b73557eff946be024c19377dcb03243 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 10:27:32 +0000 Subject: [PATCH 04/10] chore(deps-dev): bump @types/node from 20.3.1 to 20.3.3 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.3.1 to 20.3.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 0d6da1c3d..d9eeee1ae 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@tauri-apps/cli": "^1.3.1", - "@types/node": "^20.3.1", + "@types/node": "^20.3.3", "@types/react": "^18.2.12", "@types/react-dom": "^18.0.11", "@types/react-katex": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index d3ca503cb..e3218b2bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1474,15 +1474,10 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== -"@types/node@*": - version "20.3.2" - resolved "https://registry.npmmirror.com/@types/node/-/node-20.3.2.tgz#fa6a90f2600e052a03c18b8cb3fd83dd4e599898" - integrity sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw== - -"@types/node@^20.3.1": - version "20.3.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" - integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== +"@types/node@*", "@types/node@^20.3.3": + version "20.3.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.3.tgz#329842940042d2b280897150e023e604d11657d6" + integrity sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw== "@types/parse-json@^4.0.0": version "4.0.0" From 0bc2c71b0c906c1e70f5e557e2f742bcabb8ef17 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 4 Jul 2023 00:14:57 +0800 Subject: [PATCH 05/10] fix: #2230 hide chat actions for context prompts --- app/components/chat.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index ff0bc5b34..a0b0a297a 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -888,7 +888,8 @@ export function Chat() { const showActions = !isUser && i > 0 && - !(message.preview || message.content.length === 0); + !(message.preview || message.content.length === 0) && + i >= context.length; // do not show actions for context prompts const showTyping = message.preview || message.streaming; const shouldShowClearContextDivider = i === clearContextIndex - 1; From 59634594994bfc00facf4ea7b6160a4e2ed1f49e Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 4 Jul 2023 00:22:30 +0800 Subject: [PATCH 06/10] fix: #2221 user prompts in front of all prompts --- app/store/prompt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/prompt.ts b/app/store/prompt.ts index 98d4193be..4e3701619 100644 --- a/app/store/prompt.ts +++ b/app/store/prompt.ts @@ -127,7 +127,7 @@ export const usePromptStore = create()( search(text) { if (text.length === 0) { // return all rompts - return SearchService.allPrompts.concat([...get().getUserPrompts()]); + return get().getUserPrompts().concat(SearchService.builtinPrompts); } return SearchService.search(text) as Prompt[]; }, From 823032617dfd9928544f38c928085b9b41ba8691 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 4 Jul 2023 00:39:54 +0800 Subject: [PATCH 07/10] feat: add top p config --- app/components/model-config.tsx | 19 +++++++++++++++++++ app/locales/cn.ts | 4 ++++ app/locales/en.ts | 6 +++++- app/store/config.ts | 9 +++++++-- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/components/model-config.tsx b/app/components/model-config.tsx index f79e0e8f6..9fd4677e7 100644 --- a/app/components/model-config.tsx +++ b/app/components/model-config.tsx @@ -48,6 +48,25 @@ export function ModelConfigList(props: { }} > + + { + props.updateConfig( + (config) => + (config.temperature = ModalConfigValidator.top_p( + e.currentTarget.valueAsNumber, + )), + ); + }} + > + `With ${x} contextual prompts`, - Edit: "Contextual and Memory Prompts", + Edit: "Current Chat Settings", Add: "Add a Prompt", Clear: "Context Cleared", Revert: "Revert", diff --git a/app/store/config.ts b/app/store/config.ts index 945e1be7c..68e299150 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -33,6 +33,7 @@ export const DEFAULT_CONFIG = { modelConfig: { model: "gpt-3.5-turbo" as ModelType, temperature: 0.5, + top_p: 1, max_tokens: 2000, presence_penalty: 0, frequency_penalty: 0, @@ -158,6 +159,9 @@ export const ModalConfigValidator = { temperature(x: number) { return limitNumber(x, 0, 1, 1); }, + top_p(x: number) { + return limitNumber(x, 0, 1, 1); + }, }; export const useAppConfig = create()( @@ -177,15 +181,16 @@ export const useAppConfig = create()( }), { name: StoreKey.Config, - version: 3.2, + version: 3.3, migrate(persistedState, version) { - if (version === 3.2) return persistedState as any; + if (version === 3.3) return persistedState as any; const state = persistedState as ChatConfig; state.modelConfig.sendMemory = true; state.modelConfig.historyMessageCount = 4; state.modelConfig.compressMessageLengthThreshold = 1000; state.modelConfig.frequency_penalty = 0; + state.modelConfig.top_p = 1; state.modelConfig.template = DEFAULT_INPUT_TEMPLATE; state.dontShowMaskSplashScreen = false; From cda074fe243183a3b6e3801f21c954007e221157 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 4 Jul 2023 00:40:57 +0800 Subject: [PATCH 08/10] fixup --- app/client/platforms/openai.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 79d485562..bbd14d613 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -50,6 +50,7 @@ export class ChatGPTApi implements LLMApi { temperature: modelConfig.temperature, presence_penalty: modelConfig.presence_penalty, frequency_penalty: modelConfig.frequency_penalty, + top_p: modelConfig.top_p, }; console.log("[Request] openai payload: ", requestPayload); From a52fa28ed10ed6afa157f95ac0bb6382b524e8cf Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Tue, 4 Jul 2023 01:10:16 +0800 Subject: [PATCH 09/10] Update tauri.conf.json --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 72db20ceb..25d8c361f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -9,7 +9,7 @@ }, "package": { "productName": "ChatGPT Next Web", - "version": "2.8.6" + "version": "2.8.7" }, "tauri": { "allowlist": { From 0a2af9335c9cc465fda02e5e371adef3fbf2f28a Mon Sep 17 00:00:00 2001 From: PaRaD1SE98 Date: Tue, 4 Jul 2023 02:49:05 +0900 Subject: [PATCH 10/10] fix: temperature -> top_p --- app/components/model-config.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/model-config.tsx b/app/components/model-config.tsx index 9fd4677e7..f82027dc4 100644 --- a/app/components/model-config.tsx +++ b/app/components/model-config.tsx @@ -60,7 +60,7 @@ export function ModelConfigList(props: { onChange={(e) => { props.updateConfig( (config) => - (config.temperature = ModalConfigValidator.top_p( + (config.top_p = ModalConfigValidator.top_p( e.currentTarget.valueAsNumber, )), );