Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
13d695fc
authored
2023-02-28 10:30:48 +0800
by
RSA
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
fix conflict
2 parents
1a33ac76
b80fa246
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
client/src/App.css
client/src/color_theme_1.css
index.js
client/src/App.css
View file @
13d695f
...
...
@@ -247,6 +247,7 @@
padding
:
10px
;
border-radius
:
5px
;
margin
:
0
0
10px
;
font-size
:
14px
;
}
ul
.suggested-options
{
...
...
client/src/color_theme_1.css
View file @
13d695f
@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
:
18
px
;
font-size
:
20
px
;
}
}
@media
(
max-width
:
1279px
)
{
.message
{
font-size
:
1
6
px
;
font-size
:
1
8
px
;
}
}
@media
(
max-width
:
991px
)
{
.errormsg
.msg
{
width
:
75%
;
}
.message
{
font-size
:
1
4
px
;
font-size
:
1
6
px
;
}
.chat-message-center
{
padding
:
20px
5vw
!important
;
...
...
@@ -233,7 +244,7 @@ code br:nth-child(-n+2) {
width
:
80%
;
}
.message
{
font-size
:
1
4
px
;
font-size
:
1
6
px
;
}
.errormsg
{
padding
:
10px
;
...
...
index.js
View file @
13d695f
...
...
@@ -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,12 +67,10 @@ app.post('/api', async (req, res) => {
max_tokens
:
3000
,
temperature
,
});
res
.
json
({
message
:
response
.
data
.
choices
[
0
].
text
,
})
}
catch
(
e
)
{
}
catch
(
e
)
{
let
error_msg
=
e
.
response
.
data
.
error
.
message
?
e
.
response
.
data
.
error
.
message
:
''
;
if
(
error_msg
.
indexOf
(
'maximum context length'
)
>=
0
){
res
.
json
({
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment