Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
58a010c1
authored
Mar 18, 2023
by
Archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 细节样式
parent
7ba14d2c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
7 deletions
+11
-7
src/components/Markdown/index.module.scss
+7
-3
src/constants/common.ts
+0
-0
src/pages/api/chat/chatGpt.ts
+1
-1
src/pages/api/chat/gpt3.ts
+1
-1
src/pages/chat/components/Empty.tsx
+1
-1
src/service/errorCode.ts
+1
-1
No files found.
src/components/Markdown/index.module.scss
View file @
58a010c1
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
.markdown
h6
{
.markdown
h6
{
cursor
:
text
;
cursor
:
text
;
font-weight
:
bold
;
font-weight
:
bold
;
margin
:
20px
0
10px
;
margin
:
10px
0
;
padding
:
0
;
padding
:
0
;
position
:
relative
;
position
:
relative
;
}
}
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
.markdown
dl
,
.markdown
dl
,
.markdown
table
,
.markdown
table
,
.markdown
pre
{
.markdown
pre
{
margin
:
1
5
px
0
;
margin
:
1
0
px
0
;
}
}
.markdown
hr
{
.markdown
hr
{
background
:
url('https://a248.e.akamai.net/assets.github.com/assets/primer/markdown/dirty-shade-350cca8f57223ebd53603021b2e670f4f319f1b7.png')
background
:
url('https://a248.e.akamai.net/assets.github.com/assets/primer/markdown/dirty-shade-350cca8f57223ebd53603021b2e670f4f319f1b7.png')
...
@@ -351,10 +351,14 @@
...
@@ -351,10 +351,14 @@
}
}
.markdown
{
.markdown
{
text-align
:
justify
;
text-align
:
justify
;
word-break
:
break-all
;
overflow-y
:
hidden
;
overflow-y
:
hidden
;
tab-size
:
4
;
tab-size
:
4
;
word-spacing
:
normal
;
word-spacing
:
normal
;
word-break
:
break-all
;
p
{
white-space
:
pre-line
;
}
pre
{
pre
{
display
:
block
;
display
:
block
;
...
...
src/constants/common.ts
View file @
58a010c1
src/pages/api/chat/chatGpt.ts
View file @
58a010c1
...
@@ -74,7 +74,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -74,7 +74,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
{
{
model
:
model
.
service
.
chatModel
,
model
:
model
.
service
.
chatModel
,
temperature
:
temperature
,
temperature
:
temperature
,
max_tokens
:
modelConstantsData
.
maxToken
,
//
max_tokens: modelConstantsData.maxToken,
messages
:
formatPrompts
,
messages
:
formatPrompts
,
stream
:
true
stream
:
true
},
},
...
...
src/pages/api/chat/gpt3.ts
View file @
58a010c1
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
model
:
model
.
service
.
modelName
,
model
:
model
.
service
.
modelName
,
prompt
:
formatPrompt
,
prompt
:
formatPrompt
,
temperature
:
temperature
,
temperature
:
temperature
,
max_tokens
:
modelConstantsData
.
maxToken
,
//
max_tokens: modelConstantsData.maxToken,
top_p
:
1
,
top_p
:
1
,
frequency_penalty
:
0
,
frequency_penalty
:
0
,
presence_penalty
:
0.6
,
presence_penalty
:
0.6
,
...
...
src/pages/chat/components/Empty.tsx
View file @
58a010c1
...
@@ -22,7 +22,7 @@ const Empty = ({ intro }: { intro: string }) => {
...
@@ -22,7 +22,7 @@ const Empty = ({ intro }: { intro: string }) => {
{
!!
intro
&&
(
{
!!
intro
&&
(
<
Card
p=
{
4
}
mb=
{
10
}
>
<
Card
p=
{
4
}
mb=
{
10
}
>
<
Header
>
模型介绍
</
Header
>
<
Header
>
模型介绍
</
Header
>
<
Box
>
{
intro
}
</
Box
>
<
Box
whiteSpace=
{
'pre-line'
}
>
{
intro
}
</
Box
>
</
Card
>
</
Card
>
)
}
)
}
<
Card
p=
{
4
}
mb=
{
10
}
>
<
Card
p=
{
4
}
mb=
{
10
}
>
...
...
src/service/errorCode.ts
View file @
58a010c1
...
@@ -2,7 +2,7 @@ export const openaiError: Record<string, string> = {
...
@@ -2,7 +2,7 @@ export const openaiError: Record<string, string> = {
context_length_exceeded
:
'内容超长了,请重置对话'
,
context_length_exceeded
:
'内容超长了,请重置对话'
,
Unauthorized
:
'API-KEY 不合法'
,
Unauthorized
:
'API-KEY 不合法'
,
rate_limit_reached
:
'同时访问用户过多,请稍后再试'
,
rate_limit_reached
:
'同时访问用户过多,请稍后再试'
,
'Bad Request'
:
'
上下文太多了,请重开对话~
'
,
'Bad Request'
:
'
Bad Request~ 可能内容太多了
'
,
'Too Many Requests'
:
'请求次数太多了,请慢点~'
'Too Many Requests'
:
'请求次数太多了,请慢点~'
};
};
export
const
proxyError
:
Record
<
string
,
boolean
>
=
{
export
const
proxyError
:
Record
<
string
,
boolean
>
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment