mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
fix: base url
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
### Fast GPT V3.8.8
|
### Fast GPT V3.8.8
|
||||||
|
|
||||||
1. 新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接。
|
1. 新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接,不需要改任何代码。具体参考[API 文档中《在第三方应用中使用 FastGpt》](https://kjqvjse66l.feishu.cn/docx/DmLedTWtUoNGX8xui9ocdUEjnNh)
|
||||||
2. 新增 - 应用配置最大回复长度。
|
2. 新增 - 应用配置最大回复长度。
|
||||||
3. 新增 - 更多的知识库配置项:相似度、最大搜索数量、自定义空搜索结果回复。
|
3. 新增 - 更多的知识库配置项:相似度、最大搜索数量、自定义空搜索结果回复。
|
||||||
4. 新增 - 知识库搜索测试,方便调试。
|
4. 新增 - 知识库搜索测试,方便调试。
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Box, Divider, Flex, useTheme, Button, Skeleton, useDisclosure } from '@chakra-ui/react';
|
import { Box, Divider, Flex, useTheme, Button, Skeleton, useDisclosure } from '@chakra-ui/react';
|
||||||
import { useCopyData } from '@/utils/tools';
|
import { useCopyData } from '@/utils/tools';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
@@ -8,11 +8,10 @@ const APIKeyModal = dynamic(() => import('@/components/APIKeyModal'), {
|
|||||||
ssr: true
|
ssr: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const baseUrl = 'https://fastgpt.run/api/openapi';
|
|
||||||
|
|
||||||
const API = ({ modelId }: { modelId: string }) => {
|
const API = ({ modelId }: { modelId: string }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { copyData } = useCopyData();
|
const { copyData } = useCopyData();
|
||||||
|
const [baseUrl, setBaseUrl] = useState('https://fastgpt.run/api/openapi');
|
||||||
const {
|
const {
|
||||||
isOpen: isOpenAPIModal,
|
isOpen: isOpenAPIModal,
|
||||||
onOpen: onOpenAPIModal,
|
onOpen: onOpenAPIModal,
|
||||||
@@ -20,6 +19,10 @@ const API = ({ modelId }: { modelId: string }) => {
|
|||||||
} = useDisclosure();
|
} = useDisclosure();
|
||||||
const [isLoaded, setIsLoaded] = useState(false);
|
const [isLoaded, setIsLoaded] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setBaseUrl(`${location.origin}/api/openapi`);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex flexDirection={'column'} h={'100%'}>
|
<Flex flexDirection={'column'} h={'100%'}>
|
||||||
<Box display={['none', 'flex']} px={5} alignItems={'center'}>
|
<Box display={['none', 'flex']} px={5} alignItems={'center'}>
|
||||||
|
@@ -308,6 +308,7 @@ const Settings = ({ modelId }: { modelId: string }) => {
|
|||||||
w={'120px'}
|
w={'120px'}
|
||||||
size={['sm', 'md']}
|
size={['sm', 'md']}
|
||||||
isLoading={btnLoading}
|
isLoading={btnLoading}
|
||||||
|
isDisabled={!isOwner}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
await saveUpdateModel();
|
await saveUpdateModel();
|
||||||
@@ -321,7 +322,7 @@ const Settings = ({ modelId }: { modelId: string }) => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
保存
|
{isOwner ? '保存' : '仅读,无法修改'}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
mr={3}
|
mr={3}
|
||||||
@@ -341,17 +342,20 @@ const Settings = ({ modelId }: { modelId: string }) => {
|
|||||||
>
|
>
|
||||||
对话
|
对话
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
{isOwner && (
|
||||||
colorScheme={'gray'}
|
<Button
|
||||||
variant={'base'}
|
colorScheme={'gray'}
|
||||||
size={['sm', 'md']}
|
variant={'base'}
|
||||||
isLoading={btnLoading}
|
size={['sm', 'md']}
|
||||||
_hover={{ color: 'red.600' }}
|
isLoading={btnLoading}
|
||||||
onClick={openConfirm(handleDelModel)}
|
_hover={{ color: 'red.600' }}
|
||||||
>
|
onClick={openConfirm(handleDelModel)}
|
||||||
删除
|
>
|
||||||
</Button>
|
删除
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<File onSelect={onSelectFile} />
|
<File onSelect={onSelectFile} />
|
||||||
<ConfirmChild />
|
<ConfirmChild />
|
||||||
<Loading loading={isLoading} fixed={false} />
|
<Loading loading={isLoading} fixed={false} />
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect, useMemo } from 'react';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { Box, Flex } from '@chakra-ui/react';
|
import { Box, Flex } from '@chakra-ui/react';
|
||||||
import { useUserStore } from '@/store/user';
|
import { useUserStore } from '@/store/user';
|
||||||
@@ -28,9 +28,14 @@ enum TabEnum {
|
|||||||
const ModelDetail = ({ modelId }: { modelId: string }) => {
|
const ModelDetail = ({ modelId }: { modelId: string }) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { isPc } = useGlobalStore();
|
const { isPc } = useGlobalStore();
|
||||||
const { modelDetail } = useUserStore();
|
const { modelDetail, userInfo } = useUserStore();
|
||||||
const [currentTab, setCurrentTab] = useState<`${TabEnum}`>(TabEnum.settings);
|
const [currentTab, setCurrentTab] = useState<`${TabEnum}`>(TabEnum.settings);
|
||||||
|
|
||||||
|
const isOwner = useMemo(
|
||||||
|
() => modelDetail.userId === userInfo?._id,
|
||||||
|
[modelDetail.userId, userInfo?._id]
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.onbeforeunload = (e) => {
|
window.onbeforeunload = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -67,7 +72,7 @@ const ModelDetail = ({ modelId }: { modelId: string }) => {
|
|||||||
w={['300px', '360px']}
|
w={['300px', '360px']}
|
||||||
list={[
|
list={[
|
||||||
{ label: '配置', id: TabEnum.settings },
|
{ label: '配置', id: TabEnum.settings },
|
||||||
{ label: '知识库', id: TabEnum.kb },
|
...(isOwner ? [{ label: '知识库', id: TabEnum.kb }] : []),
|
||||||
{ label: '分享', id: TabEnum.share },
|
{ label: '分享', id: TabEnum.share },
|
||||||
{ label: 'API', id: TabEnum.API },
|
{ label: 'API', id: TabEnum.API },
|
||||||
{ label: '立即对话', id: 'startChat' }
|
{ label: '立即对话', id: 'startChat' }
|
||||||
|
Reference in New Issue
Block a user