This commit is contained in:
archer
2023-07-28 20:47:20 +08:00
parent f764d81cdd
commit 950dffaedf
8 changed files with 62 additions and 63 deletions

View File

@@ -1,7 +1,11 @@
### 常见问题
**一键部署**V4 版本未正式开源,目前仅提供一键部署方案:
[![](https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg)](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt)
**Git 地址**: [项目地址。V4-beta 暂未开源,在正式版发布后会开源。](https://github.com/labring/FastGPT)
**反馈问卷**: 如果你遇到任何使用问题或有期望的功能,可以[填写该问卷](https://www.wjx.cn/vm/rLIw1uD.aspx#)
**Git 地址**: [项目地址。V4-preview 暂未开源,在正式版发布后会开源。](https://github.com/labring/FastGPT)
**问题文档**: [先看文档,再提问](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh)
**价格表**
| 计费项 | 价格: 元/ 1K tokens包含上下文|

View File

@@ -1,9 +0,0 @@
接受一个 csv 文件,表格头包含 question 和 answer。question 代表问题answer 代表答案。
导入前会进行去重,如果问题和答案完全相同,则不会被导入,所以最终导入的内容可能会比文件的内容少。但是,对于带有换行的内容,目前无法去重。
### 请保证 csv 文件为 utf-8 编码
| question | answer |
| ------------- | ------------------------------------------------------ |
| 什么是 laf | laf 是一个云函数开发平台…… |
| 什么是 sealos | Sealos 是以 kubernetes 为内核的云操作系统发行版,可以…… |

View File

@@ -1,34 +0,0 @@
## 欢迎使用 Fast GPT
### 项目开源
FastGpt 项目完全开源,可随意私有化部署,去除平台风险忧虑。项目地址:[Git 仓库](https://github.com/labring/FastGPT)
### 开始使用知识库
1. AI 助手详情里,有一个模型效果。打开知识库搜索开关即可使用知识库搜索功能。
2. 导入知识库数据。可以手动输入或文件导入。
3. 开始对话。
4. 对话结束后,会看到聊天下方有一个“查看提示词”,可以看到搜索到了哪些内容。
注意使用知识库模型对话时tokens 消耗会加快。
### 价格表
如果使用了自己的 Api Key网页上 openai 模型聊天不会计费。可以在账号页,看到详细账单。
| 计费项 | 价格: 元/ 1K tokens包含上下文|
| --- | --- |
| 知识库 - 索引 | 0.001 |
| FastAI4k - 对话 | 0.015 |
| FastAI16k - 对话 | 0.03 |
| FastAI-Plus - 对话 | 0.45 |
| 文件拆分 | 0.03 |
### 交流群/问题反馈
如果群满了,可加个小助手,定时拉
wx 号: YNyiqi
| 交流群 | 小助手 |
| ------------------------------------------------- | ---------------------------------------------- |
| ![](https://otnvvf-imgs.oss.laf.run/wxqun300.jpg) | ![](https://otnvvf-imgs.oss.laf.run/wx300.jpg) |

View File

@@ -1,3 +0,0 @@
你正准备分享对话,请确保分享链接不会滥用,因为它是使用的是你的 API key。
* 分享空白对话:为该模型创建一个空白的聊天分享出去。
* 分享当前对话:会把当前聊天的内容也分享出去,但是要注意不要多个人同时用一个聊天内容。

View File

@@ -1,10 +1,8 @@
### Fast GPT V4.1-preview
preview 版本尚未稳定,请以测试为主。正式版上线前可能会初始化或删除部分对话/应用数据。
### Fast GPT V4.0-beta
1. 全新交互,增加采用模块组合的方式构建知识库,同时保留表单的简易模式。
2. 问题分类 - 可以对用户的问题进行分类,再执行不同的操作。
3. 对话引导 - 增加开场引导和变量,提高对话可玩性。
4. 新增 - 每轮对话均可展示完整的上下文状态。
5. 优化 - OpenAPI 接口可直接传入 chatId 作为上下文标记
6. 优化 - 模块调度方案
5. 新增 - 网页嵌入(简单版),可直接接入现有网页。在 【应用详情-外部使用-创建新链接-嵌入网页】 中获取嵌入脚本
6. 新增 - 个人 openai 账号可以使用网页上 OpenAI 对话模型

View File

@@ -1,18 +1,32 @@
import React from 'react';
import React, { useMemo } from 'react';
import { Box } from '@chakra-ui/react';
import Image from './img/Image';
const regex = /((http|https|ftp):\/\/[^\s\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]+)/gi;
const Link = (props: { href?: string; children?: React.ReactNode[] }) => {
const decText = decodeURIComponent(props.href || '');
const replaceText = decText.replace(regex, (match, p1) => {
const text = decText === props.children?.[0] ? p1 : props.children?.[0];
const isInternal = /^\/#/i.test(p1);
const target = isInternal ? '_self' : '_blank';
return `<a href="${p1}" target=${target}>${text}</a>`;
});
const Link = (props: { href?: string; children?: any }) => {
const Html = useMemo(() => {
const decText = decodeURIComponent(props.href || '');
return <Box as={'span'} dangerouslySetInnerHTML={{ __html: replaceText }} />;
return decText.replace(regex, (match, p1) => {
let text = decText === props.children?.[0] ? p1 : props.children?.[0];
const isInternal = /^\/#/i.test(p1);
const target = isInternal ? '_self' : '_blank';
if (props?.children?.[0]?.props?.node?.tagName === 'img') {
// eslint-disable-next-line @next/next/no-img-element
text = `<img src="${props?.children?.[0]?.props?.src}" />`;
}
return `<a href="${p1}" target=${target}>${text}</a>`;
});
}, [props.children, props.href]);
return typeof Html === 'string' ? (
<Box as={'span'} dangerouslySetInnerHTML={{ __html: Html }} />
) : (
Html
);
};
export default React.memo(Link);

View File

@@ -0,0 +1,27 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@/service/response';
import { authUser } from '@/service/utils/auth';
import { connectToDatabase, OutLink } from '@/service/mongo';
import { OutLinkTypeEnum } from '@/constants/chat';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
await authUser({ req, authRoot: true });
await connectToDatabase();
await OutLink.updateMany(
{},
{
$set: { type: OutLinkTypeEnum.share }
}
);
jsonRes(res, {});
} catch (error) {
jsonRes(res, {
code: 500,
error
});
}
}

View File

@@ -4,6 +4,7 @@ import { connectToDatabase, OutLink } from '@/service/mongo';
import { authApp, authUser } from '@/service/utils/auth';
import type { ShareChatEditType } from '@/types/app';
import { customAlphabet } from 'nanoid';
import { OutLinkTypeEnum } from '@/constants/chat';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 24);
/* create a shareChat */
@@ -27,7 +28,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
shareId,
userId,
appId,
name
name,
type: OutLinkTypeEnum.share
});
jsonRes(res, {