Skip to content

Commit

Permalink
feat: node version (#1484)
Browse files Browse the repository at this point in the history
* feat: node version tip

* fix

* i18n

* init version

* fix ts

* fix ts

* fix ts
  • Loading branch information
newfish-cmyk authored May 14, 2024
1 parent b779e28 commit fb04889
Show file tree
Hide file tree
Showing 37 changed files with 185 additions and 20 deletions.
1 change: 1 addition & 0 deletions packages/global/core/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const appWorkflow2Form = ({ nodes }: { nodes: StoreNodeItemType[] }) => {
intro: node.intro || '',
flowNodeType: node.flowNodeType,
showStatus: node.showStatus,
version: '481',
inputs: node.inputs,
outputs: node.outputs,
templateType: FlowNodeTemplateTypeEnum.other
Expand Down
3 changes: 3 additions & 0 deletions packages/global/core/plugin/httpPlugin/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export const httpApiSchema2Plugins = async ({
x: 616.4226348688949,
y: -165.05298493910115
},
version: PluginInputModule.version,
inputs: pluginInputs,
outputs: pluginOutputs
},
Expand All @@ -296,6 +297,7 @@ export const httpApiSchema2Plugins = async ({
x: 1607.7142331269126,
y: -151.8669210746189
},
version: PluginOutputModule.version,
inputs: [
{
key: pluginOutputKey,
Expand Down Expand Up @@ -334,6 +336,7 @@ export const httpApiSchema2Plugins = async ({
x: 1042.549746602742,
y: -447.77496332641647
},
version: HttpModule468.version,
inputs: [
{
key: NodeInputKeyEnum.addInputParam,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/aiChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const AiChatModule: FlowNodeTemplateType = {
intro: 'AI 大模型对话',
showStatus: true,
isTool: true,
version: '481',
inputs: [
Input_Template_SettingAiModel,
// --- settings modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const AssignedAnswerModule: FlowNodeTemplateType = {
name: '指定回复',
intro:
'该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。',
version: '481',
inputs: [
{
key: NodeInputKeyEnum.answerText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const ClassifyQuestionModule: FlowNodeTemplateType = {
name: '问题分类',
intro: `根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品“使用”问题\n类型3: 关于商品“购买”问题\n类型4: 其他问题`,
showStatus: true,
version: '481',
inputs: [
{
...Input_Template_SelectAIModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const ContextExtractModule: FlowNodeTemplateType = {
intro: '可从文本中提取指定的数据,例如:sql语句、搜索关键词、代码等',
showStatus: true,
isTool: true,
version: '481',
inputs: [
{
...Input_Template_SelectAIModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const DatasetConcatModule: FlowNodeTemplateType = {
name: '知识库搜索引用合并',
intro: '可以将多个知识库搜索结果进行合并输出。使用 RRF 的合并方式进行最终排序输出。',
showStatus: false,
version: '481',
inputs: [
{
key: NodeInputKeyEnum.datasetMaxTokens,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
intro: Dataset_SEARCH_DESC,
showStatus: true,
isTool: true,
version: '481',
inputs: [
{
key: NodeInputKeyEnum.datasetSelectList,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/emptyNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const EmptyNode: FlowNodeTemplateType = {
avatar: '',
name: '',
intro: '',
version: '481',
inputs: [],
outputs: []
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const getGlobalVariableNode = ({
avatar: '/imgs/workflow/variable.png',
name: '全局变量',
intro: '',
version: '481',
inputs: [],
outputs: variables.map((item) => ({
id: item.key,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/http468.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const HttpModule468: FlowNodeTemplateType = {
intro: '可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)',
showStatus: true,
isTool: true,
version: '481',
inputs: [
{
...Input_Template_DynamicInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const IfElseNode: FlowNodeTemplateType = {
name: '判断器',
intro: '根据一定的条件,执行不同的分支。',
showStatus: true,
version: '481',
inputs: [
{
key: NodeInputKeyEnum.ifElseList,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/laf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const LafModule: FlowNodeTemplateType = {
intro: '可以调用Laf账号下的云函数。',
showStatus: true,
isTool: true,
version: '481',
inputs: [
{
...Input_Template_DynamicInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const PluginInputModule: FlowNodeTemplateType = {
name: '自定义插件输入',
intro: '自定义配置外部输入,使用插件时,仅暴露自定义配置的输入',
showStatus: false,
version: '481',
inputs: [],
outputs: []
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const PluginOutputModule: FlowNodeTemplateType = {
name: '自定义插件输出',
intro: '自定义配置外部输出,使用插件时,仅暴露自定义配置的输出',
showStatus: false,
version: '481',
inputs: [],
outputs: []
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const AiQueryExtension: FlowNodeTemplateType = {
intro:
'使用问题优化功能,可以提高知识库连续对话时搜索的精度。使用该功能后,会先利用 AI 根据上下文构建一个或多个新的检索词,这些检索词更利于进行知识库搜索。该模块已内置在知识库搜索模块中,如果您仅进行一次知识库搜索,可直接使用知识库内置的补全功能。',
showStatus: true,
version: '481',
inputs: [
{
...Input_Template_SelectAIModel,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/runApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const RunAppModule: FlowNodeTemplateType = {
name: '应用调用',
intro: '可以选择一个其他应用进行调用',
showStatus: true,
version: '481',
inputs: [
{
key: NodeInputKeyEnum.runAppSelectApp,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/runPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const RunPluginModule: FlowNodeTemplateType = {
name: '',
showStatus: false,
isTool: true,
version: '481',
inputs: [], // [{key:'pluginId'},...]
outputs: []
};
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/stopTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const StopToolNode: FlowNodeTemplateType = {
name: '工具调用终止',
intro:
'该模块需配置工具调用使用。当该模块被执行时,本次工具调用将会强制结束,并且不再调用AI针对工具调用结果回答问题。',
version: '481',
inputs: [],
outputs: []
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const SystemConfigNode: FlowNodeTemplateType = {
intro: '可以配置应用的系统参数。',
unique: true,
forbidDelete: true,
version: '481',
inputs: [
{
key: NodeInputKeyEnum.welcomeText,
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/template/system/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const ToolModule: FlowNodeTemplateType = {
name: '工具调用(实验)',
intro: '通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。',
showStatus: true,
version: '481',
inputs: [
{
...Input_Template_SettingAiModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const VariableUpdateNode: FlowNodeTemplateType = {
intro: '可以更新指定节点的输出值或更新全局变量',
showStatus: true,
isTool: false,
version: '481',
inputs: [
{
key: NodeInputKeyEnum.updateList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const WorkflowStart: FlowNodeTemplateType = {
intro: '',
forbidDelete: true,
unique: true,
version: '481',
inputs: [{ ...Input_Template_UserChatInput, toolDescription: '用户问题' }],
outputs: [
{
Expand Down
1 change: 1 addition & 0 deletions packages/global/core/workflow/type/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type FlowNodeCommonType = {
name: string;
intro?: string; // template list intro
showStatus?: boolean; // chatting response step status
version: string;

// data
inputs: FlowNodeInputItemType[];
Expand Down
1 change: 1 addition & 0 deletions packages/service/core/plugin/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export async function getPluginPreviewNode({ id }: { id: string }): Promise<Flow
intro: plugin.intro,
showStatus: plugin.showStatus,
isTool: plugin.isTool,
version: '481',
sourceHandle: getHandleConfig(true, true, true, true),
targetHandle: getHandleConfig(true, true, true, true),
...pluginData2FlowNodeIO(plugin.nodes)
Expand Down
13 changes: 13 additions & 0 deletions packages/web/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,19 @@ export const theme = extendTheme({
800: '#05603A',
900: '#054F31'
},
yellow: {
25: '#FFFDFA',
50: '#FFFAEB',
100: '#FEF0C7',
200: '#FEDF89',
300: '#F5C149',
400: '#FDB022',
500: '#F79009',
600: '#DC6803',
700: '#B54708',
800: '#93370D',
900: '#7A2E0E'
},
borderColor: {
low: '#E8EBF0',
base: '#DFE2EA',
Expand Down
6 changes: 6 additions & 0 deletions projects/app/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"To Chat": "Go to Chat",
"To Settings": "View Details",
"Variable Key Repeat Tip": "Variable key is duplicate",
"app": {
"modules": {
"click to update": "click to update",
"has new version": "has new version"
}
},
"module": {
"Combine Modules": "Combine Modules",
"Custom Title Tip": "This title will be displayed during the conversation",
Expand Down
6 changes: 6 additions & 0 deletions projects/app/i18n/zh/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
"To Chat": "前去对话",
"To Settings": "查看详情",
"Variable Key Repeat Tip": "变量 key 重复",
"app": {
"modules": {
"click to update": "点击更新",
"has new version": "有新版本"
}
},
"module": {
"Combine Modules": "组合模块",
"Custom Title Tip": "该标题名字会展示在对话过程中",
Expand Down
Loading

0 comments on commit fb04889

Please sign in to comment.