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
84daf853
authored
Jun 18, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: base url
parent
6c62d80a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
18 deletions
+30
-18
client/public/docs/versionIntro.md
+1
-1
client/src/pages/model/components/detail/components/API.tsx
+6
-3
client/src/pages/model/components/detail/components/Settings.tsx
+15
-11
client/src/pages/model/components/detail/index.tsx
+8
-3
No files found.
client/public/docs/versionIntro.md
View file @
84daf853
### Fast GPT V3.8.8
1.
新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接
。
1.
新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接
,不需要改任何代码。具体参考
[
API 文档中《在第三方应用中使用 FastGpt》
](
https://kjqvjse66l.feishu.cn/docx/DmLedTWtUoNGX8xui9ocdUEjnNh
)
2.
新增 - 应用配置最大回复长度。
3.
新增 - 更多的知识库配置项:相似度、最大搜索数量、自定义空搜索结果回复。
4.
新增 - 知识库搜索测试,方便调试。
...
...
client/src/pages/model/components/detail/components/API.tsx
View file @
84daf853
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
{
Box
,
Divider
,
Flex
,
useTheme
,
Button
,
Skeleton
,
useDisclosure
}
from
'@chakra-ui/react'
;
import
{
useCopyData
}
from
'@/utils/tools'
;
import
dynamic
from
'next/dynamic'
;
...
...
@@ -8,11 +8,10 @@ const APIKeyModal = dynamic(() => import('@/components/APIKeyModal'), {
ssr
:
true
});
const
baseUrl
=
'https://fastgpt.run/api/openapi'
;
const
API
=
({
modelId
}:
{
modelId
:
string
})
=>
{
const
theme
=
useTheme
();
const
{
copyData
}
=
useCopyData
();
const
[
baseUrl
,
setBaseUrl
]
=
useState
(
'https://fastgpt.run/api/openapi'
);
const
{
isOpen
:
isOpenAPIModal
,
onOpen
:
onOpenAPIModal
,
...
...
@@ -20,6 +19,10 @@ const API = ({ modelId }: { modelId: string }) => {
}
=
useDisclosure
();
const
[
isLoaded
,
setIsLoaded
]
=
useState
(
false
);
useEffect
(()
=>
{
setBaseUrl
(
`
${
location
.
origin
}
/api/openapi`
);
},
[]);
return
(
<
Flex
flexDirection=
{
'column'
}
h=
{
'100%'
}
>
<
Box
display=
{
[
'none'
,
'flex'
]
}
px=
{
5
}
alignItems=
{
'center'
}
>
...
...
client/src/pages/model/components/detail/components/Settings.tsx
View file @
84daf853
...
...
@@ -308,6 +308,7 @@ const Settings = ({ modelId }: { modelId: string }) => {
w=
{
'120px'
}
size=
{
[
'sm'
,
'md'
]
}
isLoading=
{
btnLoading
}
isDisabled=
{
!
isOwner
}
onClick=
{
async
()
=>
{
try
{
await
saveUpdateModel
();
...
...
@@ -321,7 +322,7 @@ const Settings = ({ modelId }: { modelId: string }) => {
}
}
}
>
保存
{
isOwner
?
'保存'
:
'仅读,无法修改'
}
</
Button
>
<
Button
mr=
{
3
}
...
...
@@ -341,17 +342,20 @@ const Settings = ({ modelId }: { modelId: string }) => {
>
对话
</
Button
>
<
Button
colorScheme=
{
'gray'
}
variant=
{
'base'
}
size=
{
[
'sm'
,
'md'
]
}
isLoading=
{
btnLoading
}
_hover=
{
{
color
:
'red.600'
}
}
onClick=
{
openConfirm
(
handleDelModel
)
}
>
删除
</
Button
>
{
isOwner
&&
(
<
Button
colorScheme=
{
'gray'
}
variant=
{
'base'
}
size=
{
[
'sm'
,
'md'
]
}
isLoading=
{
btnLoading
}
_hover=
{
{
color
:
'red.600'
}
}
onClick=
{
openConfirm
(
handleDelModel
)
}
>
删除
</
Button
>
)
}
</
Flex
>
<
File
onSelect=
{
onSelectFile
}
/>
<
ConfirmChild
/>
<
Loading
loading=
{
isLoading
}
fixed=
{
false
}
/>
...
...
client/src/pages/model/components/detail/index.tsx
View file @
84daf853
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useMemo
}
from
'react'
;
import
{
useRouter
}
from
'next/router'
;
import
{
Box
,
Flex
}
from
'@chakra-ui/react'
;
import
{
useUserStore
}
from
'@/store/user'
;
...
...
@@ -28,9 +28,14 @@ enum TabEnum {
const
ModelDetail
=
({
modelId
}:
{
modelId
:
string
})
=>
{
const
router
=
useRouter
();
const
{
isPc
}
=
useGlobalStore
();
const
{
modelDetail
}
=
useUserStore
();
const
{
modelDetail
,
userInfo
}
=
useUserStore
();
const
[
currentTab
,
setCurrentTab
]
=
useState
<
`
${
TabEnum
}
`
>
(
TabEnum
.
settings
);
const
isOwner
=
useMemo
(
()
=>
modelDetail
.
userId
===
userInfo
?.
_id
,
[
modelDetail
.
userId
,
userInfo
?.
_id
]
);
useEffect
(()
=>
{
window
.
onbeforeunload
=
(
e
)
=>
{
e
.
preventDefault
();
...
...
@@ -67,7 +72,7 @@ const ModelDetail = ({ modelId }: { modelId: string }) => {
w=
{
[
'300px'
,
'360px'
]
}
list=
{
[
{
label
:
'配置'
,
id
:
TabEnum
.
settings
},
{
label
:
'知识库'
,
id
:
TabEnum
.
kb
}
,
...(
isOwner
?
[{
label
:
'知识库'
,
id
:
TabEnum
.
kb
}]
:
[])
,
{
label
:
'分享'
,
id
:
TabEnum
.
share
},
{
label
:
'API'
,
id
:
TabEnum
.
API
},
{
label
:
'立即对话'
,
id
:
'startChat'
}
...
...
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