13d695fc by RSA

fix conflict

2 parents 1a33ac76 b80fa246
......@@ -247,6 +247,7 @@
padding: 10px;
border-radius: 5px;
margin: 0 0 10px;
font-size: 14px;
}
ul.suggested-options {
......
@import url('https://fonts.googleapis.com/css2?family=Alegreya+Sans:ital,wght@0,400;0,500;1,400&display=swap');
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-family: "Alegreya Sans", sans-serif;
}
.sidemenu {
background-color: #101827 !important;
}
......@@ -7,11 +14,12 @@
padding: 15px 25px;
border-radius: 10px;
background: rgb(0 139 245 / 6%);
font-size: 16px;
}
.errormsg .msg {
display: inline-block;
width: 90%;
width: 85%;
}
.errormsg span {
background: #008BF5;
......@@ -117,10 +125,10 @@ span.info {
}
.message {
font-size: 20px;
padding: 7px 20px !important;
line-height: 25px;
font-size: 14px;
font-family: "Poppins", "Karla", sans-serif;
color: #353b4f;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased !important;
......@@ -209,19 +217,22 @@ code br:nth-child(-n+2) {
@media (min-width: 1280px) {
.message {
font-size: 18px;
font-size: 20px;
}
}
@media (max-width: 1279px) {
.message {
font-size: 16px;
font-size: 18px;
}
}
@media (max-width: 991px) {
.errormsg .msg {
width: 75%;
}
.message {
font-size: 14px;
font-size: 16px;
}
.chat-message-center {
padding: 20px 5vw !important;
......@@ -233,7 +244,7 @@ code br:nth-child(-n+2) {
width: 80%;
}
.message {
font-size: 14px;
font-size: 16px;
}
.errormsg {
padding: 10px;
......
......@@ -43,8 +43,13 @@ app.post('/api', async (req, res) => {
let query_prompt = `${greetingPrompt}\n${message}`;
let greetingPrompt = 'Hello, how can I assist you?'
const greetings = ['hi', 'hello', 'hey']
if (greetings.some((greeting) => message.toLowerCase().includes(greeting))) {
greetingPrompt = 'Hello, how can I help you today?'
}
let query_prompt = `${greetingPrompt}\n${message}`;
str_length = req.body.message.split(' ').length;
if (str_length>=800){
arr_body = req.body.message.split("\n");
if (arr_body.length>=4){
......@@ -55,7 +60,6 @@ app.post('/api', async (req, res) => {
query_prompt = arr_body.join("\n")
}
}
try {
const response = await openai.createCompletion({
model: `${currentModel}`,// "text-davinci-003",
......@@ -63,11 +67,9 @@ app.post('/api', async (req, res) => {
max_tokens: 3000,
temperature,
});
res.json({
message: response.data.choices[0].text,
})
} catch (e) {
let error_msg = e.response.data.error.message ? e.response.data.error.message : '';
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!