21eeded6 by Janis

Merge branch 'fix_master_updated_ui' into '1DEVT'

fix_master_updated_ui

See merge request !4
2 parents 3f4efe8d 5fbcb51a
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
2 2
3 # dependencies 3 # dependencies
4 /node_modules 4 /node_modules
5 node_modules
6 /.pnp 5 /.pnp
7 .pnp.js 6 .pnp.js
8 7
......
...@@ -2996,9 +2996,9 @@ ...@@ -2996,9 +2996,9 @@
2996 } 2996 }
2997 }, 2997 },
2998 "@types/yargs": { 2998 "@types/yargs": {
2999 "version": "17.0.20", 2999 "version": "17.0.22",
3000 "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.20.tgz", 3000 "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.22.tgz",
3001 "integrity": "sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A==", 3001 "integrity": "sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g==",
3002 "requires": { 3002 "requires": {
3003 "@types/yargs-parser": "*" 3003 "@types/yargs-parser": "*"
3004 } 3004 }
...@@ -3009,14 +3009,15 @@ ...@@ -3009,14 +3009,15 @@
3009 "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==" 3009 "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA=="
3010 }, 3010 },
3011 "@typescript-eslint/eslint-plugin": { 3011 "@typescript-eslint/eslint-plugin": {
3012 "version": "5.49.0", 3012 "version": "5.50.0",
3013 "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.49.0.tgz", 3013 "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.50.0.tgz",
3014 "integrity": "sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q==", 3014 "integrity": "sha512-vwksQWSFZiUhgq3Kv7o1Jcj0DUNylwnIlGvKvLLYsq8pAWha6/WCnXUeaSoNNha/K7QSf2+jvmkxggC1u3pIwQ==",
3015 "requires": { 3015 "requires": {
3016 "@typescript-eslint/scope-manager": "5.49.0", 3016 "@typescript-eslint/scope-manager": "5.50.0",
3017 "@typescript-eslint/type-utils": "5.49.0", 3017 "@typescript-eslint/type-utils": "5.50.0",
3018 "@typescript-eslint/utils": "5.49.0", 3018 "@typescript-eslint/utils": "5.50.0",
3019 "debug": "^4.3.4", 3019 "debug": "^4.3.4",
3020 "grapheme-splitter": "^1.0.4",
3020 "ignore": "^5.2.0", 3021 "ignore": "^5.2.0",
3021 "natural-compare-lite": "^1.4.0", 3022 "natural-compare-lite": "^1.4.0",
3022 "regexpp": "^3.2.0", 3023 "regexpp": "^3.2.0",
...@@ -3025,56 +3026,56 @@ ...@@ -3025,56 +3026,56 @@
3025 } 3026 }
3026 }, 3027 },
3027 "@typescript-eslint/experimental-utils": { 3028 "@typescript-eslint/experimental-utils": {
3028 "version": "5.49.0", 3029 "version": "5.50.0",
3029 "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.49.0.tgz", 3030 "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.50.0.tgz",
3030 "integrity": "sha512-veLpCJLYn44Fru7mSvi2doxQMzMCOFSDYdMUQhAzaH1vFYq2RVNpecZ8d18Wh6UMv07yahXkiv/aShWE48iE9Q==", 3031 "integrity": "sha512-gZIhzNRivy0RVqcxjKnQ+ipGc0qolilhBeNmvH+Dvu7Vymug+IfiYxTj2zM7mIlHsw6Q5aH7L7WmuTE3tZyzag==",
3031 "requires": { 3032 "requires": {
3032 "@typescript-eslint/utils": "5.49.0" 3033 "@typescript-eslint/utils": "5.50.0"
3033 } 3034 }
3034 }, 3035 },
3035 "@typescript-eslint/parser": { 3036 "@typescript-eslint/parser": {
3036 "version": "5.49.0", 3037 "version": "5.50.0",
3037 "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.49.0.tgz", 3038 "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.50.0.tgz",
3038 "integrity": "sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg==", 3039 "integrity": "sha512-KCcSyNaogUDftK2G9RXfQyOCt51uB5yqC6pkUYqhYh8Kgt+DwR5M0EwEAxGPy/+DH6hnmKeGsNhiZRQxjH71uQ==",
3039 "requires": { 3040 "requires": {
3040 "@typescript-eslint/scope-manager": "5.49.0", 3041 "@typescript-eslint/scope-manager": "5.50.0",
3041 "@typescript-eslint/types": "5.49.0", 3042 "@typescript-eslint/types": "5.50.0",
3042 "@typescript-eslint/typescript-estree": "5.49.0", 3043 "@typescript-eslint/typescript-estree": "5.50.0",
3043 "debug": "^4.3.4" 3044 "debug": "^4.3.4"
3044 } 3045 }
3045 }, 3046 },
3046 "@typescript-eslint/scope-manager": { 3047 "@typescript-eslint/scope-manager": {
3047 "version": "5.49.0", 3048 "version": "5.50.0",
3048 "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.49.0.tgz", 3049 "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.50.0.tgz",
3049 "integrity": "sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ==", 3050 "integrity": "sha512-rt03kaX+iZrhssaT974BCmoUikYtZI24Vp/kwTSy841XhiYShlqoshRFDvN1FKKvU2S3gK+kcBW1EA7kNUrogg==",
3050 "requires": { 3051 "requires": {
3051 "@typescript-eslint/types": "5.49.0", 3052 "@typescript-eslint/types": "5.50.0",
3052 "@typescript-eslint/visitor-keys": "5.49.0" 3053 "@typescript-eslint/visitor-keys": "5.50.0"
3053 } 3054 }
3054 }, 3055 },
3055 "@typescript-eslint/type-utils": { 3056 "@typescript-eslint/type-utils": {
3056 "version": "5.49.0", 3057 "version": "5.50.0",
3057 "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.49.0.tgz", 3058 "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.50.0.tgz",
3058 "integrity": "sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA==", 3059 "integrity": "sha512-dcnXfZ6OGrNCO7E5UY/i0ktHb7Yx1fV6fnQGGrlnfDhilcs6n19eIRcvLBqx6OQkrPaFlDPk3OJ0WlzQfrV0bQ==",
3059 "requires": { 3060 "requires": {
3060 "@typescript-eslint/typescript-estree": "5.49.0", 3061 "@typescript-eslint/typescript-estree": "5.50.0",
3061 "@typescript-eslint/utils": "5.49.0", 3062 "@typescript-eslint/utils": "5.50.0",
3062 "debug": "^4.3.4", 3063 "debug": "^4.3.4",
3063 "tsutils": "^3.21.0" 3064 "tsutils": "^3.21.0"
3064 } 3065 }
3065 }, 3066 },
3066 "@typescript-eslint/types": { 3067 "@typescript-eslint/types": {
3067 "version": "5.49.0", 3068 "version": "5.50.0",
3068 "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.49.0.tgz", 3069 "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.50.0.tgz",
3069 "integrity": "sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg==" 3070 "integrity": "sha512-atruOuJpir4OtyNdKahiHZobPKFvZnBnfDiyEaBf6d9vy9visE7gDjlmhl+y29uxZ2ZDgvXijcungGFjGGex7w=="
3070 }, 3071 },
3071 "@typescript-eslint/typescript-estree": { 3072 "@typescript-eslint/typescript-estree": {
3072 "version": "5.49.0", 3073 "version": "5.50.0",
3073 "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.49.0.tgz", 3074 "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.50.0.tgz",
3074 "integrity": "sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA==", 3075 "integrity": "sha512-Gq4zapso+OtIZlv8YNAStFtT6d05zyVCK7Fx3h5inlLBx2hWuc/0465C2mg/EQDDU2LKe52+/jN4f0g9bd+kow==",
3075 "requires": { 3076 "requires": {
3076 "@typescript-eslint/types": "5.49.0", 3077 "@typescript-eslint/types": "5.50.0",
3077 "@typescript-eslint/visitor-keys": "5.49.0", 3078 "@typescript-eslint/visitor-keys": "5.50.0",
3078 "debug": "^4.3.4", 3079 "debug": "^4.3.4",
3079 "globby": "^11.1.0", 3080 "globby": "^11.1.0",
3080 "is-glob": "^4.0.3", 3081 "is-glob": "^4.0.3",
...@@ -3083,15 +3084,15 @@ ...@@ -3083,15 +3084,15 @@
3083 } 3084 }
3084 }, 3085 },
3085 "@typescript-eslint/utils": { 3086 "@typescript-eslint/utils": {
3086 "version": "5.49.0", 3087 "version": "5.50.0",
3087 "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.49.0.tgz", 3088 "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.50.0.tgz",
3088 "integrity": "sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ==", 3089 "integrity": "sha512-v/AnUFImmh8G4PH0NDkf6wA8hujNNcrwtecqW4vtQ1UOSNBaZl49zP1SHoZ/06e+UiwzHpgb5zP5+hwlYYWYAw==",
3089 "requires": { 3090 "requires": {
3090 "@types/json-schema": "^7.0.9", 3091 "@types/json-schema": "^7.0.9",
3091 "@types/semver": "^7.3.12", 3092 "@types/semver": "^7.3.12",
3092 "@typescript-eslint/scope-manager": "5.49.0", 3093 "@typescript-eslint/scope-manager": "5.50.0",
3093 "@typescript-eslint/types": "5.49.0", 3094 "@typescript-eslint/types": "5.50.0",
3094 "@typescript-eslint/typescript-estree": "5.49.0", 3095 "@typescript-eslint/typescript-estree": "5.50.0",
3095 "eslint-scope": "^5.1.1", 3096 "eslint-scope": "^5.1.1",
3096 "eslint-utils": "^3.0.0", 3097 "eslint-utils": "^3.0.0",
3097 "semver": "^7.3.7" 3098 "semver": "^7.3.7"
...@@ -3114,11 +3115,11 @@ ...@@ -3114,11 +3115,11 @@
3114 } 3115 }
3115 }, 3116 },
3116 "@typescript-eslint/visitor-keys": { 3117 "@typescript-eslint/visitor-keys": {
3117 "version": "5.49.0", 3118 "version": "5.50.0",
3118 "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.49.0.tgz", 3119 "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.50.0.tgz",
3119 "integrity": "sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg==", 3120 "integrity": "sha512-cdMeD9HGu6EXIeGOh2yVW6oGf9wq8asBgZx7nsR/D36gTfQ0odE5kcRYe5M81vjEFAcPeugXrHg78Imu55F6gg==",
3120 "requires": { 3121 "requires": {
3121 "@typescript-eslint/types": "5.49.0", 3122 "@typescript-eslint/types": "5.50.0",
3122 "eslint-visitor-keys": "^3.3.0" 3123 "eslint-visitor-keys": "^3.3.0"
3123 } 3124 }
3124 }, 3125 },
...@@ -3977,9 +3978,9 @@ ...@@ -3977,9 +3978,9 @@
3977 } 3978 }
3978 }, 3979 },
3979 "caniuse-lite": { 3980 "caniuse-lite": {
3980 "version": "1.0.30001449", 3981 "version": "1.0.30001450",
3981 "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001449.tgz", 3982 "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001450.tgz",
3982 "integrity": "sha512-CPB+UL9XMT/Av+pJxCKGhdx+yg1hzplvFJQlJ2n68PyQGMz9L/E2zCyLdOL8uasbouTUgnPl+y0tccI/se+BEw==" 3983 "integrity": "sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew=="
3983 }, 3984 },
3984 "case-sensitive-paths-webpack-plugin": { 3985 "case-sensitive-paths-webpack-plugin": {
3985 "version": "2.4.0", 3986 "version": "2.4.0",
...@@ -9145,9 +9146,9 @@ ...@@ -9145,9 +9146,9 @@
9145 "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==" 9146 "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw=="
9146 }, 9147 },
9147 "node-releases": { 9148 "node-releases": {
9148 "version": "2.0.8", 9149 "version": "2.0.9",
9149 "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.8.tgz", 9150 "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.9.tgz",
9150 "integrity": "sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==" 9151 "integrity": "sha512-2xfmOrRkGogbTK9R6Leda0DGiXeY3p2NJpy4+gNCffdUvV6mdEJnaDEic1i3Ec2djAo8jWYoJMR5PB0MSMpxUA=="
9151 }, 9152 },
9152 "normalize-path": { 9153 "normalize-path": {
9153 "version": "3.0.0", 9154 "version": "3.0.0",
...@@ -10512,11 +10513,6 @@ ...@@ -10512,11 +10513,6 @@
10512 "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", 10513 "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
10513 "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" 10514 "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
10514 }, 10515 },
10515 "react-openai-api": {
10516 "version": "1.0.2",
10517 "resolved": "https://registry.npmjs.org/react-openai-api/-/react-openai-api-1.0.2.tgz",
10518 "integrity": "sha512-jpyVrBmZryD3QbFLIW+6ltTRZ3En9m+ypppXS/selyKJ8URElP0Z/0YGqYHZ/X6oX9ryQdq/W435Mv1afsWbgQ=="
10519 },
10520 "react-refresh": { 10516 "react-refresh": {
10521 "version": "0.11.0", 10517 "version": "0.11.0",
10522 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", 10518 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
...@@ -11157,9 +11153,9 @@ ...@@ -11157,9 +11153,9 @@
11157 "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" 11153 "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
11158 }, 11154 },
11159 "shell-quote": { 11155 "shell-quote": {
11160 "version": "1.7.4", 11156 "version": "1.8.0",
11161 "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.4.tgz", 11157 "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.0.tgz",
11162 "integrity": "sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==" 11158 "integrity": "sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ=="
11163 }, 11159 },
11164 "side-channel": { 11160 "side-channel": {
11165 "version": "1.0.4", 11161 "version": "1.0.4",
...@@ -11627,9 +11623,9 @@ ...@@ -11627,9 +11623,9 @@
11627 } 11623 }
11628 }, 11624 },
11629 "terser": { 11625 "terser": {
11630 "version": "5.16.1", 11626 "version": "5.16.2",
11631 "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", 11627 "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.2.tgz",
11632 "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", 11628 "integrity": "sha512-JKuM+KvvWVqT7muHVyrwv7FVRPnmHDwF6XwoIxdbF5Witi0vu99RYpxDexpJndXt3jbZZmmWr2/mQa6HvSNdSg==",
11633 "requires": { 11629 "requires": {
11634 "@jridgewell/source-map": "^0.3.2", 11630 "@jridgewell/source-map": "^0.3.2",
11635 "acorn": "^8.5.0", 11631 "acorn": "^8.5.0",
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
8 "@testing-library/user-event": "^13.5.0", 8 "@testing-library/user-event": "^13.5.0",
9 "react": "^18.2.0", 9 "react": "^18.2.0",
10 "react-dom": "^18.2.0", 10 "react-dom": "^18.2.0",
11 "react-openai-api": "^1.0.2",
12 "react-scripts": "5.0.1", 11 "react-scripts": "5.0.1",
13 "web-vitals": "^2.1.4" 12 "web-vitals": "^2.1.4"
14 }, 13 },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 .sidemenu { 9 .sidemenu {
10 width:260px; 10 width:260px;
11 padding:10px; 11 padding:10px;
12 background-color: #202123; 12 background-color:#202123;
13 } 13 }
14 /* under 640px do this */ 14 /* under 640px do this */
15 @media (max-width: 640px) { 15 @media (max-width: 640px) {
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
34 padding-right:12px; 34 padding-right:12px;
35 } 35 }
36 36
37
38 .chatbox { 37 .chatbox {
39 flex:1; 38 flex:1;
40 background-color:#343541; 39 background-color:#343541;
...@@ -59,17 +58,16 @@ ...@@ -59,17 +58,16 @@
59 position:absolute; 58 position:absolute;
60 bottom:0; 59 bottom:0;
61 left:0;right:0; 60 left:0;right:0;
62 background: rgb(57 57 57);
63 } 61 }
64 .chat-input-textarea { 62 .chat-input-textarea {
65 background-color: #40414f; 63 background-color:#40414f;
66 width: 90%; 64 width:90%;
67 padding: 12px; 65 padding:12px;
68 border-radius: 5px; 66 border-radius:5px;
69 color: #ffffff; 67 color:white;
70 font-size: 1.25em; 68 font-size:1.25em;
71 border: none; 69 border:none;
72 outline: none; 70 outline:none;
73 box-shadow: 0 0 8px 0 rgba(0,0,0,0.25); 71 box-shadow: 0 0 8px 0 rgba(0,0,0,0.25);
74 } 72 }
75 73
...@@ -96,21 +94,20 @@ ...@@ -96,21 +94,20 @@
96 } 94 }
97 95
98 .chat-message.chatgpt { 96 .chat-message.chatgpt {
99 background-color:#ffffff; 97 background-color:#444654;
100 } 98 }
101 .chat-message-center { 99 .chat-message-center {
102 max-width:640px; 100 max-width:640px;
103 margin-left:auto; 101 margin-left:auto;
104 margin-right:auto; 102 margin-right:auto;
105 display:flex; 103 display:flex;
106 padding: 12px 24px; 104 padding:12px;
107 } 105 padding-left: 24px;
106 padding-right: 24px;
108 107
109 section::-webkit-scrollbar {
110 display: none;
111 } 108 }
112 .avatar { 109 .avatar {
113 background:#ffffff; 110 background:white;
114 border-radius:50%; 111 border-radius:50%;
115 width: 40px; 112 width: 40px;
116 height: 40px; 113 height: 40px;
...@@ -121,8 +118,6 @@ section::-webkit-scrollbar { ...@@ -121,8 +118,6 @@ section::-webkit-scrollbar {
121 font-size:14px; 118 font-size:14px;
122 color:#444654; 119 color:#444654;
123 } 120 }
124
125
126 .avatar.chatgpt { 121 .avatar.chatgpt {
127 background:#0da37f; 122 background:#0da37f;
128 border-radius:50%; 123 border-radius:50%;
...@@ -132,11 +127,8 @@ section::-webkit-scrollbar { ...@@ -132,11 +127,8 @@ section::-webkit-scrollbar {
132 color:white; 127 color:white;
133 } 128 }
134 .message { 129 .message {
135 padding: 7px 20px; 130 padding-left: 40px;
136 } 131 padding-right: 40px;
137
138 .chat-message.false {
139 background: #eef2ff;
140 } 132 }
141 133
142 @keyframes App-logo-spin { 134 @keyframes App-logo-spin {
...@@ -150,18 +142,18 @@ section::-webkit-scrollbar { ...@@ -150,18 +142,18 @@ section::-webkit-scrollbar {
150 142
151 .select-models { 143 .select-models {
152 border: 1px solid white; 144 border: 1px solid white;
153 padding: 12px; 145 padding:12px;
154 border-radius:5px; 146 border-radius:5px;
155 color: white; 147 color:white;
156 background: transparent; 148 background:transparent;
157 outline:none; 149 outline:none;
158 cursor:pointer; 150 cursor:pointer;
159 max-width:100%; 151 max-width:100%;
160 min-width:100%; 152 min-width:100%;
161 } 153 }
162 .select-models option { 154 .select-models option {
163 background: black; 155 background:black;
164 color: #ffffff; 156 color:white;
165 } 157 }
166 158
167 .button-picker { 159 .button-picker {
......
...@@ -4,7 +4,6 @@ import './color_theme_1.css'; ...@@ -4,7 +4,6 @@ import './color_theme_1.css';
4 import { useState, useEffect } from 'react'; 4 import { useState, useEffect } from 'react';
5 import SideMenu from './SideMenu' 5 import SideMenu from './SideMenu'
6 import ChatBox from './ChatBox' 6 import ChatBox from './ChatBox'
7 import OpenAIAPI from "react-openai-api";
8 7
9 function App() { 8 function App() {
10 9
...@@ -14,7 +13,7 @@ function App() { ...@@ -14,7 +13,7 @@ function App() {
14 13
15 const [chatInput, setChatInput] = useState(""); 14 const [chatInput, setChatInput] = useState("");
16 const [models, setModels] = useState([]); 15 const [models, setModels] = useState([]);
17 const [temperature, setTemperature] = useState(0.5); 16 const [temperature, setTemperature] = useState(0.7);
18 const [currentModel, setCurrentModel] = useState("text-davinci-003"); 17 const [currentModel, setCurrentModel] = useState("text-davinci-003");
19 const [chatLog, setChatLog] = useState([{ 18 const [chatLog, setChatLog] = useState([{
20 user: "gpt", 19 user: "gpt",
...@@ -49,88 +48,29 @@ function App() { ...@@ -49,88 +48,29 @@ function App() {
49 // fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post 48 // fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post
50 const messages = chatLogNew.map((message) => message.message).join("\n") 49 const messages = chatLogNew.map((message) => message.message).join("\n")
51 50
52 51 const response = await fetch("http://localhost:3080/", {
53 // const response = await fetch("http://localhost:3080/", { 52 method: "POST",
54 // method: "POST", 53 headers: {
55 // headers: { 54 "Content-Type": "application/json"
56 // "Content-Type": "application/json" 55 },
57 // }, 56 body: JSON.stringify({
58 // body: JSON.stringify({ 57 message: messages,
59 // message: messages, 58 currentModel,
60 // currentModel, 59 })
61 // }) 60 });
62 // }); 61 const data = await response.json();
63 // const data = await response.json(); 62 setChatLog([...chatLogNew, { user: "gpt", message: `${data.message}`} ])
64 // setChatLog([...chatLogNew, { user: "gpt", message: `${data.message}`} ]) 63 var scrollToTheBottomChatLog = document.getElementsByClassName("chat-log")[0];
65 // var scrollToTheBottomChatLog = document.getElementsByClassName("chat-log")[0]; 64 scrollToTheBottomChatLog.scrollTop = scrollToTheBottomChatLog.scrollHeight;
66 // scrollToTheBottomChatLog.scrollTop = scrollToTheBottomChatLog.scrollHeight;
67
68 var oHttp = new XMLHttpRequest();
69 oHttp.open("POST", "https://api.openai.com/v1/completions");
70 oHttp.setRequestHeader("Accept", "application/json");
71 oHttp.setRequestHeader("Content-Type", "application/json");
72 oHttp.setRequestHeader("Authorization", "Bearer " + "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")
73
74 oHttp.onreadystatechange = function () {
75 if (oHttp.readyState === 4) {
76 var s = ''
77 var oJson = {}
78 if (s != "") s += "\n";
79 try {
80 oJson = JSON.parse(oHttp.responseText);
81 } catch (ex) {
82 s += "Error: " + ex.message
83 }
84 if (oJson.error && oJson.error.message) {
85 s += "Error: " + oJson.error.message;
86 } else if (oJson.choices && oJson.choices[0].text) {
87 s = oJson.choices[0].text;
88 var a = s.split("?\n");
89 if (a.length == 2) {
90 s = a[1];
91 }
92 // if (selLang.value != "en-US") {
93 // var a = s.split("?\n");
94 // if (a.length == 2) {
95 // s = a[1];
96 // }
97 // }
98 if (s == "") s = "No response";
99 console.log('ssssssssssssssssssssss',s);
100 var replaceBR= (s.replace(/(?:\r\n|\r|\n)/g, "<br>")).replace(/\r?\n|\r/, "");
101
102 setChatLog([...chatLogNew, { user: "gpt", message: `${replaceBR}`} ]);
103 }
104 }
105 };
106
107 var sModel = currentModel;// "text-davinci-003";
108 var iMaxTokens = 100;
109 var sUserId = "1";
110 var dTemperature =temperature;
111
112 var data = {
113 model: sModel,
114 prompt: messages,
115 max_tokens: iMaxTokens,
116 //user: sUserId,
117 temperature: dTemperature,
118 // frequency_penalty: 0.0, //Number between -2.0 and 2.0 Positive value decrease the model's likelihood to repeat the same line verbatim.
119 //presence_penalty: 0.0, //Number between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics.
120 //stop: ["#", ";"] //Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
121 }
122
123 oHttp.send(JSON.stringify(data));;
124
125 } 65 }
126 66
127 function handleTemp(temp) { 67 function handleTemp(temp) {
128 if(temp > 1){ 68 if(temp > 1){
129 // setTemperature(1) 69 setTemperature(1)
130 } else if (temp < 0){ 70 } else if (temp < 0){
131 // setTemperature(0) 71 setTemperature(0)
132 } else { 72 } else {
133 // setTemperature(temp) 73 setTemperature(temp)
134 } 74 }
135 75
136 } 76 }
......
...@@ -57,7 +57,7 @@ const SideMenu = ({ clearChat, currentModel, setCurrentModel, models, setTempera ...@@ -57,7 +57,7 @@ const SideMenu = ({ clearChat, currentModel, setCurrentModel, models, setTempera
57 The temperature parameter controls the randomness of the model. 0 is the most logical, 1 is the most creative. 57 The temperature parameter controls the randomness of the model. 0 is the most logical, 1 is the most creative.
58 </span> 58 </span>
59 </div> 59 </div>
60 </aside> 60 </aside>
61 61
62 const Button = ({ onClick, text }) => 62 const Button = ({ onClick, text }) =>
63 <div 63 <div
......
...@@ -5,8 +5,8 @@ const cors = require('cors') ...@@ -5,8 +5,8 @@ const cors = require('cors')
5 5
6 // Open AI Configuration 6 // Open AI Configuration
7 const configuration = new Configuration({ 7 const configuration = new Configuration({
8 organization: "org-2OIAoj4fSwE4RCzgvglUM55T", 8 organization: "org-organization",
9 apiKey: "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", 9 apiKey: "sk-apiKey",
10 }); 10 });
11 const openai = new OpenAIApi(configuration); 11 const openai = new OpenAIApi(configuration);
12 12
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!