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
7fe2017a
authored
Jul 18, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ui
parent
51b98df4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
15 deletions
+22
-15
client/src/components/Avatar/index.tsx
+1
-1
client/src/pages/api/app/modules/agent/classifyQuestion.ts
+13
-8
client/src/pages/app/detail/components/edit/components/Nodes/NodeChat.tsx
+1
-1
client/src/pages/app/list/component/CreateModal.tsx
+2
-0
client/src/pages/index.tsx
+3
-3
client/src/pages/kb/detail/components/Info.tsx
+2
-2
No files found.
client/src/components/Avatar/index.tsx
View file @
7fe2017a
...
...
@@ -9,7 +9,7 @@ const Avatar = ({ w = '30px', ...props }: ImageProps) => {
fallbackSrc=
{
LOGO_ICON
}
fallbackStrategy=
{
'onError'
}
borderRadius=
{
'50%'
}
objectFit=
{
'co
ntain
'
}
objectFit=
{
'co
ver
'
}
alt=
""
w=
{
w
}
h=
{
w
}
...
...
client/src/pages/api/app/modules/agent/classifyQuestion.ts
View file @
7fe2017a
...
...
@@ -20,7 +20,7 @@ export type Props = {
};
export
type
Response
=
{
history
:
ChatItemType
[]
};
const
agentModel
=
'gpt-3.5-turbo
-16k
'
;
const
agentModel
=
'gpt-3.5-turbo'
;
const
agentFunName
=
'agent_user_question'
;
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
...
...
@@ -78,13 +78,13 @@ export async function classifyQuestion({
// function body
const
agentFunction
=
{
name
:
agentFunName
,
description
:
'判断用户问题的类型,并返回
不同的
值'
,
description
:
'判断用户问题的类型,并返回
指定
值'
,
parameters
:
{
type
:
'object'
,
properties
:
{
type
:
{
type
:
'string'
,
description
:
agents
.
map
((
item
)
=>
`
${
item
.
value
}
,返回
: '
${
item
.
key
}
'`
).
join
(
'\n
'
),
description
:
agents
.
map
((
item
)
=>
`
${
item
.
value
}
,返回
:'
${
item
.
key
}
'`
).
join
(
';
'
),
enum
:
agents
.
map
((
item
)
=>
item
.
key
)
}
},
...
...
@@ -122,12 +122,17 @@ export async function classifyQuestion({
tokenLen
:
totalTokens
});
console
.
log
(
'CQ'
,
agents
.
findIndex
((
item
)
=>
item
.
key
===
arg
.
type
)
);
console
.
log
(
agents
.
map
((
item
)
=>
`
${
item
.
value
}
,返回: '
${
item
.
key
}
'`
).
join
(
';'
),
arg
);
const
result
=
agents
.
find
((
item
)
=>
item
.
key
===
arg
.
type
);
if
(
result
)
{
return
{
[
arg
.
type
]:
1
};
}
return
{
[
a
rg
.
type
]:
1
[
a
gents
[
0
].
key
]:
1
};
}
client/src/pages/app/detail/components/edit/components/Nodes/NodeChat.tsx
View file @
7fe2017a
...
...
@@ -43,7 +43,7 @@ const NodeChat = ({
return
(
<
MySelect
width=
{
'100%'
}
value=
{
inputItem
.
value
}
value=
{
inputItem
.
value
||
chatModelList
[
0
]?.
model
}
list=
{
list
}
onchange=
{
(
e
)
=>
{
onChangeNode
({
...
...
client/src/pages/app/list/component/CreateModal.tsx
View file @
7fe2017a
...
...
@@ -113,6 +113,7 @@ const CreateModal = ({ onClose, onSuccess }: { onClose: () => void; onSuccess: (
<
Flex
mt=
{
3
}
alignItems=
{
'center'
}
>
<
MyTooltip
label=
{
'点击设置头像'
}
>
<
Avatar
flexShrink=
{
0
}
src=
{
getValues
(
'avatar'
)
}
w=
{
[
'32px'
,
'36px'
]
}
h=
{
[
'32px'
,
'36px'
]
}
...
...
@@ -122,6 +123,7 @@ const CreateModal = ({ onClose, onSuccess }: { onClose: () => void; onSuccess: (
/>
</
MyTooltip
>
<
Input
flex=
{
1
}
ml=
{
4
}
autoFocus
bg=
{
'myWhite.600'
}
...
...
client/src/pages/index.tsx
View file @
7fe2017a
...
...
@@ -169,13 +169,13 @@ const Home = () => {
fontSize=
{
[
'40px'
,
'70px'
]
}
letterSpacing=
{
'5px'
}
>
Fast
Gpt
Fast
AI
</
Box
>
<
Box
className=
{
styles
.
textlg
}
fontWeight=
{
'bold'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
三分钟
可视化 AI 编排
</
Box
>
<
Box
className=
{
styles
.
textlg
}
fontWeight=
{
'bold'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
搭建 AI 知识
库
快速搭建 AI 问答
库
</
Box
>
<
Flex
flexDirection=
{
[
'column'
,
'row'
]
}
my=
{
5
}
>
...
...
client/src/pages/kb/detail/components/Info.tsx
View file @
7fe2017a
...
...
@@ -60,7 +60,7 @@ const Info = (
title
:
'删除成功'
,
status
:
'success'
});
router
.
replace
(
`/kb
?kbId=
${
myKbList
.
find
((
item
)
=>
item
.
_id
!==
kbId
)?.
_id
||
''
}
`);
router
.
replace
(
`/kb
/list
`
);
await
loadKbList
();
}
catch
(
err
:
any
)
{
toast
({
...
...
@@ -69,7 +69,7 @@ const Info = (
});
}
setBtnLoading
(
false
);
}, [setBtnLoading, kbId, toast, router,
myKbList,
loadKbList]);
},
[
setBtnLoading
,
kbId
,
toast
,
router
,
loadKbList
]);
const
saveSubmitSuccess
=
useCallback
(
async
(
data
:
KbItemType
)
=>
{
...
...
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