|
@@ -40,7 +40,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
max={1}
|
|
max={1}
|
|
|
onChange={onChange}
|
|
onChange={onChange}
|
|
|
// value={typeof topPValue === 'number' ? topPValue : 0}
|
|
// value={typeof topPValue === 'number' ? topPValue : 0}
|
|
|
- value = {topPValue}
|
|
|
|
|
|
|
+ value={topPValue}
|
|
|
step={0.1}
|
|
step={0.1}
|
|
|
/>
|
|
/>
|
|
|
</Col>
|
|
</Col>
|
|
@@ -318,7 +318,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
} else if (value === 'flexib') {
|
|
} else if (value === 'flexib') {
|
|
|
setTopPValue(0.9);
|
|
setTopPValue(0.9);
|
|
|
setTempValue(0.90);
|
|
setTempValue(0.90);
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
@@ -497,6 +497,27 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
<Divider plain></Divider>
|
|
<Divider plain></Divider>
|
|
|
<div >
|
|
<div >
|
|
|
<FormItem name='prompt'
|
|
<FormItem name='prompt'
|
|
|
|
|
+ initialValue={`你是一位知识检索助手,你必须并且只能从我发送的众多知识片段中寻找能够解决用户输入问题的最优答案,并且在执行任务的过程中严格执行规定的要求。
|
|
|
|
|
+
|
|
|
|
|
+知识片段如下:
|
|
|
|
|
+{{知识}}
|
|
|
|
|
+
|
|
|
|
|
+规定要求:
|
|
|
|
|
+- 找到答案就仅使用知识片段中的原文回答用户的提问;
|
|
|
|
|
+- 找不到答案就用自身知识并且告诉用户该信息不是来自文档;
|
|
|
|
|
+- 所引用的文本片段中所包含的示意图占位符必须进行返回,占位符格式参考:【示意图序号_编号】
|
|
|
|
|
+ - 严禁输出任何知识片段中不存在的示意图占位符;
|
|
|
|
|
+ - 输出的内容必须删除其中包含的任何图注、序号等信息。例如:“进入登录页面(图1.1)”需要从文字中删除图序,回复效果为:“进入登录页面”;“如图所示1.1”,回复效果为:“如图所示”;
|
|
|
|
|
+- 格式规范
|
|
|
|
|
+ - 文档中会出现包含表格的情况,表格是以图片标识符的形式呈现,表格中缺失数据时候返回空单元格;
|
|
|
|
|
+ - 如果需要用到表格中的数据,以markdown格式输出表格中的数据;
|
|
|
|
|
+ - 避免使用代码块语法回复信息;
|
|
|
|
|
+ - 回复的开头语不要输出诸如:“我想”,“我认为”,“think”等相关语义的文本。
|
|
|
|
|
+
|
|
|
|
|
+严格执行规定要求,不要复述问题,直接开始回答。
|
|
|
|
|
+
|
|
|
|
|
+用户输入问题:
|
|
|
|
|
+{{用户}}`}
|
|
|
rules={[{ required: true, message: '提示词不能为空' }]}>
|
|
rules={[{ required: true, message: '提示词不能为空' }]}>
|
|
|
<TextArea
|
|
<TextArea
|
|
|
placeholder="提示词"
|
|
placeholder="提示词"
|
|
@@ -585,149 +606,149 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
{/* {isVisible && */}
|
|
{/* {isVisible && */}
|
|
|
- <div style={{ display: isVisible ? 'block' : 'none', paddingTop: '20px' }}>
|
|
|
|
|
- {isVisibleCus &&
|
|
|
|
|
- <Space style={{ width: '100%' }} direction="vertical">
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='Top-p'
|
|
|
|
|
- name='topP'
|
|
|
|
|
- style={{ width: '300px' }}
|
|
|
|
|
- >
|
|
|
|
|
- <TopPDecimalStep />
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='Temperature'
|
|
|
|
|
- name='temperature'
|
|
|
|
|
- style={{ width: '300px' }}
|
|
|
|
|
- >
|
|
|
|
|
- <TempDecimalStep />
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- </Space >
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='回答风格'
|
|
|
|
|
- name='param_desc'
|
|
|
|
|
- rules={[{ required: true, message: '回答风格不能为空' }]}>
|
|
|
|
|
- <Radio.Group buttonStyle="solid"
|
|
|
|
|
- className='questionAnswerInfo-content-title'>
|
|
|
|
|
- <Radio.Button onClick={() => {
|
|
|
|
|
- handleRedioClick('strict')
|
|
|
|
|
- }} value='strict'>严谨</Radio.Button>
|
|
|
|
|
- <Radio.Button onClick={() => {
|
|
|
|
|
- handleRedioClick('moderate')
|
|
|
|
|
- }} value='moderate'>适中</Radio.Button>
|
|
|
|
|
- <Radio.Button onClick={() => {
|
|
|
|
|
- handleRedioClick('flexib')
|
|
|
|
|
- }} value='flexib'>发散</Radio.Button>
|
|
|
|
|
- <Radio.Button value='custom'
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- setIsVisibleCus(!isVisibleCus);
|
|
|
|
|
- setTopPValue(0.1);
|
|
|
|
|
- setTempValue(0.01);
|
|
|
|
|
- }}
|
|
|
|
|
- >自定义
|
|
|
|
|
- </Radio.Button>
|
|
|
|
|
- </Radio.Group>
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='展示引用知识'
|
|
|
|
|
- name='show_recall_result'
|
|
|
|
|
- className='questionAnswerInfo-content-title'>
|
|
|
|
|
- <Switch onChange={onChangeShow} />
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='召回方式'
|
|
|
|
|
- name='recall_method'
|
|
|
|
|
- rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
|
|
-
|
|
|
|
|
- <Radio.Group
|
|
|
|
|
- style={style}
|
|
|
|
|
- onChange={onChangeRecallMethod}
|
|
|
|
|
- options={[
|
|
|
|
|
- { value: 'embedding', label: '向量化检索' },
|
|
|
|
|
- { value: 'keyword', label: '关键词检索' },
|
|
|
|
|
- { value: 'mixed', label: '混合检索' },
|
|
|
|
|
- ]}
|
|
|
|
|
- />
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <div className='questionAnswerInfo-content-title'>重排方式</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='Rerank模型'
|
|
|
|
|
- name='rerank_status'
|
|
|
|
|
- valuePropName='checked'
|
|
|
|
|
- className='questionAnswerInfo-content-title'
|
|
|
|
|
- >
|
|
|
|
|
- <Switch onChange={onChangeModel} />
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- {isVisibleRerank &&
|
|
|
|
|
|
|
+ <div style={{ display: isVisible ? 'block' : 'none', paddingTop: '20px' }}>
|
|
|
|
|
+ {isVisibleCus &&
|
|
|
|
|
+ <Space style={{ width: '100%' }} direction="vertical">
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<FormItem
|
|
<FormItem
|
|
|
- label='模型选择'
|
|
|
|
|
- name='rerank_model_name'
|
|
|
|
|
|
|
+ label='Top-p'
|
|
|
|
|
+ name='topP'
|
|
|
|
|
+ style={{ width: '300px' }}
|
|
|
>
|
|
>
|
|
|
- <Select
|
|
|
|
|
- style={{ width: '300px', height: '48px' }}
|
|
|
|
|
- placeholder='请选择模型'
|
|
|
|
|
- // defaultValue={'rerank'}
|
|
|
|
|
- >
|
|
|
|
|
- <Option value='rerank'>默认rerank模型</Option>
|
|
|
|
|
- </Select>
|
|
|
|
|
|
|
+ <TopPDecimalStep />
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
</div>
|
|
</div>
|
|
|
- }
|
|
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='Temperature'
|
|
|
|
|
+ name='temperature'
|
|
|
|
|
+ style={{ width: '300px' }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <TempDecimalStep />
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Space >
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='回答风格'
|
|
|
|
|
+ name='param_desc'
|
|
|
|
|
+ rules={[{ required: true, message: '回答风格不能为空' }]}>
|
|
|
|
|
+ <Radio.Group buttonStyle="solid"
|
|
|
|
|
+ className='questionAnswerInfo-content-title'>
|
|
|
|
|
+ <Radio.Button onClick={() => {
|
|
|
|
|
+ handleRedioClick('strict')
|
|
|
|
|
+ }} value='strict'>严谨</Radio.Button>
|
|
|
|
|
+ <Radio.Button onClick={() => {
|
|
|
|
|
+ handleRedioClick('moderate')
|
|
|
|
|
+ }} value='moderate'>适中</Radio.Button>
|
|
|
|
|
+ <Radio.Button onClick={() => {
|
|
|
|
|
+ handleRedioClick('flexib')
|
|
|
|
|
+ }} value='flexib'>发散</Radio.Button>
|
|
|
|
|
+ <Radio.Button value='custom'
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setIsVisibleCus(!isVisibleCus);
|
|
|
|
|
+ setTopPValue(0.1);
|
|
|
|
|
+ setTempValue(0.01);
|
|
|
|
|
+ }}
|
|
|
|
|
+ >自定义
|
|
|
|
|
+ </Radio.Button>
|
|
|
|
|
+ </Radio.Group>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='展示引用知识'
|
|
|
|
|
+ name='show_recall_result'
|
|
|
|
|
+ className='questionAnswerInfo-content-title'>
|
|
|
|
|
+ <Switch onChange={onChangeShow} />
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='召回方式'
|
|
|
|
|
+ name='recall_method'
|
|
|
|
|
+ rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
|
|
+
|
|
|
|
|
+ <Radio.Group
|
|
|
|
|
+ style={style}
|
|
|
|
|
+ onChange={onChangeRecallMethod}
|
|
|
|
|
+ options={[
|
|
|
|
|
+ { value: 'embedding', label: '向量化检索' },
|
|
|
|
|
+ { value: 'keyword', label: '关键词检索' },
|
|
|
|
|
+ { value: 'mixed', label: '混合检索' },
|
|
|
|
|
+ ]}
|
|
|
|
|
+ />
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <div className='questionAnswerInfo-content-title'>重排方式</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='Rerank模型'
|
|
|
|
|
+ name='rerank_status'
|
|
|
|
|
+ valuePropName='checked'
|
|
|
|
|
+ className='questionAnswerInfo-content-title'
|
|
|
|
|
+ >
|
|
|
|
|
+ <Switch onChange={onChangeModel} />
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {isVisibleRerank &&
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<FormItem
|
|
<FormItem
|
|
|
- label='召回切片数量'
|
|
|
|
|
- name='slice_config_type'
|
|
|
|
|
- rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
|
|
|
|
+ label='模型选择'
|
|
|
|
|
+ name='rerank_model_name'
|
|
|
|
|
+ >
|
|
|
<Select
|
|
<Select
|
|
|
style={{ width: '300px', height: '48px' }}
|
|
style={{ width: '300px', height: '48px' }}
|
|
|
- placeholder='请选择'
|
|
|
|
|
- onChange={onChangeCount}>
|
|
|
|
|
- <Option value="fixed">手动设置</Option>
|
|
|
|
|
- <Option value="customized">自动设置</Option>
|
|
|
|
|
|
|
+ placeholder='请选择模型'
|
|
|
|
|
+ // defaultValue={'rerank'}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Option value='rerank'>默认rerank模型</Option>
|
|
|
</Select>
|
|
</Select>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ }
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='召回切片数量'
|
|
|
|
|
+ name='slice_config_type'
|
|
|
|
|
+ rules={[{ required: true, message: '召回方式不能为空' }]}>
|
|
|
|
|
+ <Select
|
|
|
|
|
+ style={{ width: '300px', height: '48px' }}
|
|
|
|
|
+ placeholder='请选择'
|
|
|
|
|
+ onChange={onChangeCount}>
|
|
|
|
|
+ <Option value="fixed">手动设置</Option>
|
|
|
|
|
+ <Option value="customized">自动设置</Option>
|
|
|
|
|
+ </Select>
|
|
|
|
|
+ </FormItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- {isVisibleSlice &&
|
|
|
|
|
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
- <FormItem
|
|
|
|
|
- label='召回切片数'
|
|
|
|
|
- name='slice_count'
|
|
|
|
|
- rules={[{ required: true, message: '切片数不能为空' }]}>
|
|
|
|
|
- <InputNumber max={1024} changeOnWheel className='questionAnswerInfo-content-title' />
|
|
|
|
|
- </FormItem>
|
|
|
|
|
- </div>
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ {isVisibleSlice &&
|
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
<FormItem
|
|
<FormItem
|
|
|
- label='召回切片拼接方式'
|
|
|
|
|
- name='recall_slice_splicing_method'
|
|
|
|
|
- >
|
|
|
|
|
- <TextArea
|
|
|
|
|
- rows={4}
|
|
|
|
|
- className='questionAnswerInfo-content-title'
|
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ label='召回切片数'
|
|
|
|
|
+ name='slice_count'
|
|
|
|
|
+ rules={[{ required: true, message: '切片数不能为空' }]}>
|
|
|
|
|
+ <InputNumber max={1024} changeOnWheel className='questionAnswerInfo-content-title' />
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ }
|
|
|
|
|
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
|
|
|
|
+ <FormItem
|
|
|
|
|
+ label='召回切片拼接方式'
|
|
|
|
|
+ name='recall_slice_splicing_method'
|
|
|
|
|
+ >
|
|
|
|
|
+ <TextArea
|
|
|
|
|
+ rows={4}
|
|
|
|
|
+ className='questionAnswerInfo-content-title'
|
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
|
+ />
|
|
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
{/* } */}
|
|
{/* } */}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -736,7 +757,7 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
</div>
|
|
</div>
|
|
|
</Form>
|
|
</Form>
|
|
|
</Spin>
|
|
</Spin>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div >
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|