This commit is contained in:
archer 2023-07-19 08:11:14 +08:00
parent 7fe2017ab6
commit 58cbf10c85
No known key found for this signature in database
GPG Key ID: 569A5660D2379E28
6 changed files with 41 additions and 65 deletions

View File

@ -1,7 +1,7 @@
### 常见问题 ### 常见问题
**反馈问卷**: 如果你遇到任何使用问题或有期望的功能,可以[填写该问卷](https://www.wjx.cn/vm/rLIw1uD.aspx#) **反馈问卷**: 如果你遇到任何使用问题或有期望的功能,可以[填写该问卷](https://www.wjx.cn/vm/rLIw1uD.aspx#)
**Git 地址**: [项目地址。V4-preview 暂开源,在正式版发布后会开源。](https://github.com/c121914yu/FastGPT) **Git 地址**: [项目地址。V4-preview 暂开源,在正式版发布后会开源。](https://github.com/c121914yu/FastGPT)
**问题文档**: [先看文档,再提问](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh) **问题文档**: [先看文档,再提问](https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh)
**价格表** **价格表**
| 计费项 | 价格: 元/ 1K tokens包含上下文| | 计费项 | 价格: 元/ 1K tokens包含上下文|

View File

@ -162,7 +162,7 @@ export const ChatModule: AppModuleTemplateItemType = {
'限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"', '限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"',
value: '' value: ''
}, },
Input_Template_TFSwitch, // Input_Template_TFSwitch,
{ {
key: 'quotePrompt', key: 'quotePrompt',
type: FlowInputItemTypeEnum.target, type: FlowInputItemTypeEnum.target,

View File

@ -3,7 +3,6 @@ import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@/service/response'; import { jsonRes } from '@/service/response';
import { authUser } from '@/service/utils/auth'; import { authUser } from '@/service/utils/auth';
import { connectToDatabase, App } from '@/service/mongo'; import { connectToDatabase, App } from '@/service/mongo';
import { rawSearchKey } from '@/constants/chat';
const chatTemplate = ({ const chatTemplate = ({
model, model,
@ -84,7 +83,7 @@ const chatTemplate = ({
}, },
{ {
key: 'temperature', key: 'temperature',
type: 'custom', type: 'slider',
label: '温度', label: '温度',
value: temperature, value: temperature,
min: 0, min: 0,
@ -108,16 +107,16 @@ const chatTemplate = ({
label: '回复上限', label: '回复上限',
value: maxToken, value: maxToken,
min: 100, min: 100,
max: 16000, max: 4000,
step: 50, step: 50,
markList: [ markList: [
{ {
label: '0', label: '100',
value: 0 value: 100
}, },
{ {
label: '16000', label: '4000',
value: 16000 value: 4000
} }
], ],
connected: false connected: false
@ -144,12 +143,6 @@ const chatTemplate = ({
value: limitPrompt, value: limitPrompt,
connected: false connected: false
}, },
{
key: 'switch',
type: 'target',
label: '触发器',
connected: false
},
{ {
key: 'quotePrompt', key: 'quotePrompt',
type: 'target', type: 'target',
@ -284,8 +277,8 @@ const kbTemplate = ({
} }
], ],
position: { position: {
x: -210.24817109253843, x: -196.84632684738483,
y: 665.7922967022607 y: 797.3401378431948
}, },
moduleId: 'v0nc1s' moduleId: 'v0nc1s'
}, },
@ -327,8 +320,8 @@ const kbTemplate = ({
} }
], ],
position: { position: {
x: -196.84632684738483, x: 211.58250540918442,
y: 797.3401378431948 y: 611.8700401034965
}, },
moduleId: 'k9y3jm' moduleId: 'k9y3jm'
}, },
@ -345,25 +338,12 @@ const kbTemplate = ({
type: 'custom', type: 'custom',
label: '对话模型', label: '对话模型',
value: model, value: model,
list: [ list: [],
{
label: 'FastAI-4k',
value: 'gpt-3.5-turbo'
},
{
label: 'FastAI-16k',
value: 'gpt-3.5-turbo-16k'
},
{
label: 'FastAI-Plus',
value: 'gpt-4'
}
],
connected: false connected: false
}, },
{ {
key: 'temperature', key: 'temperature',
type: 'custom', type: 'slider',
label: '温度', label: '温度',
value: temperature, value: temperature,
min: 0, min: 0,
@ -387,16 +367,16 @@ const kbTemplate = ({
label: '回复上限', label: '回复上限',
value: maxToken, value: maxToken,
min: 100, min: 100,
max: 16000, max: 4000,
step: 50, step: 50,
markList: [ markList: [
{ {
label: '0', label: '100',
value: 0 value: 100
}, },
{ {
label: '16000', label: '4000',
value: 16000 value: 4000
} }
], ],
connected: false connected: false
@ -423,12 +403,6 @@ const kbTemplate = ({
value: limitPrompt, value: limitPrompt,
connected: false connected: false
}, },
{
key: 'switch',
type: 'target',
label: '触发器',
connected: true
},
{ {
key: 'quotePrompt', key: 'quotePrompt',
type: 'target', type: 'target',
@ -481,7 +455,7 @@ const kbTemplate = ({
}, },
{ {
key: 'similarity', key: 'similarity',
type: 'custom', type: 'slider',
label: '相似度', label: '相似度',
value: searchSimilarity, value: searchSimilarity,
min: 0, min: 0,
@ -489,8 +463,8 @@ const kbTemplate = ({
step: 0.01, step: 0.01,
markList: [ markList: [
{ {
label: '0', label: '100',
value: 0 value: 100
}, },
{ {
label: '1', label: '1',
@ -501,7 +475,7 @@ const kbTemplate = ({
}, },
{ {
key: 'limit', key: 'limit',
type: 'custom', type: 'slider',
label: '单次搜索上限', label: '单次搜索上限',
description: '最多取 n 条记录作为本次问题引用', description: '最多取 n 条记录作为本次问题引用',
value: searchLimit, value: searchLimit,
@ -524,7 +498,7 @@ const kbTemplate = ({
key: 'switch', key: 'switch',
type: 'target', type: 'target',
label: '触发器', label: '触发器',
connected: true connected: false
}, },
{ {
key: 'userChatInput', key: 'userChatInput',
@ -535,7 +509,7 @@ const kbTemplate = ({
], ],
outputs: [ outputs: [
{ {
key: rawSearchKey, key: 'rawSearch',
label: '源搜索数据', label: '源搜索数据',
type: 'hidden', type: 'hidden',
response: true, response: true,
@ -545,16 +519,14 @@ const kbTemplate = ({
key: 'isEmpty', key: 'isEmpty',
label: '搜索结果为空', label: '搜索结果为空',
type: 'source', type: 'source',
targets: [ targets: searchEmptyText
...(searchEmptyText ? [
? [ {
{ moduleId: 'w8av9y',
moduleId: 'w8av9y', key: 'switch'
key: 'switch' }
} ]
] : []
: [])
]
}, },
{ {
key: 'quotePrompt', key: 'quotePrompt',
@ -593,7 +565,7 @@ const kbTemplate = ({
{ {
key: 'answerText', key: 'answerText',
value: searchEmptyText, value: searchEmptyText,
type: 'input', type: 'textarea',
label: '回复的内容', label: '回复的内容',
connected: false connected: false
} }

View File

@ -20,8 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const { app } = await authApp({ const { app } = await authApp({
appId, appId,
userId, userId
authOwner: false
}); });
jsonRes(res, { jsonRes(res, {

View File

@ -125,6 +125,10 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
billId billId
}); });
if (!answerText) {
throw new Error('回复内容为空,可能模块编排出现问题');
}
// save chat // save chat
if (typeof chatId === 'string') { if (typeof chatId === 'string') {
await saveChat({ await saveChat({

View File

@ -34,7 +34,8 @@ const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props)
> >
<Flex justifyContent={'center'} alignItems={'center'}> <Flex justifyContent={'center'} alignItems={'center'}>
<MyIcon mr={1} name={'uploadFile'} w={'16px'} /> <MyIcon mr={1} name={'uploadFile'} w={'16px'} />
{' '} {/* 拖拽文件至此,或{' '} */}
<Box ml={1} as={'span'} cursor={'pointer'} color={'myBlue.700'} onClick={onOpen}> <Box ml={1} as={'span'} cursor={'pointer'} color={'myBlue.700'} onClick={onOpen}>
</Box> </Box>