diff --git a/client/public/docs/chatProblem.md b/client/public/docs/chatProblem.md
index 0b4008c75..1b4d7b3f7 100644
--- a/client/public/docs/chatProblem.md
+++ b/client/public/docs/chatProblem.md
@@ -1,12 +1,11 @@
### 常见问题
-**Git 地址**: [项目地址,完全开源,随便用。](https://github.com/labring/FastGPT)
+**Git 地址**: [项目地址。V4-beta 暂为开源,在正式版发布后会开源。](https://github.com/c121914yu/FastGPT)
**问题文档**: [先看文档,再提问](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh)
**价格表**
-如果使用了自己的 Api Key,网页上 openai 模型聊天不会计费。可以在账号页,看到详细账单。
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
-| 知识库 - 索引 | 0.001 |
+| 知识库 - 索引 | 0.002 |
| FastAI4k - 对话 | 0.015 |
| FastAI16k - 对话 | 0.03 |
| FastAI-Plus - 对话 | 0.45 |
diff --git a/client/public/docs/versionIntro.md b/client/public/docs/versionIntro.md
index f99188220..77a2fb531 100644
--- a/client/public/docs/versionIntro.md
+++ b/client/public/docs/versionIntro.md
@@ -1,6 +1,12 @@
-### Fast GPT V3.9
+### Fast GPT V4.0-beta
+<<<<<<< HEAD
1. 新增 - 直接分段训练,可调节段落大小。
2. 优化 - tokens 计算性能。
3. 优化 - key 池管理,结合 one-api 项目,实现更方便的 key 池管理,具体参考[docker 部署 FastGpt](https://github.com/labring/FastGPT/blob/main/docs/deploy/docker.md)
4. 新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接,不需要改任何代码。具体参考[API 文档中《在第三方应用中使用 FastGpt》](https://kjqvjse66l.feishu.cn/docx/DmLedTWtUoNGX8xui9ocdUEjnNh)
+=======
+1. 全新交互,采用模块组合的方式构建知识库。
+2. 问题分类 - 可以对用户的问题进行分类,再执行不同的操作。
+3. beta 版本尚未稳定,请以测试为主。详细使用文档后续会补上。
+>>>>>>> 5f8a88d (flow chat)
diff --git a/client/src/components/ChatBox/index.tsx b/client/src/components/ChatBox/index.tsx
index bf54bf36b..23fc90242 100644
--- a/client/src/components/ChatBox/index.tsx
+++ b/client/src/components/ChatBox/index.tsx
@@ -21,6 +21,7 @@ import MyIcon from '@/components/Icon';
import Avatar from '@/components/Avatar';
import { adaptChatItem_openAI } from '@/utils/plugin/openai';
+import { useMarkdown } from '@/hooks/useMarkdown';
import { VariableItemType } from '@/types/app';
import { VariableInputEnum } from '@/constants/app';
import { useForm } from 'react-hook-form';
@@ -68,8 +69,34 @@ const VariableLabel = ({
);
+const Empty = () => {
+ const { data: chatProblem } = useMarkdown({ url: '/chatProblem.md' });
+ const { data: versionIntro } = useMarkdown({ url: '/versionIntro.md' });
+
+ return (
+
+ {/* version intro */}
+
+
+
+
+
+
+
+ );
+};
+
const ChatBox = (
{
+ showEmptyIntro = false,
historyId,
appAvatar,
variableModules,
@@ -78,6 +105,7 @@ const ChatBox = (
onStartChat,
onDelMessage
}: {
+ showEmptyIntro?: boolean;
historyId?: string;
appAvatar: string;
variableModules?: VariableItemType[];
@@ -568,6 +596,8 @@ const ChatBox = (
))}
+
+ {showEmptyIntro && chatHistory.length === 0 && !hasVariableInput && }
{/* input */}
diff --git a/client/src/pages/app/detail/components/Settings.tsx b/client/src/pages/app/detail/components/Settings.tsx
index deeac7193..6c2c513ff 100644
--- a/client/src/pages/app/detail/components/Settings.tsx
+++ b/client/src/pages/app/detail/components/Settings.tsx
@@ -15,7 +15,7 @@ import MyIcon from '@/components/Icon';
import TotalUsage from './Charts/TotalUsage';
const InfoModal = dynamic(() => import('./InfoModal'));
-const AppEdit = dynamic(() => import('./edit'), { ssr: true });
+import AppEdit from './edit';
import styles from '../../list/index.module.scss';
const Settings = ({ appId }: { appId: string }) => {
diff --git a/client/src/pages/app/detail/components/edit/components/NodeChat.tsx b/client/src/pages/app/detail/components/edit/components/NodeChat.tsx
index c2c241ef9..1adfcad79 100644
--- a/client/src/pages/app/detail/components/edit/components/NodeChat.tsx
+++ b/client/src/pages/app/detail/components/edit/components/NodeChat.tsx
@@ -11,6 +11,7 @@ import MySelect from '@/components/Select';
import { chatModelList } from '@/store/static';
import MySlider from '@/components/Slider';
import { Box } from '@chakra-ui/react';
+import { formatPrice } from '@/utils/user';
const NodeChat = ({
data: { moduleId, inputs, outputs, onChangeNode, ...props }
@@ -29,45 +30,56 @@ const NodeChat = ({
onChangeNode={onChangeNode}
flowInputList={inputs}
CustomComponent={{
- model: (inputItem) => (
- {
- onChangeNode({
- moduleId,
- key: inputItem.key,
- value: e
- });
- // update max tokens
- const model = chatModelList.find((item) => item.model === e);
- if (!model) return;
+ model: (inputItem) => {
+ const list = chatModelList.map((item) => {
+ const priceStr = `(${formatPrice(item.price, 1000)}元/1k Tokens)`;
- onChangeNode({
- moduleId,
- key: 'maxToken',
- valueKey: 'markList',
- value: [
- { label: '100', value: 100 },
- { label: `${model.contextMaxToken}`, value: model.contextMaxToken }
- ]
- });
- onChangeNode({
- moduleId,
- key: 'maxToken',
- valueKey: 'max',
- value: model.contextMaxToken
- });
- onChangeNode({
- moduleId,
- key: 'maxToken',
- valueKey: 'value',
- value: model.contextMaxToken / 2
- });
- }}
- />
- ),
+ return {
+ value: item.model,
+ label: `${item.name}${priceStr}`
+ };
+ });
+
+ return (
+ {
+ onChangeNode({
+ moduleId,
+ key: inputItem.key,
+ value: e
+ });
+ // update max tokens
+ const model = chatModelList.find((item) => item.model === e);
+ if (!model) return;
+
+ onChangeNode({
+ moduleId,
+ key: 'maxToken',
+ valueKey: 'markList',
+ value: [
+ { label: '100', value: 100 },
+ { label: `${model.contextMaxToken}`, value: model.contextMaxToken }
+ ]
+ });
+ onChangeNode({
+ moduleId,
+ key: 'maxToken',
+ valueKey: 'max',
+ value: model.contextMaxToken
+ });
+ onChangeNode({
+ moduleId,
+ key: 'maxToken',
+ valueKey: 'value',
+ value: model.contextMaxToken / 2
+ });
+ }}
+ />
+ );
+ },
maxToken: (inputItem) => {
const model = inputs.find((item) => item.key === 'model')?.value;
const modelData = chatModelList.find((item) => item.model === model);
diff --git a/client/src/pages/chat/index.tsx b/client/src/pages/chat/index.tsx
index c164ae56d..ab27633b2 100644
--- a/client/src/pages/chat/index.tsx
+++ b/client/src/pages/chat/index.tsx
@@ -296,6 +296,7 @@ const Chat = () => {
{
const router = useRouter();
const { inviterId } = router.query as { inviterId: string };
- const { data } = useMarkdown({ url: '/intro.md' });
const { isPc } = useGlobalStore();
const [star, setStar] = useState(1500);
@@ -211,10 +210,6 @@ const Home = () => {
-
-
-
-
{beianText && (
diff --git a/client/src/pages/number/components/PayModal.tsx b/client/src/pages/number/components/PayModal.tsx
index afcb39589..4755aac6b 100644
--- a/client/src/pages/number/components/PayModal.tsx
+++ b/client/src/pages/number/components/PayModal.tsx
@@ -113,7 +113,7 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
source={`
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
-| 知识库 - 索引 | 0.001 |
+| 知识库 - 索引 | 0.002 |
| FastAI4k - 对话 | 0.015 |
| FastAI16k - 对话 | 0.03 |
| FastAI-Plus - 对话 | 0.45 |