forked from prehistoric-systems/chatpad
Compare commits
24 commits
feature/pw
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb5f4abb36 | ||
|
|
617707984d | ||
|
|
bd79f273e3 | ||
|
|
f45cd53bc4 | ||
|
|
f8675d9aa2 | ||
|
|
628217c4df | ||
|
|
4e473c4965 | ||
|
|
7088bbab29 | ||
|
|
74cb1ac2ee | ||
|
|
c2ddf2996b | ||
|
|
5c7f18f0f3 | ||
|
|
f499ac39da | ||
|
|
dfc8492b22 | ||
|
|
96de7e36ae | ||
|
|
72fb78aef7 | ||
|
|
8d4f734f04 | ||
|
|
bbbc0a2b2a | ||
|
|
26a7ac60d8 | ||
|
|
c96cae501c | ||
|
|
8af5e8050f | ||
|
|
3fcf06d41f | ||
|
|
a18ad930ed | ||
|
|
1fa02b34f4 | ||
|
|
ae4f30d4b6 |
15 changed files with 1638 additions and 1482 deletions
7
.do/deploy.template.yaml
Normal file
7
.do/deploy.template.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
spec:
|
||||||
|
name: chatpad
|
||||||
|
services:
|
||||||
|
- name: chatpad
|
||||||
|
git:
|
||||||
|
branch: main
|
||||||
|
repo_clone_url: https://github.com/deiucanta/chatpad.git
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
# [Looking for maintainers!](https://github.com/deiucanta/chatpad/issues/106)
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<h1 align="center">Chatpad AI</h1>
|
<h1 align="center">Chatpad AI</h1>
|
||||||
|
|
@ -49,7 +47,7 @@ docker run --name chatpad -d -v `pwd`/config.json:/usr/share/nginx/html/config.j
|
||||||
<!-- Railway -->
|
<!-- Railway -->
|
||||||
[](https://railway.app/template/Ak6DUw?referralCode=9M8r62)
|
[](https://railway.app/template/Ak6DUw?referralCode=9M8r62)
|
||||||
|
|
||||||
|
[](https://cloud.digitalocean.com/apps/new?repo=https://github.com/deiucanta/chatpad/tree/main)
|
||||||
|
|
||||||
|
|
||||||
## Give Feedback
|
## Give Feedback
|
||||||
|
|
|
||||||
179
package-lock.json
generated
179
package-lock.json
generated
|
|
@ -8,10 +8,11 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.10.6",
|
"@emotion/react": "^11.10.6",
|
||||||
"@emotion/server": "^11.10.0",
|
"@emotion/server": "^11.10.0",
|
||||||
"@mantine/core": "^6.0.1",
|
"@mantine/core": "^6.0.17",
|
||||||
"@mantine/hooks": "^6.0.1",
|
"@mantine/hooks": "^6.0.17",
|
||||||
"@mantine/next": "^6.0.1",
|
"@mantine/next": "^6.0.17",
|
||||||
"@mantine/notifications": "^6.0.1",
|
"@mantine/notifications": "^6.0.17",
|
||||||
|
"@mantine/prism": "^6.0.17",
|
||||||
"@tabler/icons-react": "^2.9.0",
|
"@tabler/icons-react": "^2.9.0",
|
||||||
"@tanstack/react-location": "^3.7.4",
|
"@tanstack/react-location": "^3.7.4",
|
||||||
"@types/node": "18.15.0",
|
"@types/node": "18.15.0",
|
||||||
|
|
@ -29,6 +30,8 @@
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"openai": "^3.2.1",
|
"openai": "^3.2.1",
|
||||||
"openai-ext": "^1.2.6",
|
"openai-ext": "^1.2.6",
|
||||||
|
"prism-react-renderer": "^1.3.1",
|
||||||
|
"prismjs": "^1.29.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.8.0",
|
"react-icons": "^4.8.0",
|
||||||
|
|
@ -45,6 +48,7 @@
|
||||||
"buffer": "^5.7.1",
|
"buffer": "^5.7.1",
|
||||||
"parcel": "^2.8.3",
|
"parcel": "^2.8.3",
|
||||||
"parcel-reporter-static-files-copy": "^1.5.0",
|
"parcel-reporter-static-files-copy": "^1.5.0",
|
||||||
|
"path-browserify": "^1.0.1",
|
||||||
"process": "^0.11.10"
|
"process": "^0.11.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -582,38 +586,38 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/core": {
|
"node_modules/@mantine/core": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.17.tgz",
|
||||||
"integrity": "sha512-FP/qaMBzh2dDrZIFSAJB3vogWK3U8+nnwImKa+/ceo7EJLeauLNAssaoWn2TVnA6x5mIZnlPwkDtVqI8Q+K9Ww==",
|
"integrity": "sha512-g3EDxcTJKisvEGTsGJPCGXiDumwr4O0nGNXwoGLnrg19nh3FAMfEIq18sJJLtRrBuarSbrvgMVYvKx1R6rTOWg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@floating-ui/react": "^0.19.1",
|
"@floating-ui/react": "^0.19.1",
|
||||||
"@mantine/styles": "6.0.2",
|
"@mantine/styles": "6.0.17",
|
||||||
"@mantine/utils": "6.0.2",
|
"@mantine/utils": "6.0.17",
|
||||||
"@radix-ui/react-scroll-area": "1.0.2",
|
"@radix-ui/react-scroll-area": "1.0.2",
|
||||||
"react-remove-scroll": "^2.5.5",
|
"react-remove-scroll": "^2.5.5",
|
||||||
"react-textarea-autosize": "8.3.4"
|
"react-textarea-autosize": "8.3.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@mantine/hooks": "6.0.2",
|
"@mantine/hooks": "6.0.17",
|
||||||
"react": ">=16.8.0",
|
"react": ">=16.8.0",
|
||||||
"react-dom": ">=16.8.0"
|
"react-dom": ">=16.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/hooks": {
|
"node_modules/@mantine/hooks": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-6.0.17.tgz",
|
||||||
"integrity": "sha512-wLSkp0NRe4XN7JujIUvkKghIBJC9YZ33CJlrFbcBFLD6LiSLX7lWyWOsiFzXrPND0Hpgn3AjckFQGblA8n34XA==",
|
"integrity": "sha512-7vf2w1NlzKlUynSuyI2DAIKoEOYKYC8k+tlSsk3BRdbzhbJAiWxcYzJy5seg5dFW1WIpKAZ0wiVdHXf/WRlRgg==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=16.8.0"
|
"react": ">=16.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/next": {
|
"node_modules/@mantine/next": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/next/-/next-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/next/-/next-6.0.17.tgz",
|
||||||
"integrity": "sha512-yQrsqu19r9aLU8/q0hhsUjuTV8MRf3vTQz2Lv6Fvm+dGIef+ZvMVaTrRodvX/qepF5YWAmyRUg5jgwENsyDSXQ==",
|
"integrity": "sha512-/JmKysJ0blftAU8+YtWZ4m3MIXUtiyaPXamEYCkcv+V+8oAa9x4EquX/eK6gOVbEEhUoHGCbIZ3nt54NQiC2dQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mantine/ssr": "6.0.2",
|
"@mantine/ssr": "6.0.17",
|
||||||
"@mantine/styles": "6.0.2"
|
"@mantine/styles": "6.0.17"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"next": "*",
|
"next": "*",
|
||||||
|
|
@ -622,26 +626,41 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/notifications": {
|
"node_modules/@mantine/notifications": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-6.0.17.tgz",
|
||||||
"integrity": "sha512-EpQgTl5j925N88WY05etFe5ov71UnJRep6nGwv+CVATXmNV8E8z4b+2R6B5ofg4bW9VkS2BJKT2TgKRzaCMLeg==",
|
"integrity": "sha512-iY8hdRG4RcrsA7U06AOWLbKrQJAzEhKi2mESOnGE4s7RBWJjLTXJf+gTKi+QtVa3XNIF0I/adpEh8MEFD5zGWw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mantine/utils": "6.0.2",
|
"@mantine/utils": "6.0.17",
|
||||||
"react-transition-group": "4.4.2"
|
"react-transition-group": "4.4.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@mantine/core": "6.0.2",
|
"@mantine/core": "6.0.17",
|
||||||
"@mantine/hooks": "6.0.2",
|
"@mantine/hooks": "6.0.17",
|
||||||
|
"react": ">=16.8.0",
|
||||||
|
"react-dom": ">=16.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@mantine/prism": {
|
||||||
|
"version": "6.0.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@mantine/prism/-/prism-6.0.17.tgz",
|
||||||
|
"integrity": "sha512-oUnvLIU/ERvGqYVDasVIQH5pJpmi4DooGB5tucef1uS7u/rt68iAaNKCpPK4ghYZekCC8VO/cXdB9BzZACj5EA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@mantine/utils": "6.0.17",
|
||||||
|
"prism-react-renderer": "^1.2.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@mantine/core": "6.0.17",
|
||||||
|
"@mantine/hooks": "6.0.17",
|
||||||
"react": ">=16.8.0",
|
"react": ">=16.8.0",
|
||||||
"react-dom": ">=16.8.0"
|
"react-dom": ">=16.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/ssr": {
|
"node_modules/@mantine/ssr": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/ssr/-/ssr-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/ssr/-/ssr-6.0.17.tgz",
|
||||||
"integrity": "sha512-s7F0LtKVdGflbV/2ofCUcdoEQlCpnspBIOPW2IORk7Ysab/XE/Ea2nphtfStNZcYZXk9haOVp50Yi8yAxzBOVg==",
|
"integrity": "sha512-l4G0GROr/1w96uWmEMrczwxLF5BSR0b2uK/ErTrq6+ozmrFSl+LvU/JKoYnyoo+bgbfhVn8dpNOxpkOYF5fTDg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mantine/styles": "6.0.2",
|
"@mantine/styles": "6.0.17",
|
||||||
"html-react-parser": "1.4.12"
|
"html-react-parser": "1.4.12"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
@ -652,9 +671,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/styles": {
|
"node_modules/@mantine/styles": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-6.0.17.tgz",
|
||||||
"integrity": "sha512-py5yWzCPSYAv/4NwQ+dHaei0Rmk8kQ/ls5i3u28y6U+fCoutRhlCPJKjPfOWQzFpSRS0oGPdChFdg6zn4r8YIA==",
|
"integrity": "sha512-utNwQJgKHguNS0iPyyeFRJy4nbt280XMbmfUf4GCxXlyl/mQxq+JoaKP/OmU7+8kfbtLS9kHeuBSghrC65Nt1g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"clsx": "1.1.1",
|
"clsx": "1.1.1",
|
||||||
"csstype": "3.0.9"
|
"csstype": "3.0.9"
|
||||||
|
|
@ -671,9 +690,9 @@
|
||||||
"integrity": "sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw=="
|
"integrity": "sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw=="
|
||||||
},
|
},
|
||||||
"node_modules/@mantine/utils": {
|
"node_modules/@mantine/utils": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/utils/-/utils-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/utils/-/utils-6.0.17.tgz",
|
||||||
"integrity": "sha512-fx+cmkb8PMpkr65nUs8YgaXFJbtNY+ybSXDfBxwFAWMTLAocbNo7vjkSvPWZVS1O2szPK/s4Rqdw0W76dyG4+w==",
|
"integrity": "sha512-U6SWV/asYE6NhiHx4ltmVZdQR3HwGVqJxVulhOylMcV1tX/P1LMQUCbGV2Oe4O9jbX4/YW5B/CBb4BbEhENQFQ==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=16.8.0"
|
"react": ">=16.8.0"
|
||||||
}
|
}
|
||||||
|
|
@ -6972,6 +6991,22 @@
|
||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prism-react-renderer": {
|
||||||
|
"version": "1.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz",
|
||||||
|
"integrity": "sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=0.14.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/prismjs": {
|
||||||
|
"version": "1.29.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
|
||||||
|
"integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/process": {
|
"node_modules/process": {
|
||||||
"version": "0.11.10",
|
"version": "0.11.10",
|
||||||
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||||
|
|
@ -8823,55 +8858,64 @@
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"@mantine/core": {
|
"@mantine/core": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.17.tgz",
|
||||||
"integrity": "sha512-FP/qaMBzh2dDrZIFSAJB3vogWK3U8+nnwImKa+/ceo7EJLeauLNAssaoWn2TVnA6x5mIZnlPwkDtVqI8Q+K9Ww==",
|
"integrity": "sha512-g3EDxcTJKisvEGTsGJPCGXiDumwr4O0nGNXwoGLnrg19nh3FAMfEIq18sJJLtRrBuarSbrvgMVYvKx1R6rTOWg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@floating-ui/react": "^0.19.1",
|
"@floating-ui/react": "^0.19.1",
|
||||||
"@mantine/styles": "6.0.2",
|
"@mantine/styles": "6.0.17",
|
||||||
"@mantine/utils": "6.0.2",
|
"@mantine/utils": "6.0.17",
|
||||||
"@radix-ui/react-scroll-area": "1.0.2",
|
"@radix-ui/react-scroll-area": "1.0.2",
|
||||||
"react-remove-scroll": "^2.5.5",
|
"react-remove-scroll": "^2.5.5",
|
||||||
"react-textarea-autosize": "8.3.4"
|
"react-textarea-autosize": "8.3.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mantine/hooks": {
|
"@mantine/hooks": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-6.0.17.tgz",
|
||||||
"integrity": "sha512-wLSkp0NRe4XN7JujIUvkKghIBJC9YZ33CJlrFbcBFLD6LiSLX7lWyWOsiFzXrPND0Hpgn3AjckFQGblA8n34XA==",
|
"integrity": "sha512-7vf2w1NlzKlUynSuyI2DAIKoEOYKYC8k+tlSsk3BRdbzhbJAiWxcYzJy5seg5dFW1WIpKAZ0wiVdHXf/WRlRgg==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@mantine/next": {
|
"@mantine/next": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/next/-/next-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/next/-/next-6.0.17.tgz",
|
||||||
"integrity": "sha512-yQrsqu19r9aLU8/q0hhsUjuTV8MRf3vTQz2Lv6Fvm+dGIef+ZvMVaTrRodvX/qepF5YWAmyRUg5jgwENsyDSXQ==",
|
"integrity": "sha512-/JmKysJ0blftAU8+YtWZ4m3MIXUtiyaPXamEYCkcv+V+8oAa9x4EquX/eK6gOVbEEhUoHGCbIZ3nt54NQiC2dQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@mantine/ssr": "6.0.2",
|
"@mantine/ssr": "6.0.17",
|
||||||
"@mantine/styles": "6.0.2"
|
"@mantine/styles": "6.0.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mantine/notifications": {
|
"@mantine/notifications": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-6.0.17.tgz",
|
||||||
"integrity": "sha512-EpQgTl5j925N88WY05etFe5ov71UnJRep6nGwv+CVATXmNV8E8z4b+2R6B5ofg4bW9VkS2BJKT2TgKRzaCMLeg==",
|
"integrity": "sha512-iY8hdRG4RcrsA7U06AOWLbKrQJAzEhKi2mESOnGE4s7RBWJjLTXJf+gTKi+QtVa3XNIF0I/adpEh8MEFD5zGWw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@mantine/utils": "6.0.2",
|
"@mantine/utils": "6.0.17",
|
||||||
"react-transition-group": "4.4.2"
|
"react-transition-group": "4.4.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mantine/ssr": {
|
"@mantine/prism": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/ssr/-/ssr-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/prism/-/prism-6.0.17.tgz",
|
||||||
"integrity": "sha512-s7F0LtKVdGflbV/2ofCUcdoEQlCpnspBIOPW2IORk7Ysab/XE/Ea2nphtfStNZcYZXk9haOVp50Yi8yAxzBOVg==",
|
"integrity": "sha512-oUnvLIU/ERvGqYVDasVIQH5pJpmi4DooGB5tucef1uS7u/rt68iAaNKCpPK4ghYZekCC8VO/cXdB9BzZACj5EA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@mantine/styles": "6.0.2",
|
"@mantine/utils": "6.0.17",
|
||||||
|
"prism-react-renderer": "^1.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@mantine/ssr": {
|
||||||
|
"version": "6.0.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@mantine/ssr/-/ssr-6.0.17.tgz",
|
||||||
|
"integrity": "sha512-l4G0GROr/1w96uWmEMrczwxLF5BSR0b2uK/ErTrq6+ozmrFSl+LvU/JKoYnyoo+bgbfhVn8dpNOxpkOYF5fTDg==",
|
||||||
|
"requires": {
|
||||||
|
"@mantine/styles": "6.0.17",
|
||||||
"html-react-parser": "1.4.12"
|
"html-react-parser": "1.4.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mantine/styles": {
|
"@mantine/styles": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-6.0.17.tgz",
|
||||||
"integrity": "sha512-py5yWzCPSYAv/4NwQ+dHaei0Rmk8kQ/ls5i3u28y6U+fCoutRhlCPJKjPfOWQzFpSRS0oGPdChFdg6zn4r8YIA==",
|
"integrity": "sha512-utNwQJgKHguNS0iPyyeFRJy4nbt280XMbmfUf4GCxXlyl/mQxq+JoaKP/OmU7+8kfbtLS9kHeuBSghrC65Nt1g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"clsx": "1.1.1",
|
"clsx": "1.1.1",
|
||||||
"csstype": "3.0.9"
|
"csstype": "3.0.9"
|
||||||
|
|
@ -8885,9 +8929,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mantine/utils": {
|
"@mantine/utils": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@mantine/utils/-/utils-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@mantine/utils/-/utils-6.0.17.tgz",
|
||||||
"integrity": "sha512-fx+cmkb8PMpkr65nUs8YgaXFJbtNY+ybSXDfBxwFAWMTLAocbNo7vjkSvPWZVS1O2szPK/s4Rqdw0W76dyG4+w==",
|
"integrity": "sha512-U6SWV/asYE6NhiHx4ltmVZdQR3HwGVqJxVulhOylMcV1tX/P1LMQUCbGV2Oe4O9jbX4/YW5B/CBb4BbEhENQFQ==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@mischnic/json-sourcemap": {
|
"@mischnic/json-sourcemap": {
|
||||||
|
|
@ -13072,6 +13116,17 @@
|
||||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||||
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
|
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
|
||||||
},
|
},
|
||||||
|
"prism-react-renderer": {
|
||||||
|
"version": "1.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz",
|
||||||
|
"integrity": "sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg==",
|
||||||
|
"requires": {}
|
||||||
|
},
|
||||||
|
"prismjs": {
|
||||||
|
"version": "1.29.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
|
||||||
|
"integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q=="
|
||||||
|
},
|
||||||
"process": {
|
"process": {
|
||||||
"version": "0.11.10",
|
"version": "0.11.10",
|
||||||
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||||
|
|
|
||||||
11
package.json
11
package.json
|
|
@ -25,10 +25,11 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.10.6",
|
"@emotion/react": "^11.10.6",
|
||||||
"@emotion/server": "^11.10.0",
|
"@emotion/server": "^11.10.0",
|
||||||
"@mantine/core": "^6.0.1",
|
"@mantine/core": "^6.0.17",
|
||||||
"@mantine/hooks": "^6.0.1",
|
"@mantine/hooks": "^6.0.17",
|
||||||
"@mantine/next": "^6.0.1",
|
"@mantine/next": "^6.0.17",
|
||||||
"@mantine/notifications": "^6.0.1",
|
"@mantine/notifications": "^6.0.17",
|
||||||
|
"@mantine/prism": "^6.0.17",
|
||||||
"@tabler/icons-react": "^2.9.0",
|
"@tabler/icons-react": "^2.9.0",
|
||||||
"@tanstack/react-location": "^3.7.4",
|
"@tanstack/react-location": "^3.7.4",
|
||||||
"@types/node": "18.15.0",
|
"@types/node": "18.15.0",
|
||||||
|
|
@ -46,6 +47,8 @@
|
||||||
"next": "13.2.4",
|
"next": "13.2.4",
|
||||||
"openai": "^3.2.1",
|
"openai": "^3.2.1",
|
||||||
"openai-ext": "^1.2.6",
|
"openai-ext": "^1.2.6",
|
||||||
|
"prism-react-renderer": "^1.3.1",
|
||||||
|
"prismjs": "^1.29.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.8.0",
|
"react-icons": "^4.8.0",
|
||||||
|
|
|
||||||
88
src/components/ChatItem.tsx
Normal file
88
src/components/ChatItem.tsx
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
import { ActionIcon, Flex, Menu } from "@mantine/core";
|
||||||
|
import {
|
||||||
|
IconDotsVertical,
|
||||||
|
IconMessages,
|
||||||
|
IconPencil,
|
||||||
|
IconPin,
|
||||||
|
IconPinned,
|
||||||
|
IconPinnedOff,
|
||||||
|
IconTrash
|
||||||
|
} from "@tabler/icons-react";
|
||||||
|
import { Link } from "@tanstack/react-location";
|
||||||
|
import { Chat, db } from "../db";
|
||||||
|
import { DeleteChatModal } from "./DeleteChatModal";
|
||||||
|
import { EditChatModal } from "./EditChatModal";
|
||||||
|
import { MainLink } from "./MainLink";
|
||||||
|
import { notifications } from "@mantine/notifications";
|
||||||
|
|
||||||
|
export function ChatItem({ chat, isActive }: { chat: Chat, isActive: boolean }) {
|
||||||
|
const toggleChatPin = async (chatId: string, event: React.UIEvent) => {
|
||||||
|
try {
|
||||||
|
event.preventDefault();
|
||||||
|
await db.chats.where({ id: chatId }).modify((chat) => {
|
||||||
|
chat.pinned = !chat.pinned;
|
||||||
|
});
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.toJSON().message === "Network Error") {
|
||||||
|
notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
color: "red",
|
||||||
|
message: "No internet connection.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const message = error.response?.data?.error?.message;
|
||||||
|
if (message) {
|
||||||
|
notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
color: "red",
|
||||||
|
message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex
|
||||||
|
key={chat.id}
|
||||||
|
className={isActive ? "active" : undefined}
|
||||||
|
sx={(theme) => ({
|
||||||
|
marginTop: 1,
|
||||||
|
"&:hover, &.active": {
|
||||||
|
backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[1],
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<Link to={`/chats/${chat.id}`} style={{ flex: 1 }}>
|
||||||
|
<MainLink
|
||||||
|
icon={chat.pinned ? <IconPinned size="1rem" /> : <IconMessages size="1rem" />}
|
||||||
|
color="teal"
|
||||||
|
chat={chat}
|
||||||
|
label={chat.description}
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
<Menu shadow="md" width={200} keepMounted>
|
||||||
|
<Menu.Target>
|
||||||
|
<ActionIcon sx={{ height: "auto" }}>
|
||||||
|
<IconDotsVertical size={20} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Menu.Target>
|
||||||
|
<Menu.Dropdown>
|
||||||
|
<Menu.Item
|
||||||
|
icon={chat.pinned ? <IconPinnedOff size="1rem" /> : <IconPin size="1rem" />}
|
||||||
|
onClick={(event) => toggleChatPin(chat.id, event)}
|
||||||
|
>
|
||||||
|
{chat.pinned ? "Remove pin" : "Pin chat"}
|
||||||
|
</Menu.Item>
|
||||||
|
<EditChatModal chat={chat}>
|
||||||
|
<Menu.Item icon={<IconPencil size="1rem" />}>Edit</Menu.Item>
|
||||||
|
</EditChatModal>
|
||||||
|
<DeleteChatModal chat={chat}>
|
||||||
|
<Menu.Item color="red" icon={<IconTrash size="1rem" />}>
|
||||||
|
Delete
|
||||||
|
</Menu.Item>
|
||||||
|
</DeleteChatModal>
|
||||||
|
</Menu.Dropdown>
|
||||||
|
</Menu>
|
||||||
|
</Flex>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
import { ActionIcon, Flex, Menu } from "@mantine/core";
|
import { Text } from "@mantine/core";
|
||||||
import { IconDotsVertical, IconMessages } from "@tabler/icons-react";
|
|
||||||
import { Link } from "@tanstack/react-location";
|
|
||||||
import { useLiveQuery } from "dexie-react-hooks";
|
import { useLiveQuery } from "dexie-react-hooks";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { db } from "../db";
|
import { db } from "../db";
|
||||||
import { useChatId } from "../hooks/useChatId";
|
import { useChatId } from "../hooks/useChatId";
|
||||||
import { DeleteChatModal } from "./DeleteChatModal";
|
import { ChatItem } from "./ChatItem";
|
||||||
import { EditChatModal } from "./EditChatModal";
|
|
||||||
import { MainLink } from "./MainLink";
|
|
||||||
|
|
||||||
export function Chats({ search }: { search: string }) {
|
export function Chats({ search }: { search: string }) {
|
||||||
const chatId = useChatId();
|
const chatId = useChatId();
|
||||||
|
|
@ -23,47 +19,25 @@ export function Chats({ search }: { search: string }) {
|
||||||
[chats, search]
|
[chats, search]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const pinnedChats = useMemo(() => filteredChats.filter((chat) => chat.pinned), [filteredChats]);
|
||||||
|
const unpinnedChats = useMemo(() => filteredChats.filter((chat) => !chat.pinned), [filteredChats]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{filteredChats.map((chat) => (
|
{pinnedChats.length > 0 ? (
|
||||||
<Flex
|
<>
|
||||||
key={chat.id}
|
<Text p="xs" fz="xs" fw={700} color="gray" children={"Pinned"} />
|
||||||
className={chatId === chat.id ? "active" : undefined}
|
{pinnedChats.map((chat) => (
|
||||||
sx={(theme) => ({
|
<ChatItem chat={chat} isActive={chatId === chat.id} />
|
||||||
marginTop: 1,
|
))}
|
||||||
"&:hover, &.active": {
|
|
||||||
backgroundColor:
|
{unpinnedChats.length > 0 ? <Text p="xs" fz="xs" fw={700} color="gray" children={"Unpinned"} /> : null}
|
||||||
theme.colorScheme === "dark"
|
</>
|
||||||
? theme.colors.dark[6]
|
) : null}
|
||||||
: theme.colors.gray[1],
|
|
||||||
},
|
{unpinnedChats.map((chat) => (
|
||||||
})}
|
<ChatItem chat={chat} isActive={chatId === chat.id} />
|
||||||
>
|
|
||||||
<Link to={`/chats/${chat.id}`} style={{ flex: 1 }}>
|
|
||||||
<MainLink
|
|
||||||
icon={<IconMessages size="1rem" />}
|
|
||||||
color="teal"
|
|
||||||
chat={chat}
|
|
||||||
label={chat.description}
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
<Menu shadow="md" width={200} keepMounted>
|
|
||||||
<Menu.Target>
|
|
||||||
<ActionIcon sx={{ height: "auto" }}>
|
|
||||||
<IconDotsVertical size={20} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Menu.Target>
|
|
||||||
<Menu.Dropdown>
|
|
||||||
<EditChatModal chat={chat}>
|
|
||||||
<Menu.Item>Edit</Menu.Item>
|
|
||||||
</EditChatModal>
|
|
||||||
<DeleteChatModal chat={chat}>
|
|
||||||
<Menu.Item>Delete</Menu.Item>
|
|
||||||
</DeleteChatModal>
|
|
||||||
</Menu.Dropdown>
|
|
||||||
</Menu>
|
|
||||||
</Flex>
|
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,7 @@ export function Layout() {
|
||||||
description: "New Chat",
|
description: "New Chat",
|
||||||
totalTokens: 0,
|
totalTokens: 0,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
|
pinned: false,
|
||||||
});
|
});
|
||||||
navigate({ to: `/chats/${id}` });
|
navigate({ to: `/chats/${id}` });
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {
|
||||||
ThemeIcon,
|
ThemeIcon,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useClipboard } from "@mantine/hooks";
|
import { Prism } from "@mantine/prism";
|
||||||
import { IconCopy, IconUser } from "@tabler/icons-react";
|
import { IconCopy, IconUser } from "@tabler/icons-react";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
|
|
@ -20,9 +20,9 @@ import "../styles/markdown.scss";
|
||||||
import { CreatePromptModal } from "./CreatePromptModal";
|
import { CreatePromptModal } from "./CreatePromptModal";
|
||||||
import { LogoIcon } from "./Logo";
|
import { LogoIcon } from "./Logo";
|
||||||
import { ScrollIntoView } from "./ScrollIntoView";
|
import { ScrollIntoView } from "./ScrollIntoView";
|
||||||
|
import "../utils/prisma-setup";
|
||||||
|
|
||||||
export function MessageItem({ message }: { message: Message }) {
|
export function MessageItem({ message }: { message: Message }) {
|
||||||
const clipboard = useClipboard({ timeout: 500 });
|
|
||||||
const wordCount = useMemo(() => {
|
const wordCount = useMemo(() => {
|
||||||
var matches = message.content.match(/[\w\d\’\'-\(\)]+/gi);
|
var matches = message.content.match(/[\w\d\’\'-\(\)]+/gi);
|
||||||
return matches ? matches.length : 0;
|
return matches ? matches.length : 0;
|
||||||
|
|
@ -46,29 +46,21 @@ export function MessageItem({ message }: { message: Message }) {
|
||||||
table: ({ node, ...props }) => (
|
table: ({ node, ...props }) => (
|
||||||
<Table verticalSpacing="sm" highlightOnHover {...props} />
|
<Table verticalSpacing="sm" highlightOnHover {...props} />
|
||||||
),
|
),
|
||||||
code: ({ node, inline, ...props }) =>
|
code: ({ node, inline, className, lang, ...props }) => {
|
||||||
inline ? (
|
const languageMatch = /language-(\w+)/.exec(className || "");
|
||||||
|
const language = languageMatch ? languageMatch[1] : undefined;
|
||||||
|
|
||||||
|
return inline ? (
|
||||||
<Code {...props} />
|
<Code {...props} />
|
||||||
) : (
|
) : (
|
||||||
<Box sx={{ position: "relative" }}>
|
<Box sx={{ position: "relative" }}>
|
||||||
<Code block {...props} />
|
<Prism
|
||||||
<CopyButton value={String(props.children)}>
|
language={language as any}
|
||||||
{({ copied, copy }) => (
|
children={`${props.children as string}`}
|
||||||
<Tooltip
|
/>
|
||||||
label={copied ? "Copied" : "Copy"}
|
|
||||||
position="left"
|
|
||||||
>
|
|
||||||
<ActionIcon
|
|
||||||
sx={{ position: "absolute", top: 4, right: 4 }}
|
|
||||||
onClick={copy}
|
|
||||||
>
|
|
||||||
<IconCopy opacity={0.4} size={20} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
</CopyButton>
|
|
||||||
</Box>
|
</Box>
|
||||||
),
|
);
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{message.role === "assistant" && (
|
{message.role === "assistant" && (
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ export function Prompts({
|
||||||
description: "New Chat",
|
description: "New Chat",
|
||||||
totalTokens: 0,
|
totalTokens: 0,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
|
pinned: false,
|
||||||
});
|
});
|
||||||
await db.messages.add({
|
await db.messages.add({
|
||||||
id: nanoid(),
|
id: nanoid(),
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
import { ReactNode } from "react";
|
import { ReactNode, useRef, useEffect } from "react";
|
||||||
|
|
||||||
export function ScrollIntoView({ children }: { children: ReactNode }) {
|
export function ScrollIntoView({ children }: { children: ReactNode }) {
|
||||||
|
|
||||||
|
// Scroll into view as soon as we appear
|
||||||
|
const myRef = useRef(null);
|
||||||
|
useEffect(() => {
|
||||||
|
myRef.current.scrollIntoView({ behavior: 'smooth' });
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div ref={myRef}>
|
||||||
ref={(node) => {
|
|
||||||
if (!node) return;
|
|
||||||
node.scrollIntoView({ behavior: "smooth" });
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ export interface Chat {
|
||||||
description: string;
|
description: string;
|
||||||
totalTokens: number;
|
totalTokens: number;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
pinned: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Message {
|
export interface Message {
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,19 @@ import {
|
||||||
Card,
|
Card,
|
||||||
Container,
|
Container,
|
||||||
Flex,
|
Flex,
|
||||||
|
Group,
|
||||||
MediaQuery,
|
MediaQuery,
|
||||||
Select,
|
Select,
|
||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Stack,
|
Stack,
|
||||||
|
SegmentedControl,
|
||||||
Textarea,
|
Textarea,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { notifications } from "@mantine/notifications";
|
import { notifications } from "@mantine/notifications";
|
||||||
import { useLiveQuery } from "dexie-react-hooks";
|
import { useLiveQuery } from "dexie-react-hooks";
|
||||||
import { nanoid } from "nanoid";
|
import { nanoid } from "nanoid";
|
||||||
import { KeyboardEvent, useState, type ChangeEvent } from "react";
|
import { KeyboardEvent, useState, type ChangeEvent, useEffect } from "react";
|
||||||
import { AiOutlineSend } from "react-icons/ai";
|
import { AiOutlineSend } from "react-icons/ai";
|
||||||
import { MessageItem } from "../components/MessageItem";
|
import { MessageItem } from "../components/MessageItem";
|
||||||
import { db } from "../db";
|
import { db } from "../db";
|
||||||
|
|
@ -66,6 +68,16 @@ export function ChatRoute() {
|
||||||
return message.join(" ");
|
return message.join(" ");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const settings = useLiveQuery(async () => {
|
||||||
|
return db.settings.where({ id: "general" }).first();
|
||||||
|
});
|
||||||
|
const [model, setModel] = useState(config.defaultModel);
|
||||||
|
useEffect(() => {
|
||||||
|
if (settings?.openAiModel) {
|
||||||
|
setModel(settings.openAiModel);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
if (submitting) return;
|
if (submitting) return;
|
||||||
|
|
||||||
|
|
@ -250,6 +262,53 @@ export function ChatRoute() {
|
||||||
: theme.colors.gray[0],
|
: theme.colors.gray[0],
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
{messages?.length === 0 &&
|
||||||
|
<Group position="center" my={40}>
|
||||||
|
<SegmentedControl
|
||||||
|
value={model}
|
||||||
|
fullWidth
|
||||||
|
size="md"
|
||||||
|
sx={(theme) => ({
|
||||||
|
[`@media (min-width: ${theme.breakpoints.md})`]: {
|
||||||
|
width: '30%',
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
data={[
|
||||||
|
{ label: 'GPT-3.5', value: 'gpt-3.5-turbo' },
|
||||||
|
{ label: 'GPT-4', value: 'gpt-4' },
|
||||||
|
{ label: 'GPT-4o', value: 'gpt-4o' }
|
||||||
|
]}
|
||||||
|
onChange={async (value: 'gpt-3.5-turbo' | 'gpt-4') => {
|
||||||
|
const model = value;
|
||||||
|
try {
|
||||||
|
await db.settings.update("general", {
|
||||||
|
openAiModel: model ?? undefined,
|
||||||
|
});
|
||||||
|
notifications.show({
|
||||||
|
title: "Saved",
|
||||||
|
message: "Your OpenAI Model has been saved.",
|
||||||
|
});
|
||||||
|
} catch (error: any) {
|
||||||
|
if (error.toJSON().message === "Network Error") {
|
||||||
|
notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
color: "red",
|
||||||
|
message: "No internet connection.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const message = error.response?.data?.error?.message;
|
||||||
|
if (message) {
|
||||||
|
notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
color: "red",
|
||||||
|
message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
}
|
||||||
<Container>
|
<Container>
|
||||||
{messages?.length === 0 && (
|
{messages?.length === 0 && (
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,18 @@
|
||||||
{
|
{
|
||||||
"value": "gpt-4-32k-0314",
|
"value": "gpt-4-32k-0314",
|
||||||
"label": "GPT-4-32K-0314 (Limited Beta, Legacy)"
|
"label": "GPT-4-32K-0314 (Limited Beta, Legacy)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "gpt-4-1106-preview",
|
||||||
|
"label": "GPT-4-1106-Preview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "gpt-4-turbo",
|
||||||
|
"label": "GPT-4 Turbo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "gpt-4o",
|
||||||
|
"label": "GPT-4 omni"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"writingCharacters": [
|
"writingCharacters": [
|
||||||
|
|
@ -224,4 +236,4 @@
|
||||||
"allowDatabaseModal": true,
|
"allowDatabaseModal": true,
|
||||||
"showTwitterLink": true,
|
"showTwitterLink": true,
|
||||||
"showFeedbackLink": true
|
"showFeedbackLink": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
282
src/utils/prisma-setup.ts
Normal file
282
src/utils/prisma-setup.ts
Normal file
|
|
@ -0,0 +1,282 @@
|
||||||
|
import { Prism } from "prism-react-renderer";
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
Prism: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.Prism = Prism;
|
||||||
|
|
||||||
|
// Load all languages like this as webpack doesn't detect prism's loadLanguages call and doesn't load any
|
||||||
|
require("prismjs/components/prism-abap");
|
||||||
|
require("prismjs/components/prism-abnf");
|
||||||
|
require("prismjs/components/prism-actionscript");
|
||||||
|
require("prismjs/components/prism-ada");
|
||||||
|
require("prismjs/components/prism-agda");
|
||||||
|
require("prismjs/components/prism-al");
|
||||||
|
require("prismjs/components/prism-antlr4");
|
||||||
|
require("prismjs/components/prism-apacheconf");
|
||||||
|
require("prismjs/components/prism-apex");
|
||||||
|
require("prismjs/components/prism-apl");
|
||||||
|
require("prismjs/components/prism-applescript");
|
||||||
|
require("prismjs/components/prism-aql");
|
||||||
|
require("prismjs/components/prism-arduino");
|
||||||
|
require("prismjs/components/prism-arff");
|
||||||
|
require("prismjs/components/prism-asciidoc");
|
||||||
|
require("prismjs/components/prism-asm6502");
|
||||||
|
require("prismjs/components/prism-asmatmel");
|
||||||
|
require("prismjs/components/prism-aspnet");
|
||||||
|
require("prismjs/components/prism-autohotkey");
|
||||||
|
require("prismjs/components/prism-autoit");
|
||||||
|
require("prismjs/components/prism-avisynth");
|
||||||
|
require("prismjs/components/prism-avro-idl");
|
||||||
|
require("prismjs/components/prism-bash");
|
||||||
|
require("prismjs/components/prism-basic");
|
||||||
|
require("prismjs/components/prism-batch");
|
||||||
|
require("prismjs/components/prism-bbcode");
|
||||||
|
require("prismjs/components/prism-bicep");
|
||||||
|
require("prismjs/components/prism-birb");
|
||||||
|
require("prismjs/components/prism-bison");
|
||||||
|
require("prismjs/components/prism-bnf");
|
||||||
|
require("prismjs/components/prism-brainfuck");
|
||||||
|
require("prismjs/components/prism-brightscript");
|
||||||
|
require("prismjs/components/prism-bro");
|
||||||
|
require("prismjs/components/prism-bsl");
|
||||||
|
require("prismjs/components/prism-c");
|
||||||
|
require("prismjs/components/prism-cfscript");
|
||||||
|
require("prismjs/components/prism-chaiscript");
|
||||||
|
require("prismjs/components/prism-cil");
|
||||||
|
require("prismjs/components/prism-clike");
|
||||||
|
require("prismjs/components/prism-clojure");
|
||||||
|
require("prismjs/components/prism-cmake");
|
||||||
|
require("prismjs/components/prism-cobol");
|
||||||
|
require("prismjs/components/prism-coffeescript");
|
||||||
|
require("prismjs/components/prism-concurnas");
|
||||||
|
require("prismjs/components/prism-coq");
|
||||||
|
require("prismjs/components/prism-cpp");
|
||||||
|
require("prismjs/components/prism-csharp");
|
||||||
|
require("prismjs/components/prism-cshtml");
|
||||||
|
require("prismjs/components/prism-csp");
|
||||||
|
require("prismjs/components/prism-css");
|
||||||
|
require("prismjs/components/prism-css-extras");
|
||||||
|
require("prismjs/components/prism-csv");
|
||||||
|
require("prismjs/components/prism-cypher");
|
||||||
|
require("prismjs/components/prism-d");
|
||||||
|
require("prismjs/components/prism-dart");
|
||||||
|
require("prismjs/components/prism-dataweave");
|
||||||
|
require("prismjs/components/prism-dax");
|
||||||
|
require("prismjs/components/prism-dhall");
|
||||||
|
require("prismjs/components/prism-diff");
|
||||||
|
require("prismjs/components/prism-django");
|
||||||
|
require("prismjs/components/prism-dns-zone-file");
|
||||||
|
require("prismjs/components/prism-docker");
|
||||||
|
require("prismjs/components/prism-dot");
|
||||||
|
require("prismjs/components/prism-ebnf");
|
||||||
|
require("prismjs/components/prism-editorconfig");
|
||||||
|
require("prismjs/components/prism-eiffel");
|
||||||
|
require("prismjs/components/prism-ejs");
|
||||||
|
require("prismjs/components/prism-elixir");
|
||||||
|
require("prismjs/components/prism-elm");
|
||||||
|
require("prismjs/components/prism-erb");
|
||||||
|
require("prismjs/components/prism-erlang");
|
||||||
|
require("prismjs/components/prism-etlua");
|
||||||
|
require("prismjs/components/prism-excel-formula");
|
||||||
|
require("prismjs/components/prism-factor");
|
||||||
|
require("prismjs/components/prism-false");
|
||||||
|
require("prismjs/components/prism-firestore-security-rules");
|
||||||
|
require("prismjs/components/prism-flow");
|
||||||
|
require("prismjs/components/prism-fortran");
|
||||||
|
require("prismjs/components/prism-fsharp");
|
||||||
|
require("prismjs/components/prism-ftl");
|
||||||
|
require("prismjs/components/prism-gap");
|
||||||
|
require("prismjs/components/prism-gcode");
|
||||||
|
require("prismjs/components/prism-gdscript");
|
||||||
|
require("prismjs/components/prism-gedcom");
|
||||||
|
require("prismjs/components/prism-gherkin");
|
||||||
|
require("prismjs/components/prism-git");
|
||||||
|
require("prismjs/components/prism-glsl");
|
||||||
|
require("prismjs/components/prism-gml");
|
||||||
|
require("prismjs/components/prism-gn");
|
||||||
|
require("prismjs/components/prism-go");
|
||||||
|
require("prismjs/components/prism-go-module");
|
||||||
|
require("prismjs/components/prism-graphql");
|
||||||
|
require("prismjs/components/prism-groovy");
|
||||||
|
require("prismjs/components/prism-haml");
|
||||||
|
require("prismjs/components/prism-handlebars");
|
||||||
|
require("prismjs/components/prism-haskell");
|
||||||
|
require("prismjs/components/prism-haxe");
|
||||||
|
require("prismjs/components/prism-hcl");
|
||||||
|
require("prismjs/components/prism-hlsl");
|
||||||
|
require("prismjs/components/prism-hoon");
|
||||||
|
require("prismjs/components/prism-hpkp");
|
||||||
|
require("prismjs/components/prism-hsts");
|
||||||
|
require("prismjs/components/prism-http");
|
||||||
|
require("prismjs/components/prism-ichigojam");
|
||||||
|
require("prismjs/components/prism-icon");
|
||||||
|
require("prismjs/components/prism-icu-message-format");
|
||||||
|
require("prismjs/components/prism-idris");
|
||||||
|
require("prismjs/components/prism-iecst");
|
||||||
|
require("prismjs/components/prism-ignore");
|
||||||
|
require("prismjs/components/prism-inform7");
|
||||||
|
require("prismjs/components/prism-ini");
|
||||||
|
require("prismjs/components/prism-io");
|
||||||
|
require("prismjs/components/prism-j");
|
||||||
|
require("prismjs/components/prism-java");
|
||||||
|
require("prismjs/components/prism-javadoclike");
|
||||||
|
require("prismjs/components/prism-javascript");
|
||||||
|
require("prismjs/components/prism-javastacktrace");
|
||||||
|
require("prismjs/components/prism-jexl");
|
||||||
|
require("prismjs/components/prism-jolie");
|
||||||
|
require("prismjs/components/prism-jq");
|
||||||
|
require("prismjs/components/prism-js-extras");
|
||||||
|
require("prismjs/components/prism-js-templates");
|
||||||
|
require("prismjs/components/prism-jsdoc");
|
||||||
|
require("prismjs/components/prism-json");
|
||||||
|
require("prismjs/components/prism-json5");
|
||||||
|
require("prismjs/components/prism-jsonp");
|
||||||
|
require("prismjs/components/prism-jsstacktrace");
|
||||||
|
require("prismjs/components/prism-jsx");
|
||||||
|
require("prismjs/components/prism-julia");
|
||||||
|
require("prismjs/components/prism-keepalived");
|
||||||
|
require("prismjs/components/prism-keyman");
|
||||||
|
require("prismjs/components/prism-kotlin");
|
||||||
|
require("prismjs/components/prism-kumir");
|
||||||
|
require("prismjs/components/prism-kusto");
|
||||||
|
require("prismjs/components/prism-latex");
|
||||||
|
require("prismjs/components/prism-latte");
|
||||||
|
require("prismjs/components/prism-less");
|
||||||
|
require("prismjs/components/prism-lilypond");
|
||||||
|
require("prismjs/components/prism-liquid");
|
||||||
|
require("prismjs/components/prism-lisp");
|
||||||
|
require("prismjs/components/prism-livescript");
|
||||||
|
require("prismjs/components/prism-llvm");
|
||||||
|
require("prismjs/components/prism-log");
|
||||||
|
require("prismjs/components/prism-lolcode");
|
||||||
|
require("prismjs/components/prism-lua");
|
||||||
|
require("prismjs/components/prism-magma");
|
||||||
|
require("prismjs/components/prism-makefile");
|
||||||
|
require("prismjs/components/prism-markdown");
|
||||||
|
require("prismjs/components/prism-markup");
|
||||||
|
require("prismjs/components/prism-markup-templating");
|
||||||
|
require("prismjs/components/prism-matlab");
|
||||||
|
require("prismjs/components/prism-maxscript");
|
||||||
|
require("prismjs/components/prism-mel");
|
||||||
|
require("prismjs/components/prism-mermaid");
|
||||||
|
require("prismjs/components/prism-mizar");
|
||||||
|
require("prismjs/components/prism-mongodb");
|
||||||
|
require("prismjs/components/prism-monkey");
|
||||||
|
require("prismjs/components/prism-moonscript");
|
||||||
|
require("prismjs/components/prism-n1ql");
|
||||||
|
require("prismjs/components/prism-n4js");
|
||||||
|
require("prismjs/components/prism-nand2tetris-hdl");
|
||||||
|
require("prismjs/components/prism-naniscript");
|
||||||
|
require("prismjs/components/prism-nasm");
|
||||||
|
require("prismjs/components/prism-neon");
|
||||||
|
require("prismjs/components/prism-nevod");
|
||||||
|
require("prismjs/components/prism-nginx");
|
||||||
|
require("prismjs/components/prism-nim");
|
||||||
|
require("prismjs/components/prism-nix");
|
||||||
|
require("prismjs/components/prism-nsis");
|
||||||
|
require("prismjs/components/prism-objectivec");
|
||||||
|
require("prismjs/components/prism-ocaml");
|
||||||
|
require("prismjs/components/prism-opencl");
|
||||||
|
require("prismjs/components/prism-openqasm");
|
||||||
|
require("prismjs/components/prism-oz");
|
||||||
|
require("prismjs/components/prism-parigp");
|
||||||
|
require("prismjs/components/prism-parser");
|
||||||
|
require("prismjs/components/prism-pascal");
|
||||||
|
require("prismjs/components/prism-pascaligo");
|
||||||
|
require("prismjs/components/prism-pcaxis");
|
||||||
|
require("prismjs/components/prism-peoplecode");
|
||||||
|
require("prismjs/components/prism-perl");
|
||||||
|
require("prismjs/components/prism-php");
|
||||||
|
require("prismjs/components/prism-php-extras");
|
||||||
|
require("prismjs/components/prism-phpdoc");
|
||||||
|
require("prismjs/components/prism-plsql");
|
||||||
|
require("prismjs/components/prism-powerquery");
|
||||||
|
require("prismjs/components/prism-powershell");
|
||||||
|
require("prismjs/components/prism-processing");
|
||||||
|
require("prismjs/components/prism-prolog");
|
||||||
|
require("prismjs/components/prism-promql");
|
||||||
|
require("prismjs/components/prism-properties");
|
||||||
|
require("prismjs/components/prism-protobuf");
|
||||||
|
require("prismjs/components/prism-psl");
|
||||||
|
require("prismjs/components/prism-pug");
|
||||||
|
require("prismjs/components/prism-puppet");
|
||||||
|
require("prismjs/components/prism-pure");
|
||||||
|
require("prismjs/components/prism-purebasic");
|
||||||
|
require("prismjs/components/prism-purescript");
|
||||||
|
require("prismjs/components/prism-python");
|
||||||
|
require("prismjs/components/prism-q");
|
||||||
|
require("prismjs/components/prism-qml");
|
||||||
|
require("prismjs/components/prism-qore");
|
||||||
|
require("prismjs/components/prism-qsharp");
|
||||||
|
require("prismjs/components/prism-r");
|
||||||
|
require("prismjs/components/prism-reason");
|
||||||
|
require("prismjs/components/prism-regex");
|
||||||
|
require("prismjs/components/prism-rego");
|
||||||
|
require("prismjs/components/prism-renpy");
|
||||||
|
require("prismjs/components/prism-rest");
|
||||||
|
require("prismjs/components/prism-rip");
|
||||||
|
require("prismjs/components/prism-roboconf");
|
||||||
|
require("prismjs/components/prism-robotframework");
|
||||||
|
require("prismjs/components/prism-ruby");
|
||||||
|
require("prismjs/components/prism-rust");
|
||||||
|
require("prismjs/components/prism-sas");
|
||||||
|
require("prismjs/components/prism-sass");
|
||||||
|
require("prismjs/components/prism-scala");
|
||||||
|
require("prismjs/components/prism-scheme");
|
||||||
|
require("prismjs/components/prism-scss");
|
||||||
|
require("prismjs/components/prism-shell-session");
|
||||||
|
require("prismjs/components/prism-smali");
|
||||||
|
require("prismjs/components/prism-smalltalk");
|
||||||
|
require("prismjs/components/prism-smarty");
|
||||||
|
require("prismjs/components/prism-sml");
|
||||||
|
require("prismjs/components/prism-solidity");
|
||||||
|
require("prismjs/components/prism-solution-file");
|
||||||
|
require("prismjs/components/prism-soy");
|
||||||
|
require("prismjs/components/prism-splunk-spl");
|
||||||
|
require("prismjs/components/prism-sqf");
|
||||||
|
require("prismjs/components/prism-sql");
|
||||||
|
require("prismjs/components/prism-squirrel");
|
||||||
|
require("prismjs/components/prism-stan");
|
||||||
|
require("prismjs/components/prism-stylus");
|
||||||
|
require("prismjs/components/prism-swift");
|
||||||
|
require("prismjs/components/prism-systemd");
|
||||||
|
require("prismjs/components/prism-t4-templating");
|
||||||
|
require("prismjs/components/prism-t4-vb");
|
||||||
|
require("prismjs/components/prism-tap");
|
||||||
|
require("prismjs/components/prism-tcl");
|
||||||
|
require("prismjs/components/prism-textile");
|
||||||
|
require("prismjs/components/prism-toml");
|
||||||
|
require("prismjs/components/prism-tremor");
|
||||||
|
require("prismjs/components/prism-tsx");
|
||||||
|
require("prismjs/components/prism-tt2");
|
||||||
|
require("prismjs/components/prism-turtle");
|
||||||
|
require("prismjs/components/prism-twig");
|
||||||
|
require("prismjs/components/prism-typescript");
|
||||||
|
require("prismjs/components/prism-typoscript");
|
||||||
|
require("prismjs/components/prism-unrealscript");
|
||||||
|
require("prismjs/components/prism-uri");
|
||||||
|
require("prismjs/components/prism-v");
|
||||||
|
require("prismjs/components/prism-vala");
|
||||||
|
require("prismjs/components/prism-vbnet");
|
||||||
|
require("prismjs/components/prism-velocity");
|
||||||
|
require("prismjs/components/prism-verilog");
|
||||||
|
require("prismjs/components/prism-vhdl");
|
||||||
|
require("prismjs/components/prism-vim");
|
||||||
|
require("prismjs/components/prism-visual-basic");
|
||||||
|
require("prismjs/components/prism-warpscript");
|
||||||
|
require("prismjs/components/prism-wasm");
|
||||||
|
require("prismjs/components/prism-web-idl");
|
||||||
|
require("prismjs/components/prism-wiki");
|
||||||
|
require("prismjs/components/prism-wolfram");
|
||||||
|
require("prismjs/components/prism-wren");
|
||||||
|
require("prismjs/components/prism-xeora");
|
||||||
|
require("prismjs/components/prism-xml-doc");
|
||||||
|
require("prismjs/components/prism-xojo");
|
||||||
|
require("prismjs/components/prism-xquery");
|
||||||
|
require("prismjs/components/prism-yaml");
|
||||||
|
require("prismjs/components/prism-yang");
|
||||||
|
require("prismjs/components/prism-zig");
|
||||||
Loading…
Reference in a new issue