feat: dataset quote role support system; fix: adapt o1 model (#2733)

* feat: dataset quote support system role

* perf: adapt dataset quote role

* fix: adapt o1 model
This commit is contained in:
Archer
2024-09-18 13:38:50 +08:00
committed by GitHub
parent 539bc77934
commit 093bfa2134
35 changed files with 582 additions and 268 deletions

View File

@@ -0,0 +1,18 @@
import React from 'react';
import { Box, HStack, Icon, StackProps } from '@chakra-ui/react';
const LightTip = ({
text,
...props
}: {
text: string;
} & StackProps) => {
return (
<HStack px="3" py="1" color="primary.600" bgColor="primary.50" borderRadius="md" {...props}>
<Icon name="common/info" w="1rem" />
<Box fontSize={'sm'}>{text}</Box>
</HStack>
);
};
export default LightTip;

View File

@@ -10,7 +10,7 @@ const FormLabel = ({
children: React.ReactNode;
}) => {
return (
<Box color={'myGray.900'} fontSize={'sm'} position={'relative'} {...props}>
<Box color={'myGray.900'} fontSize={'sm'} position={'relative'} flexShrink={0} {...props}>
{required && (
<Box color={'red.600'} position={'absolute'} top={'-4px'} left={'-6px'}>
*

View File

@@ -64,8 +64,9 @@ export default function VariablePickerPlugin({
borderRadius={'md'}
position={'absolute'}
w={'auto'}
overflow={'hidden'}
zIndex={99999}
maxH={'300px'}
overflow={'auto'}
>
{variables.map((item, index) => (
<Flex

View File

@@ -1,6 +1,7 @@
{
"Array_element": "Array element",
"Code": "Code",
"Quote_prompt_setting": "Quote prompt",
"about_xxx_question": "Question regarding xxx",
"add_new_input": "Add New Input",
"append_application_reply_to_history_as_new_context": "Append the application's reply to the history as new context",
@@ -28,6 +29,10 @@
"custom_feedback": "Custom Feedback",
"custom_input": "Custom Input",
"custom_plugin_output": "Custom Plugin Output",
"dataset_quote_role": "Role",
"dataset_quote_role_system_option_desc": "Historical records should be consistent first (recommended)",
"dataset_quote_role_tip": "When set to System, the knowledge base reference content will be placed in the system message, which can ensure the continuity of the history record, but the constraint effect may not be good.\n\nWhen set to User, the knowledge base reference content will be placed in the user message, and the {{question}} variable location needs to be specified. \nIt will have a certain impact on the consistency of historical records, but usually the constraint effect is better.",
"dataset_quote_role_user_option_desc": "Strong constraints take precedence",
"delete_api": "Confirm delete this API key? The key will be invalid immediately after deletion, but the corresponding conversation logs will not be deleted. Please confirm!",
"dynamic_input_description": "Receive the output value of the previous node as a variable, which can be used by Laf request parameters.",
"dynamic_input_description_concat": "You can reference the output of other nodes as variables for text concatenation. Type / to invoke the variable list.",
@@ -110,7 +115,12 @@
"plugin_input": "Plugin Input",
"question_classification": "Question Classification",
"question_optimization": "Question Optimization",
"quote_content_placeholder": "The structure of the reference content can be customized to better suit different scenarios. \nSome variables can be used for template configuration\n\n{{q}} - main content\n\n{{a}} - auxiliary data\n\n{{source}} - source name\n\n{{sourceId}} - source ID\n\n{{index}} - nth reference",
"quote_content_tip": "The structure of the reference content can be customized to better suit different scenarios. Some variables can be used for template configuration:\n\n{{q}} - main content\n{{a}} - auxiliary data\n{{source}} - source name\n{{sourceId}} - source ID\n{{index}} - nth reference\nThey are all optional and the following are the default values:\n\n{{default}}",
"quote_num": "Quote {{num}}",
"quote_prompt_tip": "You can use {{quote}} to insert a quote content template and {{question}} to insert a question (Role=user).\n\nThe following are the default values:\n\n{{default}}",
"quote_role_system_tip": "Please note that the {{question}} variable is removed from the \"Quote Template Prompt Words\"",
"quote_role_user_tip": "Please pay attention to adding the {{question}} variable in the \"Quote Template Prompt Word\"",
"raw_response": "Raw Response",
"regex": "Regex",
"reply_text": "Reply Text",

View File

@@ -19,10 +19,6 @@
"switch_package_a": "套餐使用规则为优先使用更高级的套餐,因此,购买的新套餐若比当前套餐更高级,则新套餐立即生效:否则将继续使用当前套餐。",
"switch_package_q": "是否切换订阅套餐?"
},
"compliance": {
"chat": "内容由第三方 AI 生成,无法确保真实准确,仅供参考",
"dataset": "请确保您的内容严格遵守相关法律法规,避免包含任何违法或侵权的内容。请谨慎上传可能涉及敏感信息的资料。"
},
"Folder": "文件夹",
"Login": "登录",
"Move": "移动",
@@ -296,6 +292,10 @@
"comon": {
"Continue_Adding": "继续添加"
},
"compliance": {
"chat": "内容由第三方 AI 生成,无法确保真实准确,仅供参考",
"dataset": "请确保您的内容严格遵守相关法律法规,避免包含任何违法或侵权的内容。请谨慎上传可能涉及敏感信息的资料。"
},
"confirm_choice": "确认选择",
"contribute_app_template": "贡献模板",
"core": {
@@ -531,6 +531,10 @@
"Read complete response tips": "点击查看详细流程",
"Tool call tokens": "工具调用 tokens 消耗",
"context total length": "上下文总长度",
"loop_input": "输入数组",
"loop_input_element": "输入数组元素",
"loop_output": "输出数组",
"loop_output_element": "输出数组元素",
"module cq": "问题分类列表",
"module cq result": "分类结果",
"module extract description": "提取背景描述",
@@ -552,11 +556,7 @@
"search using reRank": "结果重排",
"text output": "文本输出",
"update_var_result": "变量更新结果(按顺序展示多个变量更新结果)",
"user_select_result": "用户选择结果",
"loop_input": "输入数组",
"loop_output": "输出数组",
"loop_input_element": "输入数组元素",
"loop_output_element": "输出数组元素"
"user_select_result": "用户选择结果"
},
"retry": "重新生成",
"tts": {
@@ -935,7 +935,6 @@
},
"view_chat_detail": "查看对话详情",
"workflow": {
"dynamic_input": "动态输入",
"Can not delete node": "该节点不允许删除",
"Change input type tip": "修改输入类型会清空已填写的值,请确认!",
"Check Failed": "工作流校验失败,请检查节点是否正确填值,以及连线是否正常",
@@ -966,6 +965,7 @@
"Run result": "运行结果",
"Show result": "展示结果"
},
"dynamic_input": "动态输入",
"inputType": {
"JSON Editor": "JSON 输入框",
"Manual input": "手动输入",

View File

@@ -1,6 +1,7 @@
{
"Array_element": "数组元素",
"Code": "代码",
"Quote_prompt_setting": "引用提示词配置",
"about_xxx_question": "关于 xxx 的问题",
"add_new_input": "新增输入",
"append_application_reply_to_history_as_new_context": "将该应用回复内容拼接到历史记录中,作为新的上下文返回",
@@ -28,6 +29,10 @@
"custom_feedback": "自定义反馈",
"custom_input": "自定义输入",
"custom_plugin_output": "自定义插件输出",
"dataset_quote_role": "角色",
"dataset_quote_role_system_option_desc": "历史记录连贯优先(推荐)",
"dataset_quote_role_tip": "设置为 System 时,将会把知识库引用内容放置到 system 消息中,可以确保历史记录的连贯性,但约束效果可能不佳,需要多调试。\n设置为 User 时,将会把知识库引用内容放置到 user 消息中,并且需要指定 {{question}} 变量位置。会对历史记录连贯性有一定影响,但通常约束效果更优。",
"dataset_quote_role_user_option_desc": "强约束优先",
"delete_api": "确认删除该API密钥删除后该密钥立即失效对应的对话日志不会删除请确认",
"dynamic_input_description": "接收前方节点的输出值作为变量,这些变量可以被 Laf 请求参数使用。",
"dynamic_input_description_concat": "可以引用其他节点的输出,作为文本拼接的变量,输入 / 唤起变量列表",
@@ -116,7 +121,12 @@
"plugin_input": "插件输入",
"question_classification": "问题分类",
"question_optimization": "问题优化",
"quote_content_placeholder": "可以自定义引用内容的结构,以更好的适配不同场景。可以使用一些变量来进行模板配置\n{{q}} - 主要内容\n{{a}} - 辅助数据\n{{source}} - 来源名\n{{sourceId}} - 来源ID\n{{index}} - 第 n 个引用",
"quote_content_tip": "可以自定义引用内容的结构,以更好的适配不同场景。可以使用一些变量来进行模板配置\n{{q}} - 主要内容\n{{a}} - 辅助数据\n{{source}} - 来源名\n{{sourceId}} - 来源ID\n{{index}} - 第 n 个引用\n他们都是可选的下面是默认值\n{{default}}",
"quote_num": "引用{{num}}",
"quote_prompt_tip": "可以用 {{quote}} 来插入引用内容模板,使用 {{question}} 来插入问题(Role=user)。\n下面是默认值\n{{default}}",
"quote_role_system_tip": "请注意从“引用模板提示词”中移除 {{question}} 变量",
"quote_role_user_tip": "请注意在“引用模板提示词”中添加 {{question}} 变量",
"raw_response": "原始响应",
"regex": "正则",
"reply_text": "回复的文本",