13d695fc by RSA

fix conflict

2 parents 1a33ac76 b80fa246
...@@ -247,6 +247,7 @@ ...@@ -247,6 +247,7 @@
247 padding: 10px; 247 padding: 10px;
248 border-radius: 5px; 248 border-radius: 5px;
249 margin: 0 0 10px; 249 margin: 0 0 10px;
250 font-size: 14px;
250 } 251 }
251 252
252 ul.suggested-options { 253 ul.suggested-options {
......
1 @import url('https://fonts.googleapis.com/css2?family=Alegreya+Sans:ital,wght@0,400;0,500;1,400&display=swap');
2
3 body {
4 -webkit-font-smoothing: antialiased;
5 -moz-osx-font-smoothing: grayscale;
6 font-family: "Alegreya Sans", sans-serif;
7 }
1 .sidemenu { 8 .sidemenu {
2 background-color: #101827 !important; 9 background-color: #101827 !important;
3 } 10 }
...@@ -7,11 +14,12 @@ ...@@ -7,11 +14,12 @@
7 padding: 15px 25px; 14 padding: 15px 25px;
8 border-radius: 10px; 15 border-radius: 10px;
9 background: rgb(0 139 245 / 6%); 16 background: rgb(0 139 245 / 6%);
17 font-size: 16px;
10 } 18 }
11 19
12 .errormsg .msg { 20 .errormsg .msg {
13 display: inline-block; 21 display: inline-block;
14 width: 90%; 22 width: 85%;
15 } 23 }
16 .errormsg span { 24 .errormsg span {
17 background: #008BF5; 25 background: #008BF5;
...@@ -117,10 +125,10 @@ span.info { ...@@ -117,10 +125,10 @@ span.info {
117 } 125 }
118 126
119 .message { 127 .message {
128 font-size: 20px;
120 padding: 7px 20px !important; 129 padding: 7px 20px !important;
121 line-height: 25px; 130 line-height: 25px;
122 font-size: 14px; 131 font-size: 14px;
123 font-family: "Poppins", "Karla", sans-serif;
124 color: #353b4f; 132 color: #353b4f;
125 -moz-osx-font-smoothing: grayscale; 133 -moz-osx-font-smoothing: grayscale;
126 -webkit-font-smoothing: antialiased !important; 134 -webkit-font-smoothing: antialiased !important;
...@@ -209,19 +217,22 @@ code br:nth-child(-n+2) { ...@@ -209,19 +217,22 @@ code br:nth-child(-n+2) {
209 217
210 @media (min-width: 1280px) { 218 @media (min-width: 1280px) {
211 .message { 219 .message {
212 font-size: 18px; 220 font-size: 20px;
213 } 221 }
214 } 222 }
215 223
216 @media (max-width: 1279px) { 224 @media (max-width: 1279px) {
217 .message { 225 .message {
218 font-size: 16px; 226 font-size: 18px;
219 } 227 }
220 } 228 }
221 229
222 @media (max-width: 991px) { 230 @media (max-width: 991px) {
231 .errormsg .msg {
232 width: 75%;
233 }
223 .message { 234 .message {
224 font-size: 14px; 235 font-size: 16px;
225 } 236 }
226 .chat-message-center { 237 .chat-message-center {
227 padding: 20px 5vw !important; 238 padding: 20px 5vw !important;
...@@ -233,7 +244,7 @@ code br:nth-child(-n+2) { ...@@ -233,7 +244,7 @@ code br:nth-child(-n+2) {
233 width: 80%; 244 width: 80%;
234 } 245 }
235 .message { 246 .message {
236 font-size: 14px; 247 font-size: 16px;
237 } 248 }
238 .errormsg { 249 .errormsg {
239 padding: 10px; 250 padding: 10px;
......
...@@ -43,8 +43,13 @@ app.post('/api', async (req, res) => { ...@@ -43,8 +43,13 @@ app.post('/api', async (req, res) => {
43 43
44 let query_prompt = `${greetingPrompt}\n${message}`; 44 let query_prompt = `${greetingPrompt}\n${message}`;
45 45
46 let greetingPrompt = 'Hello, how can I assist you?'
47 const greetings = ['hi', 'hello', 'hey']
48 if (greetings.some((greeting) => message.toLowerCase().includes(greeting))) {
49 greetingPrompt = 'Hello, how can I help you today?'
50 }
51 let query_prompt = `${greetingPrompt}\n${message}`;
46 str_length = req.body.message.split(' ').length; 52 str_length = req.body.message.split(' ').length;
47
48 if (str_length>=800){ 53 if (str_length>=800){
49 arr_body = req.body.message.split("\n"); 54 arr_body = req.body.message.split("\n");
50 if (arr_body.length>=4){ 55 if (arr_body.length>=4){
...@@ -55,7 +60,6 @@ app.post('/api', async (req, res) => { ...@@ -55,7 +60,6 @@ app.post('/api', async (req, res) => {
55 query_prompt = arr_body.join("\n") 60 query_prompt = arr_body.join("\n")
56 } 61 }
57 } 62 }
58
59 try { 63 try {
60 const response = await openai.createCompletion({ 64 const response = await openai.createCompletion({
61 model: `${currentModel}`,// "text-davinci-003", 65 model: `${currentModel}`,// "text-davinci-003",
...@@ -63,11 +67,9 @@ app.post('/api', async (req, res) => { ...@@ -63,11 +67,9 @@ app.post('/api', async (req, res) => {
63 max_tokens: 3000, 67 max_tokens: 3000,
64 temperature, 68 temperature,
65 }); 69 });
66
67 res.json({ 70 res.json({
68 message: response.data.choices[0].text, 71 message: response.data.choices[0].text,
69 }) 72 })
70
71 } catch (e) { 73 } catch (e) {
72 let error_msg = e.response.data.error.message ? e.response.data.error.message : ''; 74 let error_msg = e.response.data.error.message ? e.response.data.error.message : '';
73 if (error_msg.indexOf('maximum context length')>=0){ 75 if (error_msg.indexOf('maximum context length')>=0){
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!