Spaces:
Paused
Paused
matt HOFFNER
commited on
Commit
·
f6091f7
1
Parent(s):
b572f4f
refactor to use openai functions
Browse files- package-lock.json +351 -0
- package.json +1 -1
- src/app/search/web/page.jsx +4 -11
- src/pages/api/llm.js +76 -79
- src/stream.js +27 -3
package-lock.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
| 16 |
"html-react-parser": "^3.0.9",
|
| 17 |
"next": "13.1.6",
|
| 18 |
"openai": "^3.3.0",
|
|
|
|
| 19 |
"react": "18.2.0",
|
| 20 |
"react-dom": "18.2.0",
|
| 21 |
"react-icons": "^4.7.1",
|
|
@@ -858,6 +859,11 @@
|
|
| 858 |
"readable-stream": "^3.4.0"
|
| 859 |
}
|
| 860 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 861 |
"node_modules/brace-expansion": {
|
| 862 |
"version": "1.1.11",
|
| 863 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
@@ -997,6 +1003,42 @@
|
|
| 997 |
"url": "https://github.com/sponsors/wooorm"
|
| 998 |
}
|
| 999 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1000 |
"node_modules/chokidar": {
|
| 1001 |
"version": "3.5.3",
|
| 1002 |
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
|
@@ -1121,6 +1163,32 @@
|
|
| 1121 |
"node": ">= 8"
|
| 1122 |
}
|
| 1123 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1124 |
"node_modules/cssesc": {
|
| 1125 |
"version": "3.0.0",
|
| 1126 |
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
|
@@ -1957,6 +2025,18 @@
|
|
| 1957 |
"url": "https://opencollective.com/eslint"
|
| 1958 |
}
|
| 1959 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1960 |
"node_modules/esquery": {
|
| 1961 |
"version": "1.4.1",
|
| 1962 |
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.1.tgz",
|
|
@@ -2011,6 +2091,11 @@
|
|
| 2011 |
"node": ">=6"
|
| 2012 |
}
|
| 2013 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2014 |
"node_modules/extend": {
|
| 2015 |
"version": "3.0.2",
|
| 2016 |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
|
@@ -3644,6 +3729,25 @@
|
|
| 3644 |
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
| 3645 |
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
| 3646 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3647 |
"node_modules/mri": {
|
| 3648 |
"version": "1.2.0",
|
| 3649 |
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
|
@@ -3792,6 +3896,17 @@
|
|
| 3792 |
"node": ">=0.10.0"
|
| 3793 |
}
|
| 3794 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3795 |
"node_modules/object-assign": {
|
| 3796 |
"version": "4.1.1",
|
| 3797 |
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
@@ -3947,6 +4062,32 @@
|
|
| 3947 |
"form-data": "^4.0.0"
|
| 3948 |
}
|
| 3949 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3950 |
"node_modules/optionator": {
|
| 3951 |
"version": "0.9.1",
|
| 3952 |
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
|
@@ -4002,6 +4143,29 @@
|
|
| 4002 |
"node": ">=6"
|
| 4003 |
}
|
| 4004 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4005 |
"node_modules/path-exists": {
|
| 4006 |
"version": "4.0.0",
|
| 4007 |
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
|
@@ -4243,6 +4407,11 @@
|
|
| 4243 |
"url": "https://github.com/sponsors/wooorm"
|
| 4244 |
}
|
| 4245 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4246 |
"node_modules/pump": {
|
| 4247 |
"version": "3.0.0",
|
| 4248 |
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
|
@@ -5316,6 +5485,29 @@
|
|
| 5316 |
"url": "https://opencollective.com/unified"
|
| 5317 |
}
|
| 5318 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5319 |
"node_modules/which": {
|
| 5320 |
"version": "2.0.2",
|
| 5321 |
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
@@ -5424,6 +5616,14 @@
|
|
| 5424 |
"funding": {
|
| 5425 |
"url": "https://github.com/sponsors/sindresorhus"
|
| 5426 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5427 |
}
|
| 5428 |
},
|
| 5429 |
"dependencies": {
|
|
@@ -5955,6 +6155,11 @@
|
|
| 5955 |
"readable-stream": "^3.4.0"
|
| 5956 |
}
|
| 5957 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5958 |
"brace-expansion": {
|
| 5959 |
"version": "1.1.11",
|
| 5960 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
@@ -6032,6 +6237,33 @@
|
|
| 6032 |
"resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",
|
| 6033 |
"integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="
|
| 6034 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6035 |
"chokidar": {
|
| 6036 |
"version": "3.5.3",
|
| 6037 |
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
|
@@ -6128,6 +6360,23 @@
|
|
| 6128 |
"which": "^2.0.1"
|
| 6129 |
}
|
| 6130 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6131 |
"cssesc": {
|
| 6132 |
"version": "3.0.0",
|
| 6133 |
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
|
@@ -6742,6 +6991,11 @@
|
|
| 6742 |
"eslint-visitor-keys": "^3.3.0"
|
| 6743 |
}
|
| 6744 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6745 |
"esquery": {
|
| 6746 |
"version": "1.4.1",
|
| 6747 |
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.1.tgz",
|
|
@@ -6778,6 +7032,11 @@
|
|
| 6778 |
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
| 6779 |
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="
|
| 6780 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6781 |
"extend": {
|
| 6782 |
"version": "3.0.2",
|
| 6783 |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
|
@@ -7816,6 +8075,19 @@
|
|
| 7816 |
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
| 7817 |
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
| 7818 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7819 |
"mri": {
|
| 7820 |
"version": "1.2.0",
|
| 7821 |
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
|
@@ -7909,6 +8181,14 @@
|
|
| 7909 |
"integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==",
|
| 7910 |
"dev": true
|
| 7911 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7912 |
"object-assign": {
|
| 7913 |
"version": "4.1.1",
|
| 7914 |
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
@@ -8016,6 +8296,34 @@
|
|
| 8016 |
"form-data": "^4.0.0"
|
| 8017 |
}
|
| 8018 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8019 |
"optionator": {
|
| 8020 |
"version": "0.9.1",
|
| 8021 |
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
|
@@ -8053,6 +8361,23 @@
|
|
| 8053 |
"callsites": "^3.0.0"
|
| 8054 |
}
|
| 8055 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8056 |
"path-exists": {
|
| 8057 |
"version": "4.0.0",
|
| 8058 |
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
|
@@ -8199,6 +8524,11 @@
|
|
| 8199 |
"resolved": "https://registry.npmjs.org/property-information/-/property-information-6.2.0.tgz",
|
| 8200 |
"integrity": "sha512-kma4U7AFCTwpqq5twzC1YVIDXSqg6qQK6JN0smOw8fgRy1OkMi0CYSzFmsy6dnqSenamAtj0CyXMUJ1Mf6oROg=="
|
| 8201 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8202 |
"pump": {
|
| 8203 |
"version": "3.0.0",
|
| 8204 |
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
|
@@ -8925,6 +9255,22 @@
|
|
| 8925 |
"unist-util-stringify-position": "^3.0.0"
|
| 8926 |
}
|
| 8927 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8928 |
"which": {
|
| 8929 |
"version": "2.0.2",
|
| 8930 |
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
@@ -9000,6 +9346,11 @@
|
|
| 9000 |
"version": "0.1.0",
|
| 9001 |
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
| 9002 |
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9003 |
}
|
| 9004 |
}
|
| 9005 |
}
|
|
|
|
| 16 |
"html-react-parser": "^3.0.9",
|
| 17 |
"next": "13.1.6",
|
| 18 |
"openai": "^3.3.0",
|
| 19 |
+
"openai-function-calling-tools": "^2.0.1",
|
| 20 |
"react": "18.2.0",
|
| 21 |
"react-dom": "18.2.0",
|
| 22 |
"react-icons": "^4.7.1",
|
|
|
|
| 859 |
"readable-stream": "^3.4.0"
|
| 860 |
}
|
| 861 |
},
|
| 862 |
+
"node_modules/boolbase": {
|
| 863 |
+
"version": "1.0.0",
|
| 864 |
+
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
| 865 |
+
"integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
|
| 866 |
+
},
|
| 867 |
"node_modules/brace-expansion": {
|
| 868 |
"version": "1.1.11",
|
| 869 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
|
|
| 1003 |
"url": "https://github.com/sponsors/wooorm"
|
| 1004 |
}
|
| 1005 |
},
|
| 1006 |
+
"node_modules/cheerio": {
|
| 1007 |
+
"version": "1.0.0-rc.12",
|
| 1008 |
+
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz",
|
| 1009 |
+
"integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==",
|
| 1010 |
+
"dependencies": {
|
| 1011 |
+
"cheerio-select": "^2.1.0",
|
| 1012 |
+
"dom-serializer": "^2.0.0",
|
| 1013 |
+
"domhandler": "^5.0.3",
|
| 1014 |
+
"domutils": "^3.0.1",
|
| 1015 |
+
"htmlparser2": "^8.0.1",
|
| 1016 |
+
"parse5": "^7.0.0",
|
| 1017 |
+
"parse5-htmlparser2-tree-adapter": "^7.0.0"
|
| 1018 |
+
},
|
| 1019 |
+
"engines": {
|
| 1020 |
+
"node": ">= 6"
|
| 1021 |
+
},
|
| 1022 |
+
"funding": {
|
| 1023 |
+
"url": "https://github.com/cheeriojs/cheerio?sponsor=1"
|
| 1024 |
+
}
|
| 1025 |
+
},
|
| 1026 |
+
"node_modules/cheerio-select": {
|
| 1027 |
+
"version": "2.1.0",
|
| 1028 |
+
"resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz",
|
| 1029 |
+
"integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==",
|
| 1030 |
+
"dependencies": {
|
| 1031 |
+
"boolbase": "^1.0.0",
|
| 1032 |
+
"css-select": "^5.1.0",
|
| 1033 |
+
"css-what": "^6.1.0",
|
| 1034 |
+
"domelementtype": "^2.3.0",
|
| 1035 |
+
"domhandler": "^5.0.3",
|
| 1036 |
+
"domutils": "^3.0.1"
|
| 1037 |
+
},
|
| 1038 |
+
"funding": {
|
| 1039 |
+
"url": "https://github.com/sponsors/fb55"
|
| 1040 |
+
}
|
| 1041 |
+
},
|
| 1042 |
"node_modules/chokidar": {
|
| 1043 |
"version": "3.5.3",
|
| 1044 |
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
|
|
|
| 1163 |
"node": ">= 8"
|
| 1164 |
}
|
| 1165 |
},
|
| 1166 |
+
"node_modules/css-select": {
|
| 1167 |
+
"version": "5.1.0",
|
| 1168 |
+
"resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz",
|
| 1169 |
+
"integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==",
|
| 1170 |
+
"dependencies": {
|
| 1171 |
+
"boolbase": "^1.0.0",
|
| 1172 |
+
"css-what": "^6.1.0",
|
| 1173 |
+
"domhandler": "^5.0.2",
|
| 1174 |
+
"domutils": "^3.0.1",
|
| 1175 |
+
"nth-check": "^2.0.1"
|
| 1176 |
+
},
|
| 1177 |
+
"funding": {
|
| 1178 |
+
"url": "https://github.com/sponsors/fb55"
|
| 1179 |
+
}
|
| 1180 |
+
},
|
| 1181 |
+
"node_modules/css-what": {
|
| 1182 |
+
"version": "6.1.0",
|
| 1183 |
+
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
|
| 1184 |
+
"integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==",
|
| 1185 |
+
"engines": {
|
| 1186 |
+
"node": ">= 6"
|
| 1187 |
+
},
|
| 1188 |
+
"funding": {
|
| 1189 |
+
"url": "https://github.com/sponsors/fb55"
|
| 1190 |
+
}
|
| 1191 |
+
},
|
| 1192 |
"node_modules/cssesc": {
|
| 1193 |
"version": "3.0.0",
|
| 1194 |
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
|
|
|
| 2025 |
"url": "https://opencollective.com/eslint"
|
| 2026 |
}
|
| 2027 |
},
|
| 2028 |
+
"node_modules/esprima": {
|
| 2029 |
+
"version": "4.0.1",
|
| 2030 |
+
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
| 2031 |
+
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
|
| 2032 |
+
"bin": {
|
| 2033 |
+
"esparse": "bin/esparse.js",
|
| 2034 |
+
"esvalidate": "bin/esvalidate.js"
|
| 2035 |
+
},
|
| 2036 |
+
"engines": {
|
| 2037 |
+
"node": ">=4"
|
| 2038 |
+
}
|
| 2039 |
+
},
|
| 2040 |
"node_modules/esquery": {
|
| 2041 |
"version": "1.4.1",
|
| 2042 |
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.1.tgz",
|
|
|
|
| 2091 |
"node": ">=6"
|
| 2092 |
}
|
| 2093 |
},
|
| 2094 |
+
"node_modules/expr-eval": {
|
| 2095 |
+
"version": "2.0.2",
|
| 2096 |
+
"resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-2.0.2.tgz",
|
| 2097 |
+
"integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg=="
|
| 2098 |
+
},
|
| 2099 |
"node_modules/extend": {
|
| 2100 |
"version": "3.0.2",
|
| 2101 |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
|
|
|
| 3729 |
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
| 3730 |
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
| 3731 |
},
|
| 3732 |
+
"node_modules/moment": {
|
| 3733 |
+
"version": "2.29.4",
|
| 3734 |
+
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
| 3735 |
+
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
|
| 3736 |
+
"engines": {
|
| 3737 |
+
"node": "*"
|
| 3738 |
+
}
|
| 3739 |
+
},
|
| 3740 |
+
"node_modules/moment-timezone": {
|
| 3741 |
+
"version": "0.5.43",
|
| 3742 |
+
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz",
|
| 3743 |
+
"integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==",
|
| 3744 |
+
"dependencies": {
|
| 3745 |
+
"moment": "^2.29.4"
|
| 3746 |
+
},
|
| 3747 |
+
"engines": {
|
| 3748 |
+
"node": "*"
|
| 3749 |
+
}
|
| 3750 |
+
},
|
| 3751 |
"node_modules/mri": {
|
| 3752 |
"version": "1.2.0",
|
| 3753 |
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
|
|
|
| 3896 |
"node": ">=0.10.0"
|
| 3897 |
}
|
| 3898 |
},
|
| 3899 |
+
"node_modules/nth-check": {
|
| 3900 |
+
"version": "2.1.1",
|
| 3901 |
+
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
| 3902 |
+
"integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
|
| 3903 |
+
"dependencies": {
|
| 3904 |
+
"boolbase": "^1.0.0"
|
| 3905 |
+
},
|
| 3906 |
+
"funding": {
|
| 3907 |
+
"url": "https://github.com/fb55/nth-check?sponsor=1"
|
| 3908 |
+
}
|
| 3909 |
+
},
|
| 3910 |
"node_modules/object-assign": {
|
| 3911 |
"version": "4.1.1",
|
| 3912 |
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
|
|
| 4062 |
"form-data": "^4.0.0"
|
| 4063 |
}
|
| 4064 |
},
|
| 4065 |
+
"node_modules/openai-function-calling-tools": {
|
| 4066 |
+
"version": "2.0.1",
|
| 4067 |
+
"resolved": "https://registry.npmjs.org/openai-function-calling-tools/-/openai-function-calling-tools-2.0.1.tgz",
|
| 4068 |
+
"integrity": "sha512-1wnSzBZG7UP/9hb6164bC/1DlNfWioOUgGbftp2uMylvDQ1QJWrIVlkYmu55Gxmrrf8n/bcf8zKcsM/easn+wA==",
|
| 4069 |
+
"dependencies": {
|
| 4070 |
+
"axios": "^1.4.0",
|
| 4071 |
+
"cheerio": "1.0.0-rc.12",
|
| 4072 |
+
"esprima": "^4.0.1",
|
| 4073 |
+
"expr-eval": "^2.0.2",
|
| 4074 |
+
"moment": "^2.29.4",
|
| 4075 |
+
"moment-timezone": "^0.5.43",
|
| 4076 |
+
"openai": "^3.3.0",
|
| 4077 |
+
"vm2": "^3.9.19",
|
| 4078 |
+
"zod": "^3.21.4"
|
| 4079 |
+
}
|
| 4080 |
+
},
|
| 4081 |
+
"node_modules/openai-function-calling-tools/node_modules/axios": {
|
| 4082 |
+
"version": "1.4.0",
|
| 4083 |
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
|
| 4084 |
+
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
|
| 4085 |
+
"dependencies": {
|
| 4086 |
+
"follow-redirects": "^1.15.0",
|
| 4087 |
+
"form-data": "^4.0.0",
|
| 4088 |
+
"proxy-from-env": "^1.1.0"
|
| 4089 |
+
}
|
| 4090 |
+
},
|
| 4091 |
"node_modules/optionator": {
|
| 4092 |
"version": "0.9.1",
|
| 4093 |
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
|
|
|
| 4143 |
"node": ">=6"
|
| 4144 |
}
|
| 4145 |
},
|
| 4146 |
+
"node_modules/parse5": {
|
| 4147 |
+
"version": "7.1.2",
|
| 4148 |
+
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz",
|
| 4149 |
+
"integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==",
|
| 4150 |
+
"dependencies": {
|
| 4151 |
+
"entities": "^4.4.0"
|
| 4152 |
+
},
|
| 4153 |
+
"funding": {
|
| 4154 |
+
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
| 4155 |
+
}
|
| 4156 |
+
},
|
| 4157 |
+
"node_modules/parse5-htmlparser2-tree-adapter": {
|
| 4158 |
+
"version": "7.0.0",
|
| 4159 |
+
"resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz",
|
| 4160 |
+
"integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==",
|
| 4161 |
+
"dependencies": {
|
| 4162 |
+
"domhandler": "^5.0.2",
|
| 4163 |
+
"parse5": "^7.0.0"
|
| 4164 |
+
},
|
| 4165 |
+
"funding": {
|
| 4166 |
+
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
| 4167 |
+
}
|
| 4168 |
+
},
|
| 4169 |
"node_modules/path-exists": {
|
| 4170 |
"version": "4.0.0",
|
| 4171 |
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
|
|
|
| 4407 |
"url": "https://github.com/sponsors/wooorm"
|
| 4408 |
}
|
| 4409 |
},
|
| 4410 |
+
"node_modules/proxy-from-env": {
|
| 4411 |
+
"version": "1.1.0",
|
| 4412 |
+
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
| 4413 |
+
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
| 4414 |
+
},
|
| 4415 |
"node_modules/pump": {
|
| 4416 |
"version": "3.0.0",
|
| 4417 |
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
|
|
|
| 5485 |
"url": "https://opencollective.com/unified"
|
| 5486 |
}
|
| 5487 |
},
|
| 5488 |
+
"node_modules/vm2": {
|
| 5489 |
+
"version": "3.9.19",
|
| 5490 |
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz",
|
| 5491 |
+
"integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==",
|
| 5492 |
+
"dependencies": {
|
| 5493 |
+
"acorn": "^8.7.0",
|
| 5494 |
+
"acorn-walk": "^8.2.0"
|
| 5495 |
+
},
|
| 5496 |
+
"bin": {
|
| 5497 |
+
"vm2": "bin/vm2"
|
| 5498 |
+
},
|
| 5499 |
+
"engines": {
|
| 5500 |
+
"node": ">=6.0"
|
| 5501 |
+
}
|
| 5502 |
+
},
|
| 5503 |
+
"node_modules/vm2/node_modules/acorn-walk": {
|
| 5504 |
+
"version": "8.2.0",
|
| 5505 |
+
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
| 5506 |
+
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
| 5507 |
+
"engines": {
|
| 5508 |
+
"node": ">=0.4.0"
|
| 5509 |
+
}
|
| 5510 |
+
},
|
| 5511 |
"node_modules/which": {
|
| 5512 |
"version": "2.0.2",
|
| 5513 |
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
|
|
| 5616 |
"funding": {
|
| 5617 |
"url": "https://github.com/sponsors/sindresorhus"
|
| 5618 |
}
|
| 5619 |
+
},
|
| 5620 |
+
"node_modules/zod": {
|
| 5621 |
+
"version": "3.21.4",
|
| 5622 |
+
"resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz",
|
| 5623 |
+
"integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==",
|
| 5624 |
+
"funding": {
|
| 5625 |
+
"url": "https://github.com/sponsors/colinhacks"
|
| 5626 |
+
}
|
| 5627 |
}
|
| 5628 |
},
|
| 5629 |
"dependencies": {
|
|
|
|
| 6155 |
"readable-stream": "^3.4.0"
|
| 6156 |
}
|
| 6157 |
},
|
| 6158 |
+
"boolbase": {
|
| 6159 |
+
"version": "1.0.0",
|
| 6160 |
+
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
| 6161 |
+
"integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
|
| 6162 |
+
},
|
| 6163 |
"brace-expansion": {
|
| 6164 |
"version": "1.1.11",
|
| 6165 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
|
|
| 6237 |
"resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",
|
| 6238 |
"integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="
|
| 6239 |
},
|
| 6240 |
+
"cheerio": {
|
| 6241 |
+
"version": "1.0.0-rc.12",
|
| 6242 |
+
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz",
|
| 6243 |
+
"integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==",
|
| 6244 |
+
"requires": {
|
| 6245 |
+
"cheerio-select": "^2.1.0",
|
| 6246 |
+
"dom-serializer": "^2.0.0",
|
| 6247 |
+
"domhandler": "^5.0.3",
|
| 6248 |
+
"domutils": "^3.0.1",
|
| 6249 |
+
"htmlparser2": "^8.0.1",
|
| 6250 |
+
"parse5": "^7.0.0",
|
| 6251 |
+
"parse5-htmlparser2-tree-adapter": "^7.0.0"
|
| 6252 |
+
}
|
| 6253 |
+
},
|
| 6254 |
+
"cheerio-select": {
|
| 6255 |
+
"version": "2.1.0",
|
| 6256 |
+
"resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz",
|
| 6257 |
+
"integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==",
|
| 6258 |
+
"requires": {
|
| 6259 |
+
"boolbase": "^1.0.0",
|
| 6260 |
+
"css-select": "^5.1.0",
|
| 6261 |
+
"css-what": "^6.1.0",
|
| 6262 |
+
"domelementtype": "^2.3.0",
|
| 6263 |
+
"domhandler": "^5.0.3",
|
| 6264 |
+
"domutils": "^3.0.1"
|
| 6265 |
+
}
|
| 6266 |
+
},
|
| 6267 |
"chokidar": {
|
| 6268 |
"version": "3.5.3",
|
| 6269 |
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
|
|
|
| 6360 |
"which": "^2.0.1"
|
| 6361 |
}
|
| 6362 |
},
|
| 6363 |
+
"css-select": {
|
| 6364 |
+
"version": "5.1.0",
|
| 6365 |
+
"resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz",
|
| 6366 |
+
"integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==",
|
| 6367 |
+
"requires": {
|
| 6368 |
+
"boolbase": "^1.0.0",
|
| 6369 |
+
"css-what": "^6.1.0",
|
| 6370 |
+
"domhandler": "^5.0.2",
|
| 6371 |
+
"domutils": "^3.0.1",
|
| 6372 |
+
"nth-check": "^2.0.1"
|
| 6373 |
+
}
|
| 6374 |
+
},
|
| 6375 |
+
"css-what": {
|
| 6376 |
+
"version": "6.1.0",
|
| 6377 |
+
"resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
|
| 6378 |
+
"integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw=="
|
| 6379 |
+
},
|
| 6380 |
"cssesc": {
|
| 6381 |
"version": "3.0.0",
|
| 6382 |
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
|
|
|
|
| 6991 |
"eslint-visitor-keys": "^3.3.0"
|
| 6992 |
}
|
| 6993 |
},
|
| 6994 |
+
"esprima": {
|
| 6995 |
+
"version": "4.0.1",
|
| 6996 |
+
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
| 6997 |
+
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
| 6998 |
+
},
|
| 6999 |
"esquery": {
|
| 7000 |
"version": "1.4.1",
|
| 7001 |
"resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.1.tgz",
|
|
|
|
| 7032 |
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
| 7033 |
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="
|
| 7034 |
},
|
| 7035 |
+
"expr-eval": {
|
| 7036 |
+
"version": "2.0.2",
|
| 7037 |
+
"resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-2.0.2.tgz",
|
| 7038 |
+
"integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg=="
|
| 7039 |
+
},
|
| 7040 |
"extend": {
|
| 7041 |
"version": "3.0.2",
|
| 7042 |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
|
|
|
| 8075 |
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
| 8076 |
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
|
| 8077 |
},
|
| 8078 |
+
"moment": {
|
| 8079 |
+
"version": "2.29.4",
|
| 8080 |
+
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
| 8081 |
+
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
|
| 8082 |
+
},
|
| 8083 |
+
"moment-timezone": {
|
| 8084 |
+
"version": "0.5.43",
|
| 8085 |
+
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz",
|
| 8086 |
+
"integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==",
|
| 8087 |
+
"requires": {
|
| 8088 |
+
"moment": "^2.29.4"
|
| 8089 |
+
}
|
| 8090 |
+
},
|
| 8091 |
"mri": {
|
| 8092 |
"version": "1.2.0",
|
| 8093 |
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
|
|
|
|
| 8181 |
"integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==",
|
| 8182 |
"dev": true
|
| 8183 |
},
|
| 8184 |
+
"nth-check": {
|
| 8185 |
+
"version": "2.1.1",
|
| 8186 |
+
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
| 8187 |
+
"integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
|
| 8188 |
+
"requires": {
|
| 8189 |
+
"boolbase": "^1.0.0"
|
| 8190 |
+
}
|
| 8191 |
+
},
|
| 8192 |
"object-assign": {
|
| 8193 |
"version": "4.1.1",
|
| 8194 |
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
|
|
| 8296 |
"form-data": "^4.0.0"
|
| 8297 |
}
|
| 8298 |
},
|
| 8299 |
+
"openai-function-calling-tools": {
|
| 8300 |
+
"version": "2.0.1",
|
| 8301 |
+
"resolved": "https://registry.npmjs.org/openai-function-calling-tools/-/openai-function-calling-tools-2.0.1.tgz",
|
| 8302 |
+
"integrity": "sha512-1wnSzBZG7UP/9hb6164bC/1DlNfWioOUgGbftp2uMylvDQ1QJWrIVlkYmu55Gxmrrf8n/bcf8zKcsM/easn+wA==",
|
| 8303 |
+
"requires": {
|
| 8304 |
+
"axios": "^1.4.0",
|
| 8305 |
+
"cheerio": "1.0.0-rc.12",
|
| 8306 |
+
"esprima": "^4.0.1",
|
| 8307 |
+
"expr-eval": "^2.0.2",
|
| 8308 |
+
"moment": "^2.29.4",
|
| 8309 |
+
"moment-timezone": "^0.5.43",
|
| 8310 |
+
"openai": "^3.3.0",
|
| 8311 |
+
"vm2": "^3.9.19",
|
| 8312 |
+
"zod": "^3.21.4"
|
| 8313 |
+
},
|
| 8314 |
+
"dependencies": {
|
| 8315 |
+
"axios": {
|
| 8316 |
+
"version": "1.4.0",
|
| 8317 |
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
|
| 8318 |
+
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
|
| 8319 |
+
"requires": {
|
| 8320 |
+
"follow-redirects": "^1.15.0",
|
| 8321 |
+
"form-data": "^4.0.0",
|
| 8322 |
+
"proxy-from-env": "^1.1.0"
|
| 8323 |
+
}
|
| 8324 |
+
}
|
| 8325 |
+
}
|
| 8326 |
+
},
|
| 8327 |
"optionator": {
|
| 8328 |
"version": "0.9.1",
|
| 8329 |
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
|
|
|
|
| 8361 |
"callsites": "^3.0.0"
|
| 8362 |
}
|
| 8363 |
},
|
| 8364 |
+
"parse5": {
|
| 8365 |
+
"version": "7.1.2",
|
| 8366 |
+
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz",
|
| 8367 |
+
"integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==",
|
| 8368 |
+
"requires": {
|
| 8369 |
+
"entities": "^4.4.0"
|
| 8370 |
+
}
|
| 8371 |
+
},
|
| 8372 |
+
"parse5-htmlparser2-tree-adapter": {
|
| 8373 |
+
"version": "7.0.0",
|
| 8374 |
+
"resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz",
|
| 8375 |
+
"integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==",
|
| 8376 |
+
"requires": {
|
| 8377 |
+
"domhandler": "^5.0.2",
|
| 8378 |
+
"parse5": "^7.0.0"
|
| 8379 |
+
}
|
| 8380 |
+
},
|
| 8381 |
"path-exists": {
|
| 8382 |
"version": "4.0.0",
|
| 8383 |
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
|
|
|
| 8524 |
"resolved": "https://registry.npmjs.org/property-information/-/property-information-6.2.0.tgz",
|
| 8525 |
"integrity": "sha512-kma4U7AFCTwpqq5twzC1YVIDXSqg6qQK6JN0smOw8fgRy1OkMi0CYSzFmsy6dnqSenamAtj0CyXMUJ1Mf6oROg=="
|
| 8526 |
},
|
| 8527 |
+
"proxy-from-env": {
|
| 8528 |
+
"version": "1.1.0",
|
| 8529 |
+
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
| 8530 |
+
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
| 8531 |
+
},
|
| 8532 |
"pump": {
|
| 8533 |
"version": "3.0.0",
|
| 8534 |
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
|
|
|
| 9255 |
"unist-util-stringify-position": "^3.0.0"
|
| 9256 |
}
|
| 9257 |
},
|
| 9258 |
+
"vm2": {
|
| 9259 |
+
"version": "3.9.19",
|
| 9260 |
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz",
|
| 9261 |
+
"integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==",
|
| 9262 |
+
"requires": {
|
| 9263 |
+
"acorn": "^8.7.0",
|
| 9264 |
+
"acorn-walk": "^8.2.0"
|
| 9265 |
+
},
|
| 9266 |
+
"dependencies": {
|
| 9267 |
+
"acorn-walk": {
|
| 9268 |
+
"version": "8.2.0",
|
| 9269 |
+
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
| 9270 |
+
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA=="
|
| 9271 |
+
}
|
| 9272 |
+
}
|
| 9273 |
+
},
|
| 9274 |
"which": {
|
| 9275 |
"version": "2.0.2",
|
| 9276 |
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
|
|
|
| 9346 |
"version": "0.1.0",
|
| 9347 |
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
| 9348 |
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
|
| 9349 |
+
},
|
| 9350 |
+
"zod": {
|
| 9351 |
+
"version": "3.21.4",
|
| 9352 |
+
"resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz",
|
| 9353 |
+
"integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw=="
|
| 9354 |
}
|
| 9355 |
}
|
| 9356 |
}
|
package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
| 17 |
"html-react-parser": "^3.0.9",
|
| 18 |
"next": "13.1.6",
|
| 19 |
"openai": "^3.3.0",
|
| 20 |
-
"openai-function-calling-tools": "
|
| 21 |
"react": "18.2.0",
|
| 22 |
"react-dom": "18.2.0",
|
| 23 |
"react-icons": "^4.7.1",
|
|
|
|
| 17 |
"html-react-parser": "^3.0.9",
|
| 18 |
"next": "13.1.6",
|
| 19 |
"openai": "^3.3.0",
|
| 20 |
+
"openai-function-calling-tools": "^2.0.1",
|
| 21 |
"react": "18.2.0",
|
| 22 |
"react-dom": "18.2.0",
|
| 23 |
"react-icons": "^4.7.1",
|
src/app/search/web/page.jsx
CHANGED
|
@@ -11,6 +11,7 @@ export default function WebSearchPage({ searchParams }) {
|
|
| 11 |
useEffect(() => {
|
| 12 |
async function fetchData() {
|
| 13 |
// Fetch Google search results via server-side route
|
|
|
|
| 14 |
const response = await fetch(`/api/search?searchTerm=${searchParams.searchTerm}&start=${startIndex}`);
|
| 15 |
if (!response.ok) {
|
| 16 |
console.log(response);
|
|
@@ -18,9 +19,10 @@ export default function WebSearchPage({ searchParams }) {
|
|
| 18 |
}
|
| 19 |
const data = await response.json();
|
| 20 |
setResults(data.items);
|
|
|
|
| 21 |
|
| 22 |
// Prepare AI prompt
|
| 23 |
-
const aiPrompt = `You're creating a search engine experience. You got the following search results for the term "${searchParams.searchTerm}": ${JSON.stringify(data.items)}. How can you present these results in a helpful way?`;
|
| 24 |
|
| 25 |
// Fetch AI response via server-side route
|
| 26 |
const openaiRes = new EventSource('/api/llm', {
|
|
@@ -29,16 +31,7 @@ export default function WebSearchPage({ searchParams }) {
|
|
| 29 |
'Content-Type': 'application/json',
|
| 30 |
},
|
| 31 |
body: JSON.stringify({
|
| 32 |
-
'
|
| 33 |
-
'messages': [{
|
| 34 |
-
'role': 'system',
|
| 35 |
-
'content': 'You are a helpful assistant.'
|
| 36 |
-
}, {
|
| 37 |
-
'role': 'user',
|
| 38 |
-
'content': searchParams.searchTerm
|
| 39 |
-
}],
|
| 40 |
-
'prompt': aiPrompt,
|
| 41 |
-
'temperature': 0.5
|
| 42 |
})
|
| 43 |
});
|
| 44 |
|
|
|
|
| 11 |
useEffect(() => {
|
| 12 |
async function fetchData() {
|
| 13 |
// Fetch Google search results via server-side route
|
| 14 |
+
/*
|
| 15 |
const response = await fetch(`/api/search?searchTerm=${searchParams.searchTerm}&start=${startIndex}`);
|
| 16 |
if (!response.ok) {
|
| 17 |
console.log(response);
|
|
|
|
| 19 |
}
|
| 20 |
const data = await response.json();
|
| 21 |
setResults(data.items);
|
| 22 |
+
*/
|
| 23 |
|
| 24 |
// Prepare AI prompt
|
| 25 |
+
// const aiPrompt = `You're creating a search engine experience. You got the following search results for the term "${searchParams.searchTerm}": ${JSON.stringify(data.items)}. How can you present these results in a helpful way?`;
|
| 26 |
|
| 27 |
// Fetch AI response via server-side route
|
| 28 |
const openaiRes = new EventSource('/api/llm', {
|
|
|
|
| 31 |
'Content-Type': 'application/json',
|
| 32 |
},
|
| 33 |
body: JSON.stringify({
|
| 34 |
+
'question': searchParams.searchTerm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
})
|
| 36 |
});
|
| 37 |
|
src/pages/api/llm.js
CHANGED
|
@@ -1,84 +1,81 @@
|
|
| 1 |
-
import {
|
| 2 |
-
import
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
export const OPENAI_API_HOST =
|
| 11 |
-
process.env.OPENAI_API_HOST || 'https://api.openai.com';
|
| 12 |
-
|
| 13 |
-
export const DEFAULT_TEMPERATURE =
|
| 14 |
-
parseFloat(process.env.NEXT_PUBLIC_DEFAULT_TEMPERATURE || "1");
|
| 15 |
-
|
| 16 |
-
export const OPENAI_API_TYPE =
|
| 17 |
-
process.env.OPENAI_API_TYPE || 'openai';
|
| 18 |
-
|
| 19 |
-
export const OPENAI_API_VERSION =
|
| 20 |
-
process.env.OPENAI_API_VERSION || '2023-03-15-preview';
|
| 21 |
-
|
| 22 |
-
export const OPENAI_ORGANIZATION =
|
| 23 |
-
process.env.OPENAI_ORGANIZATION || '';
|
| 24 |
-
|
| 25 |
-
export const AZURE_DEPLOYMENT_ID =
|
| 26 |
-
process.env.AZURE_DEPLOYMENT_ID || '';
|
| 27 |
-
|
| 28 |
-
export const config = {
|
| 29 |
-
runtime: 'edge',
|
| 30 |
-
};
|
| 31 |
-
|
| 32 |
-
const handler = async (req) => {
|
| 33 |
-
try {
|
| 34 |
-
const { model, messages, prompt, temperature } = (await req.json());
|
| 35 |
-
|
| 36 |
-
await init((imports) => WebAssembly.instantiate(wasm, imports));
|
| 37 |
-
const encoding = new Tiktoken(
|
| 38 |
-
tiktokenModel.bpe_ranks,
|
| 39 |
-
tiktokenModel.special_tokens,
|
| 40 |
-
tiktokenModel.pat_str,
|
| 41 |
-
);
|
| 42 |
-
|
| 43 |
-
let promptToSend = prompt;
|
| 44 |
-
if (!promptToSend) {
|
| 45 |
-
promptToSend = DEFAULT_SYSTEM_PROMPT;
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
let temperatureToUse = temperature;
|
| 49 |
-
if (temperatureToUse == null) {
|
| 50 |
-
temperatureToUse = DEFAULT_TEMPERATURE;
|
| 51 |
-
}
|
| 52 |
-
|
| 53 |
-
const prompt_tokens = encoding.encode(promptToSend);
|
| 54 |
-
|
| 55 |
-
let tokenCount = prompt_tokens.length;
|
| 56 |
-
let messagesToSend = [];
|
| 57 |
-
|
| 58 |
-
for (let i = messages.length - 1; i >= 0; i--) {
|
| 59 |
-
const message = messages[i];
|
| 60 |
-
const tokens = encoding.encode(message.content);
|
| 61 |
-
|
| 62 |
-
if (tokenCount + tokens.length + 1000 > model.tokenLimit) {
|
| 63 |
-
break;
|
| 64 |
-
}
|
| 65 |
-
tokenCount += tokens.length;
|
| 66 |
-
messagesToSend = [message, ...messagesToSend];
|
| 67 |
-
}
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
}
|
| 81 |
}
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
export default handler;
|
|
|
|
| 1 |
+
import { Configuration, OpenAIApi } from "openai";
|
| 2 |
+
import { GoogleCustomSearch } from "openai-function-calling-tools";
|
| 3 |
+
|
| 4 |
+
export default async function handler(req, res) {
|
| 5 |
+
if (req.method !== 'POST') {
|
| 6 |
+
// Handle any other HTTP method
|
| 7 |
+
res.status(405).send({ error: 'Method Not Allowed', method: req.method });
|
| 8 |
+
return;
|
| 9 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
const QUESTION = req.body.question;
|
| 12 |
|
| 13 |
+
if (!QUESTION) {
|
| 14 |
+
res.status(400).send({ error: 'Question is missing in request body' });
|
| 15 |
+
return;
|
| 16 |
+
}
|
| 17 |
|
| 18 |
+
const configuration = new Configuration({
|
| 19 |
+
apiKey: process.env.OPENAI_API_KEY,
|
| 20 |
+
});
|
| 21 |
+
const openai = new OpenAIApi(configuration);
|
| 22 |
+
|
| 23 |
+
const messages = [
|
| 24 |
+
{
|
| 25 |
+
role: "user",
|
| 26 |
+
content: QUESTION,
|
| 27 |
+
},
|
| 28 |
+
];
|
| 29 |
+
|
| 30 |
+
const { googleCustomSearch, googleCustomSearchSchema } = new GoogleCustomSearch({
|
| 31 |
+
apiKey: process.env.GOOGLE_API_KEY,
|
| 32 |
+
googleCSEId: process.env.GOOGLE_CSE_ID,
|
| 33 |
+
});
|
| 34 |
+
|
| 35 |
+
const functions = {
|
| 36 |
+
googleCustomSearch,
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
const getCompletion = async (messages) => {
|
| 40 |
+
const response = await openai.createChatCompletion({
|
| 41 |
+
model: "gpt-3.5-turbo-0613",
|
| 42 |
+
messages,
|
| 43 |
+
functions: [googleCustomSearchSchema],
|
| 44 |
+
temperature: 0,
|
| 45 |
+
});
|
| 46 |
+
|
| 47 |
+
return response;
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
let response;
|
| 51 |
+
|
| 52 |
+
while (true) {
|
| 53 |
+
response = await getCompletion(messages);
|
| 54 |
+
|
| 55 |
+
if (response.data.choices[0].finish_reason === "stop") {
|
| 56 |
+
res.status(200).json({ result: response.data.choices[0].message.content });
|
| 57 |
+
break;
|
| 58 |
+
} else if (response.data.choices[0].finish_reason === "function_call") {
|
| 59 |
+
const fnName = response.data.choices[0].message.function_call.name;
|
| 60 |
+
const args = response.data.choices[0].message.function_call.arguments;
|
| 61 |
+
|
| 62 |
+
const fn = functions[fnName];
|
| 63 |
+
const result = await fn(...Object.values(JSON.parse(args)));
|
| 64 |
+
|
| 65 |
+
messages.push({
|
| 66 |
+
role: "assistant",
|
| 67 |
+
content: "",
|
| 68 |
+
function_call: {
|
| 69 |
+
name: fnName,
|
| 70 |
+
arguments: args,
|
| 71 |
+
},
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
messages.push({
|
| 75 |
+
role: "function",
|
| 76 |
+
name: fnName,
|
| 77 |
+
content: JSON.stringify({ result: result }),
|
| 78 |
+
});
|
| 79 |
}
|
| 80 |
}
|
| 81 |
+
}
|
|
|
|
|
|
src/stream.js
CHANGED
|
@@ -74,16 +74,40 @@ export const OpenAIStream = async (
|
|
| 74 |
|
| 75 |
const stream = new ReadableStream({
|
| 76 |
async start(controller) {
|
| 77 |
-
const onParse = (event) => {
|
| 78 |
if (event.type === 'event') {
|
| 79 |
const data = event.data;
|
| 80 |
|
| 81 |
try {
|
| 82 |
const json = JSON.parse(data);
|
| 83 |
-
if (json.choices[0].finish_reason
|
| 84 |
controller.close();
|
| 85 |
return;
|
| 86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
const text = json.choices[0].delta.content;
|
| 88 |
const queue = encoder.encode(text);
|
| 89 |
controller.enqueue(queue);
|
|
|
|
| 74 |
|
| 75 |
const stream = new ReadableStream({
|
| 76 |
async start(controller) {
|
| 77 |
+
const onParse = async (event) => {
|
| 78 |
if (event.type === 'event') {
|
| 79 |
const data = event.data;
|
| 80 |
|
| 81 |
try {
|
| 82 |
const json = JSON.parse(data);
|
| 83 |
+
if (json.choices[0].finish_reason === "stop") {
|
| 84 |
controller.close();
|
| 85 |
return;
|
| 86 |
+
} else if (json.choices[0].finish_reason === "function_call") {
|
| 87 |
+
const fnName = json.choices[0].message.function_call.name;
|
| 88 |
+
const args = json.choices[0].message.function_call.arguments;
|
| 89 |
+
|
| 90 |
+
const fn = functions[fnName];
|
| 91 |
+
const result = await fn(...Object.values(JSON.parse(args)));
|
| 92 |
+
|
| 93 |
+
console.log(`Function call: ${fnName}, Arguments: ${args}`);
|
| 94 |
+
console.log(`Calling Function ${fnName} Result: ` + result);
|
| 95 |
+
|
| 96 |
+
messages.push({
|
| 97 |
+
role: "assistant",
|
| 98 |
+
content: "",
|
| 99 |
+
function_call: {
|
| 100 |
+
name: fnName,
|
| 101 |
+
arguments: args,
|
| 102 |
+
},
|
| 103 |
+
});
|
| 104 |
+
|
| 105 |
+
messages.push({
|
| 106 |
+
role: "function",
|
| 107 |
+
name: fnName,
|
| 108 |
+
content: JSON.stringify({ result: result }),
|
| 109 |
+
});
|
| 110 |
+
}
|
| 111 |
const text = json.choices[0].delta.content;
|
| 112 |
const queue = encoder.encode(text);
|
| 113 |
controller.enqueue(queue);
|