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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
9 deletions
+13
-9
src/components/Markdown/index.module.scss
+7
-3
src/constants/common.ts
+2
-2
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 @@
.markdown
h6
{
cursor
:
text
;
font-weight
:
bold
;
margin
:
20px
0
10px
;
margin
:
10px
0
;
padding
:
0
;
position
:
relative
;
}
...
...
@@ -130,7 +130,7 @@
.markdown
dl
,
.markdown
table
,
.markdown
pre
{
margin
:
1
5
px
0
;
margin
:
1
0
px
0
;
}
.markdown
hr
{
background
:
url('https://a248.e.akamai.net/assets.github.com/assets/primer/markdown/dirty-shade-350cca8f57223ebd53603021b2e670f4f319f1b7.png')
...
...
@@ -351,10 +351,14 @@
}
.markdown
{
text-align
:
justify
;
word-break
:
break-all
;
overflow-y
:
hidden
;
tab-size
:
4
;
word-spacing
:
normal
;
word-break
:
break-all
;
p
{
white-space
:
pre-line
;
}
pre
{
display
:
block
;
...
...
src/constants/common.ts
View file @
58a010c1
...
...
@@ -41,10 +41,10 @@ export const introPage = `
`
;
export
const
chatProblem
=
`
**代理出错**
**代理出错**
服务器代理不稳定,可以过一会儿再尝试。
**API key 问题**
**API key 问题**
请把 openai 的 API key 粘贴到账号里再创建对话。如果是使用分享的对话,不需要填写 API key。
`
;
...
...
src/pages/api/chat/chatGpt.ts
View file @
58a010c1
...
...
@@ -74,7 +74,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
{
model
:
model
.
service
.
chatModel
,
temperature
:
temperature
,
max_tokens
:
modelConstantsData
.
maxToken
,
//
max_tokens: modelConstantsData.maxToken,
messages
:
formatPrompts
,
stream
:
true
},
...
...
src/pages/api/chat/gpt3.ts
View file @
58a010c1
...
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
model
:
model
.
service
.
modelName
,
prompt
:
formatPrompt
,
temperature
:
temperature
,
max_tokens
:
modelConstantsData
.
maxToken
,
//
max_tokens: modelConstantsData.maxToken,
top_p
:
1
,
frequency_penalty
:
0
,
presence_penalty
:
0.6
,
...
...
src/pages/chat/components/Empty.tsx
View file @
58a010c1
...
...
@@ -22,7 +22,7 @@ const Empty = ({ intro }: { intro: string }) => {
{
!!
intro
&&
(
<
Card
p=
{
4
}
mb=
{
10
}
>
<
Header
>
模型介绍
</
Header
>
<
Box
>
{
intro
}
</
Box
>
<
Box
whiteSpace=
{
'pre-line'
}
>
{
intro
}
</
Box
>
</
Card
>
)
}
<
Card
p=
{
4
}
mb=
{
10
}
>
...
...
src/service/errorCode.ts
View file @
58a010c1
...
...
@@ -2,7 +2,7 @@ export const openaiError: Record<string, string> = {
context_length_exceeded
:
'内容超长了,请重置对话'
,
Unauthorized
:
'API-KEY 不合法'
,
rate_limit_reached
:
'同时访问用户过多,请稍后再试'
,
'Bad Request'
:
'
上下文太多了,请重开对话~
'
,
'Bad Request'
:
'
Bad Request~ 可能内容太多了
'
,
'Too Many Requests'
:
'请求次数太多了,请慢点~'
};
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