V4.8.17 feature (#3485)
* feat: add third party account config (#3443) * temp * editor workflow variable style * add team to dispatch * i18n * delete console * change openai account position * fix * fix * fix * fix * fix * 4.8.17 test (#3461) * perf: external provider config * perf: ui * feat: add template config (#3434) * change template position * template config * delete console * delete * fix * fix * perf: Mongo visutal field (#3464) * remve invalid code * perf: team member visutal code * perf: virtual search; perf: search test data * fix: ts * fix: image response headers * perf: template code * perf: auth layout;perf: auto save (#3472) * perf: auth layout * perf: auto save * perf: auto save * fix: template guide display & http input support external variables (#3475) * fix: template guide display * http editor support external workflow variables * perf: auto save;fix: ifelse checker line break; (#3478) * perf: auto save * perf: auto save * fix: ifelse checker line break * perf: doc * perf: doc * fix: update var type error * 4.8.17 test (#3479) * perf: auto save * perf: auto save * perf: template code * 4.8.17 test (#3480) * perf: auto save * perf: auto save * perf: model price model * feat: add react memo * perf: model provider filter * fix: ts (#3481) * perf: auto save * perf: auto save * fix: ts * simple app tool select (#3473) * workflow plugin userguide & simple tool ui * simple tool filter * reuse component * change component to hook * fix * perf: too selector modal (#3484) * perf: auto save * perf: auto save * perf: markdown render * perf: too selector * fix: app version require tmbId * perf: templates refresh * perf: templates refresh * hide auto save error tip * perf: toolkit guide --------- Co-authored-by: heheer <heheer@sealos.io>
@@ -18,6 +18,14 @@ export type NavbarItemType = {
|
||||
isActive: boolean;
|
||||
};
|
||||
|
||||
export type ExternalProviderWorkflowVarType = {
|
||||
name: string;
|
||||
key: string;
|
||||
intro: string;
|
||||
isOpen: boolean;
|
||||
url?: string;
|
||||
};
|
||||
|
||||
/* fastgpt main */
|
||||
export type FastGPTConfigFileType = {
|
||||
feConfigs: FastGPTFeConfigsType;
|
||||
@@ -84,6 +92,7 @@ export type FastGPTFeConfigsType = {
|
||||
uploadFileMaxSize?: number;
|
||||
lafEnv?: string;
|
||||
navbarItems?: NavbarItemType[];
|
||||
externalProviderWorkflowVariables?: ExternalProviderWorkflowVarType[];
|
||||
};
|
||||
|
||||
export type SystemEnvType = {
|
||||
|
||||
26
packages/global/core/app/type.d.ts
vendored
@@ -13,6 +13,7 @@ import { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import { AppPermission } from '../../support/permission/app/controller';
|
||||
import { ParentIdType } from '../../common/parentFolder/type';
|
||||
import { FlowNodeInputTypeEnum } from 'core/workflow/node/constant';
|
||||
import { WorkflowTemplateBasicType } from '@fastgpt/global/core/workflow/type';
|
||||
|
||||
export type AppSchema = {
|
||||
_id: string;
|
||||
@@ -184,3 +185,28 @@ export type SystemPluginListItemType = {
|
||||
name: string;
|
||||
avatar: string;
|
||||
};
|
||||
|
||||
export type AppTemplateSchemaType = {
|
||||
templateId: string;
|
||||
name: string;
|
||||
intro: string;
|
||||
avatar: string;
|
||||
tags: string[];
|
||||
type: string;
|
||||
author?: string;
|
||||
isActive?: boolean;
|
||||
userGuide?: {
|
||||
type: 'markdown' | 'link';
|
||||
content?: string;
|
||||
link?: string;
|
||||
};
|
||||
isQuickTemplate?: boolean;
|
||||
order?: number;
|
||||
workflow: WorkflowTemplateBasicType;
|
||||
};
|
||||
|
||||
export type TemplateTypeSchemaType = {
|
||||
typeName: string;
|
||||
typeId: string;
|
||||
typeOrder: number;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { DatasetCollectionTypeEnum, TrainingModeEnum, TrainingTypeMap } from '../constants';
|
||||
import { CollectionWithDatasetType, DatasetCollectionSchemaType } from '../type';
|
||||
import { DatasetCollectionSchemaType } from '../type';
|
||||
|
||||
export const getCollectionSourceData = (
|
||||
collection?: CollectionWithDatasetType | DatasetCollectionSchemaType
|
||||
) => {
|
||||
export const getCollectionSourceData = (collection?: DatasetCollectionSchemaType) => {
|
||||
return {
|
||||
sourceId:
|
||||
collection?.fileId ||
|
||||
|
||||
7
packages/global/core/dataset/type.d.ts
vendored
@@ -133,11 +133,8 @@ export type DatasetTrainingSchemaType = {
|
||||
indexes: Omit<DatasetDataIndexItemType, 'dataId'>[];
|
||||
};
|
||||
|
||||
export type CollectionWithDatasetType = Omit<DatasetCollectionSchemaType, 'datasetId'> & {
|
||||
datasetId: DatasetSchemaType;
|
||||
};
|
||||
export type DatasetDataWithCollectionType = Omit<DatasetDataSchemaType, 'collectionId'> & {
|
||||
collectionId: DatasetCollectionSchemaType;
|
||||
export type CollectionWithDatasetType = DatasetCollectionSchemaType & {
|
||||
dataset: DatasetSchemaType;
|
||||
};
|
||||
|
||||
/* ================= dataset ===================== */
|
||||
|
||||
@@ -21,13 +21,20 @@ import { ReadFileNodeResponse } from '../template/system/readFiles/type';
|
||||
import { UserSelectOptionType } from '../template/system/userSelect/type';
|
||||
import { WorkflowResponseType } from '../../../../service/core/workflow/dispatch/type';
|
||||
import { AiChatQuoteRoleType } from '../template/system/aiChat/type';
|
||||
import { LafAccountType, OpenaiAccountType } from '../../../support/user/team/type';
|
||||
|
||||
export type ExternalProviderType = {
|
||||
openaiAccount?: OpenaiAccountType;
|
||||
externalWorkflowVariables?: Record<string, string>;
|
||||
};
|
||||
|
||||
/* workflow props */
|
||||
export type ChatDispatchProps = {
|
||||
res?: NextApiResponse;
|
||||
requestOrigin?: string;
|
||||
mode: 'test' | 'chat' | 'debug';
|
||||
user: UserModelSchema;
|
||||
timezone: string;
|
||||
externalProvider: ExternalProviderType;
|
||||
|
||||
runningAppInfo: {
|
||||
id: string; // May be the id of the system plug-in (cannot be used directly to look up the table)
|
||||
|
||||
@@ -9,6 +9,7 @@ import { isValidReferenceValueFormat } from '../utils';
|
||||
import { FlowNodeOutputItemType, ReferenceValueType } from '../type/io';
|
||||
import { ChatItemType, NodeOutputItemType } from '../../../core/chat/type';
|
||||
import { ChatItemValueTypeEnum, ChatRoleEnum } from '../../../core/chat/constants';
|
||||
import { replaceVariable } from '../../../common/string/tools';
|
||||
|
||||
export const getMaxHistoryLimitFromNodes = (nodes: StoreNodeItemType[]): number => {
|
||||
let limit = 10;
|
||||
@@ -317,6 +318,8 @@ export function replaceEditorVariable({
|
||||
}) {
|
||||
if (typeof text !== 'string') return text;
|
||||
|
||||
text = replaceVariable(text, variables);
|
||||
|
||||
const variablePattern = /\{\{\$([^.]+)\.([^$]+)\$\}\}/g;
|
||||
const matches = [...text.matchAll(variablePattern)];
|
||||
if (matches.length === 0) return text;
|
||||
|
||||
@@ -30,7 +30,6 @@ export const WorkflowStart: FlowNodeTemplateType = {
|
||||
intro: '',
|
||||
forbidDelete: true,
|
||||
unique: true,
|
||||
courseUrl: '/docs/guide/workbench/workflow/input/',
|
||||
version: '481',
|
||||
inputs: [{ ...Input_Template_UserChatInput, toolDescription: i18nT('workflow:user_question') }],
|
||||
outputs: [
|
||||
|
||||
2
packages/global/core/workflow/type/node.d.ts
vendored
@@ -69,6 +69,7 @@ export type FlowNodeTemplateType = FlowNodeCommonType & {
|
||||
|
||||
diagram?: string; // diagram url
|
||||
courseUrl?: string; // course url
|
||||
userGuide?: string; // user guide
|
||||
};
|
||||
|
||||
export type NodeTemplateListItemType = {
|
||||
@@ -87,6 +88,7 @@ export type NodeTemplateListItemType = {
|
||||
currentCost?: number; // 当前积分消耗
|
||||
hasTokenFee?: boolean; // 是否配置积分
|
||||
instructions?: string; // 使用说明
|
||||
courseUrl?: string; // 教程链接
|
||||
};
|
||||
|
||||
export type NodeTemplateListType = {
|
||||
|
||||
5
packages/global/support/outLink/type.d.ts
vendored
@@ -83,11 +83,6 @@ export type OutLinkSchema<T extends OutlinkAppType = undefined> = {
|
||||
app: T;
|
||||
};
|
||||
|
||||
// to handle MongoDB querying
|
||||
export type OutLinkWithAppType = Omit<OutLinkSchema, 'appId'> & {
|
||||
appId: AppSchema;
|
||||
};
|
||||
|
||||
// Edit the Outlink
|
||||
export type OutLinkEditType<T = undefined> = {
|
||||
_id?: string;
|
||||
|
||||
9
packages/global/support/permission/type.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import { UserModelSchema } from '../user/type';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
import { TeamMemberWithUserSchema } from '../user/team/type';
|
||||
import { TeamMemberSchema } from '../user/team/type';
|
||||
import { AuthUserTypeEnum, PermissionKeyEnum, PerResourceTypeEnum } from './constant';
|
||||
import { MemberGroupSchemaType } from './memberGroup/type';
|
||||
|
||||
@@ -31,11 +32,7 @@ export type ResourcePermissionType = {
|
||||
}>;
|
||||
|
||||
export type ResourcePerWithTmbWithUser = Omit<ResourcePermissionType, 'tmbId'> & {
|
||||
tmbId: TeamMemberWithUserSchema;
|
||||
};
|
||||
|
||||
export type ResourcePerWithGroup = Omit<ResourcePermissionType, 'groupId'> & {
|
||||
groupId: MemberGroupSchemaType;
|
||||
tmbId: TeamMemberSchema & { user: UserModelSchema };
|
||||
};
|
||||
|
||||
export type PermissionSchemaType = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PermissionValueType } from '../../permission/type';
|
||||
import { TeamMemberRoleEnum } from './constant';
|
||||
import { LafAccountType, TeamMemberSchema } from './type';
|
||||
import { LafAccountType, TeamMemberSchema, ThirdPartyAccountType } from './type';
|
||||
|
||||
export type AuthTeamRoleProps = {
|
||||
teamId: string;
|
||||
@@ -11,14 +11,13 @@ export type CreateTeamProps = {
|
||||
name: string;
|
||||
avatar?: string;
|
||||
defaultTeam?: boolean;
|
||||
lafAccount?: LafAccountType;
|
||||
memberName?: string;
|
||||
};
|
||||
export type UpdateTeamProps = {
|
||||
export type UpdateTeamProps = Omit<ThirdPartyAccountType, 'externalWorkflowVariable'> & {
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
teamDomain?: string;
|
||||
lafAccount?: null | LafAccountType;
|
||||
externalWorkflowVariable?: { key: string; value: string };
|
||||
};
|
||||
|
||||
/* ------------- member ----------- */
|
||||
|
||||
32
packages/global/support/user/team/type.d.ts
vendored
@@ -4,6 +4,12 @@ import { LafAccountType } from './type';
|
||||
import { PermissionValueType, ResourcePermissionType } from '../../permission/type';
|
||||
import { TeamPermission } from '../../permission/user/controller';
|
||||
|
||||
export type ThirdPartyAccountType = {
|
||||
lafAccount?: LafAccountType;
|
||||
openaiAccount?: OpenaiAccountType;
|
||||
externalWorkflowVariables?: Record<string, string>;
|
||||
};
|
||||
|
||||
export type TeamSchema = {
|
||||
_id: string;
|
||||
name: string;
|
||||
@@ -16,9 +22,8 @@ export type TeamSchema = {
|
||||
lastExportDatasetTime: Date;
|
||||
lastWebsiteSyncTime: Date;
|
||||
};
|
||||
lafAccount: LafAccountType;
|
||||
notificationAccount?: string;
|
||||
};
|
||||
} & ThirdPartyAccountType;
|
||||
|
||||
export type tagsType = {
|
||||
label: string;
|
||||
@@ -42,16 +47,9 @@ export type TeamMemberSchema = {
|
||||
defaultTeam: boolean;
|
||||
};
|
||||
|
||||
export type TeamMemberWithUserSchema = Omit<TeamMemberSchema, 'userId'> & {
|
||||
userId: UserModelSchema;
|
||||
};
|
||||
|
||||
export type TeamMemberWithTeamSchema = Omit<TeamMemberSchema, 'teamId'> & {
|
||||
teamId: TeamSchema;
|
||||
};
|
||||
|
||||
export type TeamMemberWithTeamAndUserSchema = Omit<TeamMemberWithTeamSchema, 'userId'> & {
|
||||
userId: UserModelSchema;
|
||||
export type TeamMemberWithTeamAndUserSchema = TeamMemberSchema & {
|
||||
team: TeamSchema;
|
||||
user: UserModelSchema;
|
||||
};
|
||||
|
||||
export type TeamTmbItemType = {
|
||||
@@ -66,10 +64,9 @@ export type TeamTmbItemType = {
|
||||
defaultTeam: boolean;
|
||||
role: `${TeamMemberRoleEnum}`;
|
||||
status: `${TeamMemberStatusEnum}`;
|
||||
lafAccount?: LafAccountType;
|
||||
notificationAccount?: string;
|
||||
permission: TeamPermission;
|
||||
};
|
||||
} & ThirdPartyAccountType;
|
||||
|
||||
export type TeamMemberItemType = {
|
||||
userId: string;
|
||||
@@ -88,11 +85,16 @@ export type TeamTagItemType = {
|
||||
};
|
||||
|
||||
export type LafAccountType = {
|
||||
token: string;
|
||||
appid: string;
|
||||
token: string;
|
||||
pat: string;
|
||||
};
|
||||
|
||||
export type OpenaiAccountType = {
|
||||
key: string;
|
||||
baseUrl: string;
|
||||
};
|
||||
|
||||
export type TeamInvoiceHeaderType = {
|
||||
teamName: string;
|
||||
unifiedCreditCode: string;
|
||||
|
||||
5
packages/global/support/user/type.d.ts
vendored
@@ -14,10 +14,6 @@ export type UserModelSchema = {
|
||||
timezone: string;
|
||||
status: `${UserStatusEnum}`;
|
||||
lastLoginTmbId?: string;
|
||||
openaiAccount?: {
|
||||
key: string;
|
||||
baseUrl: string;
|
||||
};
|
||||
fastgpt_sem?: {
|
||||
keyword: string;
|
||||
};
|
||||
@@ -29,7 +25,6 @@ export type UserType = {
|
||||
avatar: string;
|
||||
timezone: string;
|
||||
promotionRate: UserModelSchema['promotionRate'];
|
||||
openaiAccount: UserModelSchema['openaiAccount'];
|
||||
team: TeamTmbItemType;
|
||||
standardInfo?: standardInfoType;
|
||||
notificationAccount?: string;
|
||||
|
||||
@@ -55,8 +55,7 @@
|
||||
"maxFiles": 5,
|
||||
"canSelectFile": true,
|
||||
"canSelectImg": true,
|
||||
"required": true,
|
||||
"toolDescription": "部署的searXNG服务的链接"
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { UserModelSchema } from '@fastgpt/global/support/user/type';
|
||||
import OpenAI from '@fastgpt/global/core/ai';
|
||||
import {
|
||||
ChatCompletionCreateParamsNonStreaming,
|
||||
@@ -7,13 +6,11 @@ import {
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
import { addLog } from '../../common/system/log';
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
import { OpenaiAccountType } from '@fastgpt/global/support/user/team/type';
|
||||
|
||||
export const openaiBaseUrl = process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1';
|
||||
|
||||
export const getAIApi = (props?: {
|
||||
userKey?: UserModelSchema['openaiAccount'];
|
||||
timeout?: number;
|
||||
}) => {
|
||||
export const getAIApi = (props?: { userKey?: OpenaiAccountType; timeout?: number }) => {
|
||||
const { userKey, timeout } = props || {};
|
||||
|
||||
const baseUrl =
|
||||
@@ -29,7 +26,7 @@ export const getAIApi = (props?: {
|
||||
});
|
||||
};
|
||||
|
||||
export const getAxiosConfig = (props?: { userKey?: UserModelSchema['openaiAccount'] }) => {
|
||||
export const getAxiosConfig = (props?: { userKey?: OpenaiAccountType }) => {
|
||||
const { userKey } = props || {};
|
||||
|
||||
const baseUrl =
|
||||
@@ -57,7 +54,7 @@ export const createChatCompletion = async <T extends CompletionsBodyType>({
|
||||
options
|
||||
}: {
|
||||
body: T;
|
||||
userKey?: UserModelSchema['openaiAccount'];
|
||||
userKey?: OpenaiAccountType;
|
||||
timeout?: number;
|
||||
options?: OpenAI.RequestOptions;
|
||||
}): Promise<{
|
||||
|
||||
@@ -131,6 +131,7 @@ export async function getChildAppPreviewNode({
|
||||
name: app.name,
|
||||
intro: app.intro,
|
||||
courseUrl: app.courseUrl,
|
||||
userGuide: app.userGuide,
|
||||
showStatus: app.showStatus,
|
||||
isTool: true,
|
||||
version: app.version,
|
||||
|
||||
51
packages/service/core/app/templates/templateSchema.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { AppTemplateSchemaType } from '@fastgpt/global/core/app/type';
|
||||
import { connectionMongo, getMongoModel } from '../../../common/mongo/index';
|
||||
const { Schema } = connectionMongo;
|
||||
|
||||
export const collectionName = 'app_templates';
|
||||
|
||||
const AppTemplateSchema = new Schema({
|
||||
templateId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
type: String
|
||||
},
|
||||
intro: {
|
||||
type: String
|
||||
},
|
||||
avatar: {
|
||||
type: String
|
||||
},
|
||||
tags: {
|
||||
type: [String],
|
||||
default: undefined
|
||||
},
|
||||
type: {
|
||||
type: String
|
||||
},
|
||||
isActive: {
|
||||
type: Boolean
|
||||
},
|
||||
userGuide: {
|
||||
type: Object
|
||||
},
|
||||
isQuickTemplate: {
|
||||
type: Boolean
|
||||
},
|
||||
order: {
|
||||
type: Number,
|
||||
default: -1
|
||||
},
|
||||
workflow: {
|
||||
type: Object
|
||||
}
|
||||
});
|
||||
|
||||
AppTemplateSchema.index({ templateId: 1 });
|
||||
|
||||
export const MongoAppTemplate = getMongoModel<AppTemplateSchemaType>(
|
||||
collectionName,
|
||||
AppTemplateSchema
|
||||
);
|
||||
25
packages/service/core/app/templates/templateTypeSchema.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { TemplateTypeSchemaType } from '@fastgpt/global/core/app/type';
|
||||
import { connectionMongo, getMongoModel } from '../../../common/mongo/index';
|
||||
const { Schema } = connectionMongo;
|
||||
|
||||
export const collectionName = 'app_template_types';
|
||||
|
||||
const TemplateTypeSchema = new Schema({
|
||||
typeName: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
typeId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
typeOrder: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
});
|
||||
|
||||
export const MongoTemplateTypes = getMongoModel<TemplateTypeSchemaType>(
|
||||
collectionName,
|
||||
TemplateTypeSchema
|
||||
);
|
||||
@@ -2,10 +2,16 @@ import { connectionMongo, getMongoModel, type Model } from '../../../common/mong
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import { AppVersionSchemaType } from '@fastgpt/global/core/app/version';
|
||||
import { chatConfigType } from '../schema';
|
||||
import { TeamMemberCollectionName } from '@fastgpt/global/support/user/team/constant';
|
||||
|
||||
export const AppVersionCollectionName = 'app_versions';
|
||||
|
||||
const AppVersionSchema = new Schema({
|
||||
tmbId: {
|
||||
type: String,
|
||||
ref: TeamMemberCollectionName,
|
||||
required: true
|
||||
},
|
||||
appId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: AppVersionCollectionName,
|
||||
@@ -26,16 +32,8 @@ const AppVersionSchema = new Schema({
|
||||
chatConfig: {
|
||||
type: chatConfigType
|
||||
},
|
||||
isPublish: {
|
||||
type: Boolean
|
||||
},
|
||||
versionName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
tmbId: {
|
||||
type: String
|
||||
}
|
||||
isPublish: Boolean,
|
||||
versionName: String
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
@@ -104,9 +104,6 @@ export const loadRequestMessages = async ({
|
||||
}) => {
|
||||
// Load image to base64
|
||||
const loadImageToBase64 = async (messages: ChatCompletionContentPart[]) => {
|
||||
if (process.env.MULTIPLE_DATA_TO_BASE64 === 'false') {
|
||||
return messages;
|
||||
}
|
||||
return Promise.all(
|
||||
messages.map(async (item) => {
|
||||
if (item.type === 'image_url') {
|
||||
@@ -125,7 +122,7 @@ export const loadRequestMessages = async ({
|
||||
|
||||
try {
|
||||
// If imgUrl is a local path, load image from local, and set url to base64
|
||||
if (imgUrl.startsWith('/')) {
|
||||
if (imgUrl.startsWith('/') || process.env.MULTIPLE_DATA_TO_BASE64 === 'true') {
|
||||
addLog.debug('Load image from local server', {
|
||||
baseUrl: serverRequestBaseUrl,
|
||||
requestUrl: imgUrl
|
||||
|
||||
@@ -4,11 +4,7 @@ import {
|
||||
} from '@fastgpt/global/core/dataset/constants';
|
||||
import type { CreateDatasetCollectionParams } from '@fastgpt/global/core/dataset/api.d';
|
||||
import { MongoDatasetCollection } from './schema';
|
||||
import {
|
||||
CollectionWithDatasetType,
|
||||
DatasetCollectionSchemaType,
|
||||
DatasetSchemaType
|
||||
} from '@fastgpt/global/core/dataset/type';
|
||||
import { DatasetCollectionSchemaType, DatasetSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
import { MongoDatasetTraining } from '../training/schema';
|
||||
import { MongoDatasetData } from '../data/schema';
|
||||
import { delImgByRelatedId } from '../../../common/file/image/controller';
|
||||
@@ -230,7 +226,7 @@ export const delCollectionRelatedSource = async ({
|
||||
collections,
|
||||
session
|
||||
}: {
|
||||
collections: (CollectionWithDatasetType | DatasetCollectionSchemaType)[];
|
||||
collections: DatasetCollectionSchemaType[];
|
||||
session: ClientSession;
|
||||
}) => {
|
||||
if (collections.length === 0) return;
|
||||
@@ -264,7 +260,7 @@ export async function delCollection({
|
||||
session,
|
||||
delRelatedSource
|
||||
}: {
|
||||
collections: (CollectionWithDatasetType | DatasetCollectionSchemaType)[];
|
||||
collections: DatasetCollectionSchemaType[];
|
||||
session: ClientSession;
|
||||
delRelatedSource: boolean;
|
||||
}) {
|
||||
@@ -274,16 +270,7 @@ export async function delCollection({
|
||||
|
||||
if (!teamId) return Promise.reject('teamId is not exist');
|
||||
|
||||
const datasetIds = Array.from(
|
||||
new Set(
|
||||
collections.map((item) => {
|
||||
if (typeof item.datasetId === 'string') {
|
||||
return String(item.datasetId);
|
||||
}
|
||||
return String(item.datasetId._id);
|
||||
})
|
||||
)
|
||||
);
|
||||
const datasetIds = Array.from(new Set(collections.map((item) => String(item.datasetId))));
|
||||
const collectionIds = collections.map((item) => String(item._id));
|
||||
|
||||
// delete training data
|
||||
@@ -324,7 +311,7 @@ export async function delOnlyCollection({
|
||||
collections,
|
||||
session
|
||||
}: {
|
||||
collections: (CollectionWithDatasetType | DatasetCollectionSchemaType)[];
|
||||
collections: DatasetCollectionSchemaType[];
|
||||
session: ClientSession;
|
||||
}) {
|
||||
if (collections.length === 0) return;
|
||||
@@ -333,16 +320,7 @@ export async function delOnlyCollection({
|
||||
|
||||
if (!teamId) return Promise.reject('teamId is not exist');
|
||||
|
||||
const datasetIds = Array.from(
|
||||
new Set(
|
||||
collections.map((item) => {
|
||||
if (typeof item.datasetId === 'string') {
|
||||
return String(item.datasetId);
|
||||
}
|
||||
return String(item.datasetId._id);
|
||||
})
|
||||
)
|
||||
);
|
||||
const datasetIds = Array.from(new Set(collections.map((item) => String(item.datasetId))));
|
||||
const collectionIds = collections.map((item) => String(item._id));
|
||||
|
||||
// delete training data
|
||||
|
||||
@@ -100,6 +100,13 @@ const DatasetCollectionSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
DatasetCollectionSchema.virtual('dataset', {
|
||||
ref: DatasetCollectionName,
|
||||
localField: 'datasetId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
|
||||
try {
|
||||
// auth file
|
||||
DatasetCollectionSchema.index({ teamId: 1, fileId: 1 });
|
||||
|
||||
@@ -130,7 +130,7 @@ export const collectionTagsToTagLabel = async ({
|
||||
};
|
||||
|
||||
export const syncCollection = async (collection: CollectionWithDatasetType) => {
|
||||
const dataset = collection.datasetId;
|
||||
const dataset = collection.dataset;
|
||||
|
||||
if (
|
||||
collection.type !== DatasetCollectionTypeEnum.link &&
|
||||
@@ -183,7 +183,7 @@ export const syncCollection = async (collection: CollectionWithDatasetType) => {
|
||||
teamId: collection.teamId,
|
||||
tmbId: collection.tmbId,
|
||||
name: collection.name,
|
||||
datasetId: collection.datasetId._id,
|
||||
datasetId: collection.datasetId,
|
||||
parentId: collection.parentId,
|
||||
type: collection.type,
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CollectionWithDatasetType, DatasetSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
import { DatasetSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||
import { MongoDatasetCollection } from './collection/schema';
|
||||
import { MongoDataset } from './schema';
|
||||
import { delCollectionRelatedSource } from './collection/controller';
|
||||
@@ -49,9 +49,9 @@ export async function findDatasetAndAllChildren({
|
||||
}
|
||||
|
||||
export async function getCollectionWithDataset(collectionId: string) {
|
||||
const data = (await MongoDatasetCollection.findById(collectionId)
|
||||
.populate('datasetId')
|
||||
.lean()) as CollectionWithDatasetType;
|
||||
const data = await MongoDatasetCollection.findById(collectionId)
|
||||
.populate<{ dataset: DatasetSchemaType }>('dataset')
|
||||
.lean();
|
||||
if (!data) {
|
||||
return Promise.reject('Collection is not exist');
|
||||
}
|
||||
|
||||
@@ -77,21 +77,32 @@ const DatasetDataSchema = new Schema({
|
||||
rebuilding: Boolean
|
||||
});
|
||||
|
||||
// list collection and count data; list data; delete collection(relate data)
|
||||
DatasetDataSchema.index({
|
||||
teamId: 1,
|
||||
datasetId: 1,
|
||||
collectionId: 1,
|
||||
chunkIndex: 1,
|
||||
updateTime: -1
|
||||
DatasetDataSchema.virtual('collection', {
|
||||
ref: DatasetColCollectionName,
|
||||
localField: 'collectionId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
// full text index
|
||||
DatasetDataSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
|
||||
// Recall vectors after data matching
|
||||
DatasetDataSchema.index({ teamId: 1, datasetId: 1, collectionId: 1, 'indexes.dataId': 1 });
|
||||
DatasetDataSchema.index({ updateTime: 1 });
|
||||
// rebuild data
|
||||
DatasetDataSchema.index({ rebuilding: 1, teamId: 1, datasetId: 1 });
|
||||
|
||||
try {
|
||||
// list collection and count data; list data; delete collection(relate data)
|
||||
DatasetDataSchema.index({
|
||||
teamId: 1,
|
||||
datasetId: 1,
|
||||
collectionId: 1,
|
||||
chunkIndex: 1,
|
||||
updateTime: -1
|
||||
});
|
||||
// full text index
|
||||
DatasetDataSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' });
|
||||
// Recall vectors after data matching
|
||||
DatasetDataSchema.index({ teamId: 1, datasetId: 1, collectionId: 1, 'indexes.dataId': 1 });
|
||||
DatasetDataSchema.index({ updateTime: 1 });
|
||||
// rebuild data
|
||||
DatasetDataSchema.index({ rebuilding: 1, teamId: 1, datasetId: 1 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export const MongoDatasetData = getMongoModel<DatasetDataSchemaType>(
|
||||
DatasetDataCollectionName,
|
||||
|
||||
@@ -8,8 +8,8 @@ import { getVectorsByText } from '../../ai/embedding';
|
||||
import { getVectorModel } from '../../ai/model';
|
||||
import { MongoDatasetData } from '../data/schema';
|
||||
import {
|
||||
DatasetCollectionSchemaType,
|
||||
DatasetDataSchemaType,
|
||||
DatasetDataWithCollectionType,
|
||||
SearchDataResponseItemType
|
||||
} from '@fastgpt/global/core/dataset/type';
|
||||
import { MongoDatasetCollection } from '../collection/schema';
|
||||
@@ -267,7 +267,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
|
||||
});
|
||||
|
||||
// get q and a
|
||||
const dataList = (await MongoDatasetData.find(
|
||||
const dataList = await MongoDatasetData.find(
|
||||
{
|
||||
teamId,
|
||||
datasetId: { $in: datasetIds },
|
||||
@@ -276,8 +276,11 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
|
||||
},
|
||||
'datasetId collectionId updateTime q a chunkIndex indexes'
|
||||
)
|
||||
.populate('collectionId', 'name fileId rawLink externalFileId externalFileUrl')
|
||||
.lean()) as DatasetDataWithCollectionType[];
|
||||
.populate<{ collection: DatasetCollectionSchemaType }>(
|
||||
'collection',
|
||||
'name fileId rawLink externalFileId externalFileUrl'
|
||||
)
|
||||
.lean();
|
||||
|
||||
// add score to data(It's already sorted. The first one is the one with the most points)
|
||||
const concatResults = dataList.map((data) => {
|
||||
@@ -307,8 +310,8 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
|
||||
a: data.a,
|
||||
chunkIndex: data.chunkIndex,
|
||||
datasetId: String(data.datasetId),
|
||||
collectionId: String(data.collectionId?._id),
|
||||
...getCollectionSourceData(data.collectionId),
|
||||
collectionId: String(data.collectionId),
|
||||
...getCollectionSourceData(data.collection),
|
||||
score: [{ type: SearchScoreTypeEnum.embedding, value: data.score, index }]
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export const pushDataListToTrainingQueueByCollectionId = async ({
|
||||
session?: ClientSession;
|
||||
} & PushDatasetDataProps) => {
|
||||
const {
|
||||
datasetId: { _id: datasetId, agentModel, vectorModel }
|
||||
dataset: { _id: datasetId, agentModel, vectorModel }
|
||||
} = await getCollectionWithDataset(collectionId);
|
||||
return pushDataListToTrainingQueue({
|
||||
...props,
|
||||
|
||||
@@ -35,7 +35,7 @@ type ActionProps = Props & { cqModel: LLMModelItemType };
|
||||
/* request openai chat */
|
||||
export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse> => {
|
||||
const {
|
||||
user,
|
||||
externalProvider,
|
||||
node: { nodeId, name },
|
||||
histories,
|
||||
params: { model, history = 6, agents, userChatInput }
|
||||
@@ -69,7 +69,7 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
.filter((item) => item.key !== result.key)
|
||||
.map((item) => getHandleId(nodeId, 'source', item.key)),
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
query: userChatInput,
|
||||
tokens,
|
||||
@@ -80,7 +80,7 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
[DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [
|
||||
{
|
||||
moduleName: name,
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
}
|
||||
@@ -90,7 +90,7 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
|
||||
const completions = async ({
|
||||
cqModel,
|
||||
user,
|
||||
externalProvider,
|
||||
histories,
|
||||
params: { agents, systemPrompt = '', userChatInput }
|
||||
}: ActionProps) => {
|
||||
@@ -131,7 +131,7 @@ const completions = async ({
|
||||
},
|
||||
cqModel
|
||||
),
|
||||
userKey: user.openaiAccount
|
||||
userKey: externalProvider.openaiAccount
|
||||
});
|
||||
const answer = data.choices?.[0].message?.content || '';
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ const agentFunName = 'request_function';
|
||||
|
||||
export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
const {
|
||||
user,
|
||||
externalProvider,
|
||||
node: { name },
|
||||
histories,
|
||||
params: { content, history = 6, model, description, extractKeys }
|
||||
@@ -123,7 +123,7 @@ export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
[NodeOutputKeyEnum.contextExtractFields]: JSON.stringify(arg),
|
||||
...arg,
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
query: content,
|
||||
tokens,
|
||||
@@ -134,7 +134,7 @@ export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
[DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [
|
||||
{
|
||||
moduleName: name,
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
}
|
||||
@@ -211,7 +211,7 @@ ${description ? `- ${description}` : ''}
|
||||
};
|
||||
|
||||
const toolChoice = async (props: ActionProps) => {
|
||||
const { user, extractModel } = props;
|
||||
const { externalProvider, extractModel } = props;
|
||||
|
||||
const { filterMessages, agentFunction } = await getFunctionCallSchema(props);
|
||||
|
||||
@@ -233,7 +233,7 @@ const toolChoice = async (props: ActionProps) => {
|
||||
},
|
||||
extractModel
|
||||
),
|
||||
userKey: user.openaiAccount
|
||||
userKey: externalProvider.openaiAccount
|
||||
});
|
||||
|
||||
const arg: Record<string, any> = (() => {
|
||||
@@ -263,7 +263,7 @@ const toolChoice = async (props: ActionProps) => {
|
||||
};
|
||||
|
||||
const functionCall = async (props: ActionProps) => {
|
||||
const { user, extractModel } = props;
|
||||
const { externalProvider, extractModel } = props;
|
||||
|
||||
const { agentFunction, filterMessages } = await getFunctionCallSchema(props);
|
||||
const functions: ChatCompletionCreateParams.Function[] = [agentFunction];
|
||||
@@ -281,7 +281,7 @@ const functionCall = async (props: ActionProps) => {
|
||||
},
|
||||
extractModel
|
||||
),
|
||||
userKey: user.openaiAccount
|
||||
userKey: externalProvider.openaiAccount
|
||||
});
|
||||
|
||||
try {
|
||||
@@ -312,7 +312,7 @@ const functionCall = async (props: ActionProps) => {
|
||||
|
||||
const completions = async ({
|
||||
extractModel,
|
||||
user,
|
||||
externalProvider,
|
||||
histories,
|
||||
params: { content, extractKeys, description = 'No special requirements' }
|
||||
}: ActionProps) => {
|
||||
@@ -360,7 +360,7 @@ Human: ${content}`
|
||||
},
|
||||
extractModel
|
||||
),
|
||||
userKey: user.openaiAccount
|
||||
userKey: externalProvider.openaiAccount
|
||||
});
|
||||
const answer = data.choices?.[0].message?.content || '';
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export const runToolWithFunctionCall = async (
|
||||
requestOrigin,
|
||||
runtimeNodes,
|
||||
runtimeEdges,
|
||||
user,
|
||||
externalProvider,
|
||||
stream,
|
||||
workflowStreamResponse,
|
||||
params: { temperature, maxToken, aiChatVision }
|
||||
@@ -221,7 +221,7 @@ export const runToolWithFunctionCall = async (
|
||||
getEmptyResponseTip
|
||||
} = await createChatCompletion({
|
||||
body: requestBody,
|
||||
userKey: user.openaiAccount,
|
||||
userKey: externalProvider.openaiAccount,
|
||||
options: {
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*'
|
||||
|
||||
@@ -46,7 +46,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
requestOrigin,
|
||||
chatConfig,
|
||||
runningAppInfo: { teamId },
|
||||
user,
|
||||
externalProvider,
|
||||
params: {
|
||||
model,
|
||||
systemPrompt,
|
||||
@@ -153,7 +153,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
})();
|
||||
|
||||
// censor model and system key
|
||||
if (toolModel.censor && !user.openaiAccount?.key) {
|
||||
if (toolModel.censor && !externalProvider.openaiAccount?.key) {
|
||||
await postTextCensor({
|
||||
text: `${systemPrompt}
|
||||
${userChatInput}
|
||||
@@ -228,7 +228,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
tokens: toolNodeTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
const toolAIUsage = user.openaiAccount?.key ? 0 : totalPoints;
|
||||
const toolAIUsage = externalProvider.openaiAccount?.key ? 0 : totalPoints;
|
||||
|
||||
// flat child tool response
|
||||
const childToolResponse = dispatchFlowResponse.map((item) => item.flowResponses).flat();
|
||||
|
||||
@@ -51,7 +51,7 @@ export const runToolWithPromptCall = async (
|
||||
requestOrigin,
|
||||
runtimeNodes,
|
||||
runtimeEdges,
|
||||
user,
|
||||
externalProvider,
|
||||
stream,
|
||||
workflowStreamResponse,
|
||||
params: { temperature, maxToken, aiChatVision }
|
||||
@@ -230,7 +230,7 @@ export const runToolWithPromptCall = async (
|
||||
getEmptyResponseTip
|
||||
} = await createChatCompletion({
|
||||
body: requestBody,
|
||||
userKey: user.openaiAccount,
|
||||
userKey: externalProvider.openaiAccount,
|
||||
options: {
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*'
|
||||
|
||||
@@ -24,11 +24,9 @@ import { AIChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { formatToolResponse, initToolCallEdges, initToolNodes } from './utils';
|
||||
import { computedMaxToken, llmCompletionsBodyFormat } from '../../../../ai/utils';
|
||||
import { getNanoid, sliceStrStartEnd } from '@fastgpt/global/common/string/tools';
|
||||
import { addLog } from '../../../../../common/system/log';
|
||||
import { toolValueTypeList } from '@fastgpt/global/core/workflow/constants';
|
||||
import { WorkflowInteractiveResponseType } from '@fastgpt/global/core/workflow/template/system/interactive/type';
|
||||
import { ChatItemValueTypeEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import { i18nT } from '../../../../../../web/i18n/utils';
|
||||
|
||||
type ToolRunResponseType = {
|
||||
toolRunResponse: DispatchFlowResponse;
|
||||
@@ -92,7 +90,7 @@ export const runToolWithToolChoice = async (
|
||||
runtimeNodes,
|
||||
runtimeEdges,
|
||||
stream,
|
||||
user,
|
||||
externalProvider,
|
||||
workflowStreamResponse,
|
||||
params: { temperature, maxToken, aiChatVision }
|
||||
} = workflowProps;
|
||||
@@ -278,7 +276,7 @@ export const runToolWithToolChoice = async (
|
||||
getEmptyResponseTip
|
||||
} = await createChatCompletion({
|
||||
body: requestBody,
|
||||
userKey: user.openaiAccount,
|
||||
userKey: externalProvider.openaiAccount,
|
||||
options: {
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*'
|
||||
|
||||
@@ -62,7 +62,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
res,
|
||||
requestOrigin,
|
||||
stream = false,
|
||||
user,
|
||||
externalProvider,
|
||||
histories,
|
||||
node: { name },
|
||||
query,
|
||||
@@ -134,7 +134,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
}),
|
||||
(() => {
|
||||
// censor model and system key
|
||||
if (modelConstantsData.censor && !user.openaiAccount?.key) {
|
||||
if (modelConstantsData.censor && !externalProvider.openaiAccount?.key) {
|
||||
return postTextCensor({
|
||||
text: `${systemPrompt}
|
||||
${userChatInput}
|
||||
@@ -170,7 +170,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
// console.log(JSON.stringify(requestBody, null, 2), '===');
|
||||
const { response, isStreamResponse, getEmptyResponseTip } = await createChatCompletion({
|
||||
body: requestBody,
|
||||
userKey: user.openaiAccount,
|
||||
userKey: externalProvider.openaiAccount,
|
||||
options: {
|
||||
headers: {
|
||||
Accept: 'application/json, text/plain, */*'
|
||||
@@ -230,7 +230,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
return {
|
||||
answerText,
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens,
|
||||
query: `${userChatInput}`,
|
||||
@@ -245,7 +245,7 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
[DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [
|
||||
{
|
||||
moduleName: name,
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
}
|
||||
|
||||
@@ -126,7 +126,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
runtimeEdges = [],
|
||||
histories = [],
|
||||
variables = {},
|
||||
user,
|
||||
timezone,
|
||||
externalProvider,
|
||||
stream = false,
|
||||
...props
|
||||
} = data;
|
||||
@@ -150,7 +151,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
[DispatchNodeResponseKeyEnum.runTimes]: 1,
|
||||
[DispatchNodeResponseKeyEnum.assistantResponses]: [],
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: null,
|
||||
newVariables: removeSystemVariable(variables)
|
||||
newVariables: removeSystemVariable(variables, externalProvider.externalWorkflowVariables)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -180,6 +181,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
|
||||
variables = {
|
||||
...getSystemVariable(data),
|
||||
...externalProvider.externalWorkflowVariables,
|
||||
...variables
|
||||
};
|
||||
|
||||
@@ -493,11 +495,11 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
}
|
||||
|
||||
// replace {{xx}} variables
|
||||
let value = replaceVariable(input.value, variables);
|
||||
// let value = replaceVariable(input.value, variables);
|
||||
|
||||
// replace {{$xx.xx$}} variables
|
||||
value = replaceEditorVariable({
|
||||
text: value,
|
||||
let value = replaceEditorVariable({
|
||||
text: input.value,
|
||||
nodes: runtimeNodes,
|
||||
variables
|
||||
});
|
||||
@@ -543,7 +545,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
res,
|
||||
variables,
|
||||
histories,
|
||||
user,
|
||||
timezone,
|
||||
externalProvider,
|
||||
stream,
|
||||
node,
|
||||
runtimeNodes,
|
||||
@@ -677,7 +680,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
[DispatchNodeResponseKeyEnum.assistantResponses]:
|
||||
mergeAssistantResponseAnswerText(chatAssistantResponse),
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: toolRunResponse,
|
||||
newVariables: removeSystemVariable(variables)
|
||||
newVariables: removeSystemVariable(variables, externalProvider.externalWorkflowVariables)
|
||||
};
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
@@ -686,7 +689,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
|
||||
/* get system variable */
|
||||
const getSystemVariable = ({
|
||||
user,
|
||||
timezone,
|
||||
runningAppInfo,
|
||||
chatId,
|
||||
responseChatItemId,
|
||||
@@ -707,7 +710,7 @@ const getSystemVariable = ({
|
||||
chatId,
|
||||
responseChatItemId,
|
||||
histories,
|
||||
cTime: getSystemTime(user.timezone)
|
||||
cTime: getSystemTime(timezone)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ export const dispatchLoop = async (props: Props): Promise<Response> => {
|
||||
params,
|
||||
runtimeEdges,
|
||||
runtimeNodes,
|
||||
user,
|
||||
node: { name }
|
||||
} = props;
|
||||
const { loopInputArray = [], childrenNodeIdList = [] } = params;
|
||||
@@ -86,14 +85,14 @@ export const dispatchLoop = async (props: Props): Promise<Response> => {
|
||||
return {
|
||||
[DispatchNodeResponseKeyEnum.assistantResponses]: assistantResponses,
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: totalPoints,
|
||||
totalPoints,
|
||||
loopInput: loopInputArray,
|
||||
loopResult: outputValueArr,
|
||||
loopDetail: loopDetail
|
||||
},
|
||||
[DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [
|
||||
{
|
||||
totalPoints: user.openaiAccount?.key ? 0 : totalPoints,
|
||||
totalPoints,
|
||||
moduleName: name
|
||||
}
|
||||
],
|
||||
|
||||
@@ -53,8 +53,8 @@ function checkCondition(condition: VariableConditionEnum, inputValue: any, value
|
||||
[VariableConditionEnum.isEmpty]: () => isEmpty(inputValue),
|
||||
[VariableConditionEnum.isNotEmpty]: () => !isEmpty(inputValue),
|
||||
|
||||
[VariableConditionEnum.equalTo]: () => String(inputValue) === value,
|
||||
[VariableConditionEnum.notEqual]: () => String(inputValue) !== value,
|
||||
[VariableConditionEnum.equalTo]: () => String(inputValue).trim() === value.trim(),
|
||||
[VariableConditionEnum.notEqual]: () => String(inputValue).trim() !== value.trim(),
|
||||
|
||||
// number
|
||||
[VariableConditionEnum.greaterThan]: () => Number(inputValue) > Number(value),
|
||||
@@ -67,8 +67,8 @@ function checkCondition(condition: VariableConditionEnum, inputValue: any, value
|
||||
[VariableConditionEnum.notInclude]: () => !isInclude(inputValue, value),
|
||||
|
||||
// string
|
||||
[VariableConditionEnum.startWith]: () => inputValue?.startsWith(value),
|
||||
[VariableConditionEnum.endWith]: () => inputValue?.endsWith(value),
|
||||
[VariableConditionEnum.startWith]: () => inputValue?.trim()?.startsWith(value),
|
||||
[VariableConditionEnum.endWith]: () => inputValue?.trim()?.endsWith(value),
|
||||
[VariableConditionEnum.reg]: () => {
|
||||
if (typeof inputValue !== 'string' || !value) return false;
|
||||
if (value.startsWith('/')) {
|
||||
@@ -79,7 +79,7 @@ function checkCondition(condition: VariableConditionEnum, inputValue: any, value
|
||||
}
|
||||
|
||||
const reg = new RegExp(value, 'g');
|
||||
const result = reg.test(inputValue);
|
||||
const result = reg.test(inputValue.trim());
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ type Props = ModuleDispatchProps<{
|
||||
type Response = DispatchNodeResultType<{}>;
|
||||
|
||||
export const dispatchUpdateVariable = async (props: Props): Promise<Response> => {
|
||||
const { params, variables, runtimeNodes, workflowStreamResponse, node } = props;
|
||||
const { params, variables, runtimeNodes, workflowStreamResponse, externalProvider } = props;
|
||||
|
||||
const { updateList } = params;
|
||||
const nodeIds = runtimeNodes.map((node) => node.nodeId);
|
||||
@@ -41,15 +41,15 @@ export const dispatchUpdateVariable = async (props: Props): Promise<Response> =>
|
||||
const value = (() => {
|
||||
// If first item is empty, it means it is a input value
|
||||
if (!item.value?.[0]) {
|
||||
const formatValue = valueTypeFormat(item.value?.[1], item.valueType);
|
||||
|
||||
return typeof formatValue === 'string'
|
||||
? replaceEditorVariable({
|
||||
text: formatValue,
|
||||
nodes: runtimeNodes,
|
||||
variables
|
||||
})
|
||||
: formatValue;
|
||||
const val =
|
||||
typeof item.value?.[1] === 'string'
|
||||
? replaceEditorVariable({
|
||||
text: item.value?.[1],
|
||||
nodes: runtimeNodes,
|
||||
variables
|
||||
})
|
||||
: item.value?.[1];
|
||||
return valueTypeFormat(val, item.valueType);
|
||||
} else {
|
||||
return getReferenceVariableValue({
|
||||
value: item.value,
|
||||
@@ -80,7 +80,7 @@ export const dispatchUpdateVariable = async (props: Props): Promise<Response> =>
|
||||
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.updateVariables,
|
||||
data: removeSystemVariable(variables)
|
||||
data: removeSystemVariable(variables, externalProvider.externalWorkflowVariables)
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -14,6 +14,7 @@ import { NextApiResponse } from 'next';
|
||||
import { SseResponseEventEnum } from '@fastgpt/global/core/workflow/runtime/constants';
|
||||
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
||||
import { SearchDataResponseItemType } from '@fastgpt/global/core/dataset/type';
|
||||
import json5 from 'json5';
|
||||
|
||||
export const getWorkflowResponseWrite = ({
|
||||
res,
|
||||
@@ -116,11 +117,18 @@ export const valueTypeFormat = (value: any, type?: WorkflowIOValueTypeEnum) => {
|
||||
return Boolean(value);
|
||||
}
|
||||
try {
|
||||
if (type === WorkflowIOValueTypeEnum.datasetQuote && !Array.isArray(value)) {
|
||||
return JSON.parse(value);
|
||||
}
|
||||
if (type === WorkflowIOValueTypeEnum.selectDataset && !Array.isArray(value)) {
|
||||
return JSON.parse(value);
|
||||
if (
|
||||
type &&
|
||||
[
|
||||
WorkflowIOValueTypeEnum.object,
|
||||
WorkflowIOValueTypeEnum.chatHistory,
|
||||
WorkflowIOValueTypeEnum.datasetQuote,
|
||||
WorkflowIOValueTypeEnum.selectApp,
|
||||
WorkflowIOValueTypeEnum.selectDataset
|
||||
].includes(type) &&
|
||||
typeof value !== 'object'
|
||||
) {
|
||||
return json5.parse(value);
|
||||
}
|
||||
} catch (error) {
|
||||
return value;
|
||||
@@ -141,14 +149,23 @@ export const checkQuoteQAValue = (quoteQA?: SearchDataResponseItemType[]) => {
|
||||
};
|
||||
|
||||
/* remove system variable */
|
||||
export const removeSystemVariable = (variables: Record<string, any>) => {
|
||||
export const removeSystemVariable = (
|
||||
variables: Record<string, any>,
|
||||
removeObj: Record<string, string> = {}
|
||||
) => {
|
||||
const copyVariables = { ...variables };
|
||||
delete copyVariables.userId;
|
||||
delete copyVariables.appId;
|
||||
delete copyVariables.chatId;
|
||||
delete copyVariables.responseChatItemId;
|
||||
delete copyVariables.histories;
|
||||
delete copyVariables.cTime;
|
||||
|
||||
// delete external provider workflow variables
|
||||
Object.keys(removeObj).forEach((key) => {
|
||||
delete copyVariables[key];
|
||||
});
|
||||
|
||||
return copyVariables;
|
||||
};
|
||||
export const filterSystemVariables = (variables: Record<string, any>): SystemVariablesType => {
|
||||
|
||||
@@ -83,6 +83,13 @@ const OutLinkSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
OutLinkSchema.virtual('associatedApp', {
|
||||
ref: AppCollectionName,
|
||||
localField: 'appId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
|
||||
try {
|
||||
OutLinkSchema.index({ shareId: -1 });
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
import { TeamMemberWithUserSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import { MongoTeamMember } from '../../user/team/teamMemberSchema';
|
||||
import { checkTeamAIPoints } from '../teamLimit';
|
||||
import { UserErrEnum } from '@fastgpt/global/common/error/code/user';
|
||||
import { UserModelSchema } from '@fastgpt/global/support/user/type';
|
||||
import { TeamSchema } from '@fastgpt/global/support/user/team/type';
|
||||
|
||||
export async function getUserChatInfoAndAuthTeamPoints(tmbId: string) {
|
||||
const tmb = (await MongoTeamMember.findById(tmbId, 'teamId userId').populate(
|
||||
'userId',
|
||||
'timezone openaiAccount'
|
||||
)) as TeamMemberWithUserSchema;
|
||||
const tmb = await MongoTeamMember.findById(tmbId, 'userId teamId')
|
||||
.populate<{ user: UserModelSchema; team: TeamSchema }>([
|
||||
{
|
||||
path: 'user',
|
||||
select: 'timezone'
|
||||
},
|
||||
{
|
||||
path: 'team',
|
||||
select: 'openaiAccount externalWorkflowVariables'
|
||||
}
|
||||
])
|
||||
.lean();
|
||||
|
||||
if (!tmb) return Promise.reject(UserErrEnum.unAuthUser);
|
||||
|
||||
await checkTeamAIPoints(tmb.teamId);
|
||||
await checkTeamAIPoints(tmb.team._id);
|
||||
|
||||
return {
|
||||
user: tmb.userId
|
||||
timezone: tmb.user.timezone,
|
||||
externalProvider: {
|
||||
openaiAccount: tmb.team.openaiAccount,
|
||||
externalWorkflowVariables: tmb.team.externalWorkflowVariables
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,17 +10,17 @@ import { MongoResourcePermission } from './schema';
|
||||
import { ClientSession } from 'mongoose';
|
||||
import {
|
||||
PermissionValueType,
|
||||
ResourcePermissionType,
|
||||
ResourcePerWithGroup,
|
||||
ResourcePerWithTmbWithUser
|
||||
ResourcePermissionType
|
||||
} from '@fastgpt/global/support/permission/type';
|
||||
import { bucketNameMap } from '@fastgpt/global/common/file/constants';
|
||||
import { addMinutes } from 'date-fns';
|
||||
import { getGroupsByTmbId } from './memberGroup/controllers';
|
||||
import { Permission } from '@fastgpt/global/support/permission/controller';
|
||||
import { ParentIdType } from '@fastgpt/global/common/parentFolder/type';
|
||||
import { RequireOnlyOne } from '@fastgpt/global/common/type/utils';
|
||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||
import { MemberGroupSchemaType } from '@fastgpt/global/support/permission/memberGroup/type';
|
||||
import { TeamMemberSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import { UserModelSchema } from '@fastgpt/global/support/user/type';
|
||||
|
||||
/** get resource permission for a team member
|
||||
* If there is no permission for the team member, it will return undefined
|
||||
@@ -160,32 +160,33 @@ export const getClbsAndGroupsWithInfo = async ({
|
||||
teamId: string;
|
||||
}) =>
|
||||
Promise.all([
|
||||
(await MongoResourcePermission.find({
|
||||
MongoResourcePermission.find({
|
||||
teamId,
|
||||
resourceId,
|
||||
resourceType,
|
||||
tmbId: {
|
||||
$exists: true
|
||||
}
|
||||
}).populate({
|
||||
path: 'tmbId',
|
||||
select: 'name userId',
|
||||
populate: {
|
||||
path: 'userId',
|
||||
select: 'avatar'
|
||||
}
|
||||
})) as ResourcePerWithTmbWithUser[],
|
||||
(await MongoResourcePermission.find({
|
||||
})
|
||||
.populate<{ tmb: TeamMemberSchema & { user: UserModelSchema } }>({
|
||||
path: 'tmb',
|
||||
select: 'name userId',
|
||||
populate: {
|
||||
path: 'user',
|
||||
select: 'avatar'
|
||||
}
|
||||
})
|
||||
.lean(),
|
||||
MongoResourcePermission.find({
|
||||
teamId,
|
||||
resourceId,
|
||||
resourceType,
|
||||
groupId: {
|
||||
$exists: true
|
||||
}
|
||||
}).populate({
|
||||
path: 'groupId',
|
||||
select: 'name avatar'
|
||||
})) as ResourcePerWithGroup[]
|
||||
})
|
||||
.populate<{ group: MemberGroupSchemaType }>('group', 'name avatar')
|
||||
.lean()
|
||||
]);
|
||||
|
||||
export const delResourcePermissionById = (id: string) => {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { getResourcePermission, parseHeaderCert } from '../controller';
|
||||
import {
|
||||
CollectionWithDatasetType,
|
||||
DatasetDataItemType,
|
||||
DatasetFileSchema,
|
||||
DatasetSchemaType
|
||||
} from '@fastgpt/global/core/dataset/type';
|
||||
import { getTmbInfoByTmbId } from '../../user/team/controller';
|
||||
@@ -12,10 +11,6 @@ import { NullPermission, PerResourceTypeEnum } from '@fastgpt/global/support/per
|
||||
import { DatasetErrEnum } from '@fastgpt/global/common/error/code/dataset';
|
||||
import { DatasetPermission } from '@fastgpt/global/support/permission/dataset/controller';
|
||||
import { getCollectionWithDataset } from '../../../core/dataset/controller';
|
||||
import { MongoDatasetCollection } from '../../../core/dataset/collection/schema';
|
||||
import { getFileById } from '../../../common/file/gridfs/controller';
|
||||
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||
import { MongoDatasetData } from '../../../core/dataset/data/schema';
|
||||
import { AuthModeType, AuthResponseType } from '../type';
|
||||
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constants';
|
||||
@@ -181,7 +176,7 @@ export async function authDatasetCollection({
|
||||
|
||||
const { dataset } = await authDatasetByTmbId({
|
||||
tmbId,
|
||||
datasetId: collection.datasetId._id,
|
||||
datasetId: collection.datasetId,
|
||||
per,
|
||||
isRoot: isRootFromHeader
|
||||
});
|
||||
|
||||
@@ -66,48 +66,19 @@ export const getGroupsByTmbId = async ({
|
||||
},
|
||||
...(role ? { role: { $in: role } } : {})
|
||||
})
|
||||
.populate('groupId')
|
||||
.populate<{ group: MemberGroupSchemaType }>('group')
|
||||
.lean()
|
||||
).map((item) => {
|
||||
return {
|
||||
...(item.groupId as any as MemberGroupSchemaType)
|
||||
};
|
||||
}),
|
||||
|
||||
).map((item) => item.group),
|
||||
role ? [] : getTeamDefaultGroup({ teamId })
|
||||
])
|
||||
).flat();
|
||||
|
||||
export const getTmbByGroupId = async (groupId: string) => {
|
||||
return (
|
||||
await MongoGroupMemberModel.find({
|
||||
groupId
|
||||
})
|
||||
.populate('tmbId')
|
||||
.lean()
|
||||
).map((item) => {
|
||||
return {
|
||||
...(item.tmbId as any as MemberGroupSchemaType)
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
export const getGroupMembersByGroupId = async (groupId: string) => {
|
||||
return await MongoGroupMemberModel.find({
|
||||
groupId
|
||||
}).lean();
|
||||
};
|
||||
|
||||
export const getGroupMembersWithInfoByGroupId = async (groupId: string) => {
|
||||
return (
|
||||
await MongoGroupMemberModel.find({
|
||||
groupId
|
||||
})
|
||||
.populate('tmbId')
|
||||
.lean()
|
||||
).map((item) => item.tmbId) as any as TeamMemberSchema[]; // HACK: type casting
|
||||
};
|
||||
|
||||
/**
|
||||
* Get tmb's group permission: the maximum permission of the group
|
||||
* @param tmbId
|
||||
|
||||
@@ -26,6 +26,13 @@ export const GroupMemberSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
GroupMemberSchema.virtual('group', {
|
||||
ref: MemberGroupCollectionName,
|
||||
localField: 'groupId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
|
||||
try {
|
||||
GroupMemberSchema.index({
|
||||
groupId: 1
|
||||
|
||||
@@ -39,6 +39,19 @@ export const ResourcePermissionSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
ResourcePermissionSchema.virtual('tmb', {
|
||||
ref: TeamMemberCollectionName,
|
||||
localField: 'tmbId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
ResourcePermissionSchema.virtual('group', {
|
||||
ref: MemberGroupCollectionName,
|
||||
localField: 'groupId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
|
||||
try {
|
||||
ResourcePermissionSchema.index(
|
||||
{
|
||||
|
||||
@@ -44,7 +44,6 @@ export async function getUserDetail({
|
||||
avatar: user.avatar,
|
||||
timezone: user.timezone,
|
||||
promotionRate: user.promotionRate,
|
||||
openaiAccount: user.openaiAccount,
|
||||
team: tmb,
|
||||
notificationAccount: tmb.notificationAccount,
|
||||
permission: tmb.permission
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TeamTmbItemType, TeamMemberWithTeamSchema } from '@fastgpt/global/support/user/team/type';
|
||||
import { TeamSchema, TeamTmbItemType } from '@fastgpt/global/support/user/team/type';
|
||||
import { ClientSession, Types } from '../../../common/mongo';
|
||||
import {
|
||||
TeamMemberRoleEnum,
|
||||
@@ -15,37 +15,41 @@ import { TeamDefaultPermissionVal } from '@fastgpt/global/support/permission/use
|
||||
import { MongoMemberGroupModel } from '../../permission/memberGroup/memberGroupSchema';
|
||||
import { mongoSessionRun } from '../../../common/mongo/sessionRun';
|
||||
import { DefaultGroupName } from '@fastgpt/global/support/user/team/group/constant';
|
||||
import { getAIApi, openaiBaseUrl } from '../../../core/ai/config';
|
||||
|
||||
async function getTeamMember(match: Record<string, any>): Promise<TeamTmbItemType> {
|
||||
const tmb = (await MongoTeamMember.findOne(match).populate('teamId')) as TeamMemberWithTeamSchema;
|
||||
const tmb = await MongoTeamMember.findOne(match).populate<{ team: TeamSchema }>('team').lean();
|
||||
if (!tmb) {
|
||||
return Promise.reject('member not exist');
|
||||
}
|
||||
|
||||
const Per = await getResourcePermission({
|
||||
resourceType: PerResourceTypeEnum.team,
|
||||
teamId: tmb.teamId._id,
|
||||
teamId: tmb.teamId,
|
||||
tmbId: tmb._id
|
||||
});
|
||||
|
||||
return {
|
||||
userId: String(tmb.userId),
|
||||
teamId: String(tmb.teamId._id),
|
||||
teamName: tmb.teamId.name,
|
||||
teamId: String(tmb.teamId),
|
||||
teamName: tmb.team.name,
|
||||
memberName: tmb.name,
|
||||
avatar: tmb.teamId.avatar,
|
||||
balance: tmb.teamId.balance,
|
||||
avatar: tmb.team.avatar,
|
||||
balance: tmb.team.balance,
|
||||
tmbId: String(tmb._id),
|
||||
teamDomain: tmb.teamId?.teamDomain,
|
||||
teamDomain: tmb.team?.teamDomain,
|
||||
role: tmb.role,
|
||||
status: tmb.status,
|
||||
defaultTeam: tmb.defaultTeam,
|
||||
lafAccount: tmb.teamId.lafAccount,
|
||||
permission: new TeamPermission({
|
||||
per: Per ?? TeamDefaultPermissionVal,
|
||||
isOwner: tmb.role === TeamMemberRoleEnum.owner
|
||||
}),
|
||||
notificationAccount: tmb.teamId.notificationAccount
|
||||
notificationAccount: tmb.team.notificationAccount,
|
||||
|
||||
lafAccount: tmb.team.lafAccount,
|
||||
openaiAccount: tmb.team.openaiAccount,
|
||||
externalWorkflowVariables: tmb.team.externalWorkflowVariables
|
||||
};
|
||||
}
|
||||
|
||||
@@ -145,21 +149,87 @@ export async function updateTeam({
|
||||
name,
|
||||
avatar,
|
||||
teamDomain,
|
||||
lafAccount
|
||||
lafAccount,
|
||||
openaiAccount,
|
||||
externalWorkflowVariable
|
||||
}: UpdateTeamProps & { teamId: string }) {
|
||||
// auth openai key
|
||||
if (openaiAccount?.key) {
|
||||
console.log('auth user openai key', openaiAccount?.key);
|
||||
const baseUrl = openaiAccount?.baseUrl || openaiBaseUrl;
|
||||
openaiAccount.baseUrl = baseUrl;
|
||||
|
||||
const ai = getAIApi({
|
||||
userKey: openaiAccount
|
||||
});
|
||||
|
||||
const response = await ai.chat.completions.create({
|
||||
model: 'gpt-4o-mini',
|
||||
max_tokens: 1,
|
||||
messages: [{ role: 'user', content: 'hi' }]
|
||||
});
|
||||
if (response?.choices?.[0]?.message?.content === undefined) {
|
||||
return Promise.reject('Key response is empty');
|
||||
}
|
||||
}
|
||||
|
||||
return mongoSessionRun(async (session) => {
|
||||
const unsetObj = (() => {
|
||||
const obj: Record<string, 1> = {};
|
||||
if (lafAccount?.pat === '') {
|
||||
obj.lafAccount = 1;
|
||||
}
|
||||
if (openaiAccount?.key === '') {
|
||||
obj.openaiAccount = 1;
|
||||
}
|
||||
if (externalWorkflowVariable) {
|
||||
if (externalWorkflowVariable.value === '') {
|
||||
obj[`externalWorkflowVariables.${externalWorkflowVariable.key}`] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(obj).length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
$unset: obj
|
||||
};
|
||||
})();
|
||||
const setObj = (() => {
|
||||
const obj: Record<string, any> = {};
|
||||
if (lafAccount?.pat && lafAccount?.appid) {
|
||||
obj.lafAccount = lafAccount;
|
||||
}
|
||||
if (openaiAccount?.key && openaiAccount?.baseUrl) {
|
||||
obj.openaiAccount = openaiAccount;
|
||||
}
|
||||
if (externalWorkflowVariable) {
|
||||
if (externalWorkflowVariable.value !== '') {
|
||||
obj[`externalWorkflowVariables.${externalWorkflowVariable.key}`] =
|
||||
externalWorkflowVariable.value;
|
||||
}
|
||||
}
|
||||
if (Object.keys(obj).length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
return obj;
|
||||
})();
|
||||
|
||||
await MongoTeam.findByIdAndUpdate(
|
||||
teamId,
|
||||
{
|
||||
name,
|
||||
avatar,
|
||||
teamDomain,
|
||||
lafAccount
|
||||
$set: {
|
||||
...(name ? { name } : {}),
|
||||
...(avatar ? { avatar } : {}),
|
||||
...(teamDomain ? { teamDomain } : {}),
|
||||
...setObj
|
||||
},
|
||||
...unsetObj
|
||||
},
|
||||
{ session }
|
||||
);
|
||||
|
||||
// update default group
|
||||
// Update member group avatar
|
||||
if (avatar) {
|
||||
await MongoMemberGroupModel.updateOne(
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ const { Schema } = connectionMongo;
|
||||
import { TeamMemberSchema as TeamMemberType } from '@fastgpt/global/support/user/team/type.d';
|
||||
import { userCollectionName } from '../../user/schema';
|
||||
import {
|
||||
TeamMemberRoleMap,
|
||||
TeamMemberStatusMap,
|
||||
TeamMemberCollectionName,
|
||||
TeamCollectionName
|
||||
@@ -42,6 +41,19 @@ const TeamMemberSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
TeamMemberSchema.virtual('team', {
|
||||
ref: TeamCollectionName,
|
||||
localField: 'teamId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
TeamMemberSchema.virtual('user', {
|
||||
ref: userCollectionName,
|
||||
localField: 'userId',
|
||||
foreignField: '_id',
|
||||
justOne: true
|
||||
});
|
||||
|
||||
try {
|
||||
TeamMemberSchema.index({ teamId: 1 }, { background: true });
|
||||
TeamMemberSchema.index({ userId: 1 }, { background: true });
|
||||
|
||||
@@ -47,6 +47,16 @@ const TeamSchema = new Schema({
|
||||
type: String
|
||||
}
|
||||
},
|
||||
openaiAccount: {
|
||||
type: {
|
||||
key: String,
|
||||
baseUrl: String
|
||||
}
|
||||
},
|
||||
externalWorkflowVariables: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
notificationAccount: {
|
||||
type: String,
|
||||
required: false
|
||||
|
||||
2
packages/service/type.d.ts
vendored
@@ -9,7 +9,6 @@ import {
|
||||
import { SubPlanType } from '@fastgpt/global/support/wallet/sub/type';
|
||||
import { WorkerNameEnum, WorkerPool } from './worker/utils';
|
||||
import { Worker } from 'worker_threads';
|
||||
import { TemplateMarketItemType } from '@fastgpt/global/core/workflow/type';
|
||||
|
||||
declare global {
|
||||
var systemInitBufferId: string | undefined;
|
||||
@@ -25,5 +24,4 @@ declare global {
|
||||
var reRankModels: ReRankModelItemType[];
|
||||
|
||||
var workerPoll: Record<WorkerNameEnum, WorkerPool>;
|
||||
var appMarketTemplates: TemplateMarketItemType[];
|
||||
}
|
||||
|
||||
3
packages/templates/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Package 说明
|
||||
|
||||
该 package 存放应用模板。
|
||||
10
packages/templates/package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@fastgpt/templates",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@fastgpt/global": "workspace:*",
|
||||
"@fastgpt/service": "workspace:*"
|
||||
}
|
||||
}
|
||||
83
packages/templates/register.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { isProduction } from '@fastgpt/global/common/system/constants';
|
||||
import { PluginSourceEnum } from '@fastgpt/global/core/plugin/constants';
|
||||
import { MongoAppTemplate } from '@fastgpt/service/core/app/templates/templateSchema';
|
||||
import { AppTemplateSchemaType } from '@fastgpt/global/core/app/type';
|
||||
|
||||
const getTemplateNameList = () => {
|
||||
const currentFileUrl = new URL(import.meta.url);
|
||||
const templatesPath = path.join(path.dirname(currentFileUrl.pathname), 'src');
|
||||
|
||||
return fs.readdirSync(templatesPath) as string[];
|
||||
};
|
||||
|
||||
const getFileTemplates = (): AppTemplateSchemaType[] => {
|
||||
const templateNames = getTemplateNameList();
|
||||
|
||||
const appMarketTemplates = templateNames.map((name) => {
|
||||
const fileContent = require(`./src/${name}/template.json`);
|
||||
|
||||
return {
|
||||
...fileContent,
|
||||
templateId: `${PluginSourceEnum.community}-${name}`,
|
||||
isActive: true
|
||||
};
|
||||
});
|
||||
|
||||
return appMarketTemplates;
|
||||
};
|
||||
|
||||
const getAppTemplates = async () => {
|
||||
const communityTemplates = getFileTemplates();
|
||||
|
||||
const dbTemplates = await MongoAppTemplate.find();
|
||||
|
||||
// Merge db data to community templates
|
||||
const communityTemplateConfig = communityTemplates.map((template) => {
|
||||
const config = dbTemplates.find((t) => t.templateId === template.templateId);
|
||||
|
||||
if (config) {
|
||||
return {
|
||||
...template,
|
||||
isActive: config.isActive ?? template.isActive,
|
||||
tags: config.tags ?? template.tags,
|
||||
userGuide: config.userGuide ?? template.userGuide,
|
||||
isQuickTemplate: config.isQuickTemplate ?? template.isQuickTemplate,
|
||||
order: config.order ?? template.order
|
||||
};
|
||||
}
|
||||
|
||||
return template;
|
||||
});
|
||||
|
||||
const res = [
|
||||
...communityTemplateConfig,
|
||||
...dbTemplates.filter((t) => !isCommunityTemplate(t.templateId))
|
||||
].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getAppTemplatesAndLoadThem = async (refresh = false) => {
|
||||
if (isProduction && global.appTemplates && global.appTemplates.length > 0 && !refresh)
|
||||
return global.appTemplates;
|
||||
|
||||
if (!global.appTemplates) {
|
||||
global.appTemplates = [];
|
||||
}
|
||||
|
||||
try {
|
||||
const appTemplates = await getAppTemplates();
|
||||
global.appTemplates = appTemplates;
|
||||
return appTemplates;
|
||||
} catch (error) {
|
||||
// @ts-ignore
|
||||
global.appTemplates = undefined;
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
export const isCommunityTemplate = (templateId: string) => {
|
||||
return templateId.startsWith(PluginSourceEnum.community);
|
||||
};
|
||||
411
packages/templates/src/CQ/template.json
Normal file
@@ -0,0 +1,411 @@
|
||||
{
|
||||
"name": "问题分类 + 知识库",
|
||||
"intro": "先对用户的问题进行分类,再根据不同类型问题,执行不同的操作",
|
||||
"author": "",
|
||||
"avatar": "core/workflow/template/questionClassify",
|
||||
"tags": ["office-services"],
|
||||
"type": "advanced",
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 531.2422736065552,
|
||||
"y": -486.7611729549753
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "workflowStartNodeId",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 558.4082376415505,
|
||||
"y": 123.72387429194112
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "7BdojPlukIQw",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "core/workflow/template/aiChat",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 2701.1267277679685,
|
||||
"y": -767.8956312653042
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 3,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 1950,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": true,
|
||||
"valueType": "boolean"
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"value": ["workflowStartNodeId", "userChatInput"]
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote",
|
||||
"value": ["MNMMMIjjWyMU", "quoteQA"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"label": "core.module.output.label.New context",
|
||||
"description": "core.module.output.description.New context",
|
||||
"valueType": "chatHistory",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "rvbo634w3AYj",
|
||||
"name": "问题分类",
|
||||
"intro": "根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:\n类型1: 打招呼\n类型2: 关于商品\"使用\"问题\n类型3: 关于商品\"购买\"问题\n类型4: 其他问题",
|
||||
"avatar": "core/workflow/template/questionClassify",
|
||||
"flowNodeType": "classifyQuestion",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1020.9667229609946,
|
||||
"y": -385.0060974413916
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["selectLLMModel", "reference"],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"required": true,
|
||||
"valueType": "string",
|
||||
"llmModelType": "classify",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.module.input.label.Background",
|
||||
"description": "core.module.input.description.Background",
|
||||
"placeholder": "core.module.input.placeholder.Classify background",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"value": ["workflowStartNodeId", "userChatInput"]
|
||||
},
|
||||
{
|
||||
"key": "agents",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": [
|
||||
{
|
||||
"value": "关于电影《星际穿越》的问题",
|
||||
"key": "wqre"
|
||||
},
|
||||
{
|
||||
"value": "打招呼、问候等问题",
|
||||
"key": "sdfa"
|
||||
},
|
||||
{
|
||||
"value": "其他问题",
|
||||
"key": "agex"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "cqResult",
|
||||
"key": "cqResult",
|
||||
"label": "分类结果",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "7kwgL1dVlwG6",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "core/workflow/template/reply",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 1874.9167551056487,
|
||||
"y": 434.98431875888207
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"valueType": "string",
|
||||
"label": "core.module.input.label.Response content",
|
||||
"description": "core.module.input.description.Response content",
|
||||
"placeholder": "core.module.input.description.Response content",
|
||||
"selectedTypeIndex": 1,
|
||||
"value": ["rvbo634w3AYj", "cqResult"]
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "MNMMMIjjWyMU",
|
||||
"name": "知识库搜索",
|
||||
"intro": "调用\"语义检索\"和\"全文检索\"能力,从\"知识库\"中查找可能与问题相关的参考内容",
|
||||
"avatar": "core/workflow/template/datasetSearch",
|
||||
"flowNodeType": "datasetSearchNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1851.010152279949,
|
||||
"y": -613.3555232387284
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "datasets",
|
||||
"renderTypeList": ["selectDataset", "reference"],
|
||||
"label": "core.module.input.label.Select dataset",
|
||||
"value": [],
|
||||
"valueType": "selectDataset",
|
||||
"list": [],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"key": "similarity",
|
||||
"renderTypeList": ["selectDatasetParamsModal"],
|
||||
"label": "",
|
||||
"value": 0.4,
|
||||
"valueType": "number"
|
||||
},
|
||||
{
|
||||
"key": "limit",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 1500,
|
||||
"valueType": "number"
|
||||
},
|
||||
{
|
||||
"key": "searchMode",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": "embedding"
|
||||
},
|
||||
{
|
||||
"key": "usingReRank",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"key": "datasetSearchUsingExtensionQuery",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"key": "datasetSearchExtensionModel",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "datasetSearchExtensionBg",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "需要检索的内容",
|
||||
"value": ["workflowStartNodeId", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "quoteQA",
|
||||
"key": "quoteQA",
|
||||
"label": "core.module.Dataset quote.label",
|
||||
"description": "特殊数组格式,搜索结果为空时,返回空数组。",
|
||||
"type": "FlowNodeOutputTypeEnum.static",
|
||||
"valueType": "datasetQuote"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "workflowStartNodeId",
|
||||
"target": "rvbo634w3AYj",
|
||||
"sourceHandle": "workflowStartNodeId-source-right",
|
||||
"targetHandle": "rvbo634w3AYj-target-left"
|
||||
},
|
||||
{
|
||||
"source": "rvbo634w3AYj",
|
||||
"target": "7kwgL1dVlwG6",
|
||||
"sourceHandle": "rvbo634w3AYj-source-agex",
|
||||
"targetHandle": "7kwgL1dVlwG6-target-left"
|
||||
},
|
||||
{
|
||||
"source": "rvbo634w3AYj",
|
||||
"target": "MNMMMIjjWyMU",
|
||||
"sourceHandle": "rvbo634w3AYj-source-wqre",
|
||||
"targetHandle": "MNMMMIjjWyMU-target-left"
|
||||
},
|
||||
{
|
||||
"source": "MNMMMIjjWyMU",
|
||||
"target": "7BdojPlukIQw",
|
||||
"sourceHandle": "MNMMMIjjWyMU-source-right",
|
||||
"targetHandle": "7BdojPlukIQw-target-left"
|
||||
},
|
||||
{
|
||||
"source": "rvbo634w3AYj",
|
||||
"target": "7kwgL1dVlwG6",
|
||||
"sourceHandle": "rvbo634w3AYj-source-sdfa",
|
||||
"targetHandle": "7kwgL1dVlwG6-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
},
|
||||
"welcomeText": "你好,我是知识库助手,请不要忘记选择知识库噢~\n[你是谁]\n[如何使用]"
|
||||
}
|
||||
}
|
||||
}
|
||||
507
packages/templates/src/Chinese/template.json
Normal file
@@ -0,0 +1,507 @@
|
||||
{
|
||||
"name": "汉语新解",
|
||||
"intro": "生成汉语释义图",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/chinese",
|
||||
"tags": ["roleplay"],
|
||||
"type": "advanced",
|
||||
"userGuide": {
|
||||
"type": "link",
|
||||
"content": "https://mp.weixin.qq.com/s/T90-uZqGovYR90fST0o80Q"
|
||||
},
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "common:core.module.template.system_config",
|
||||
"intro": "common:core.module.template.system_config_info",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 262.2732338817093,
|
||||
"y": -476.00241136598146
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "core.app.Chat Variable",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "any",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "core.app.Question Guide",
|
||||
"value": {
|
||||
"open": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"type": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"open": false,
|
||||
"autoSend": false,
|
||||
"autoTTSResponse": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "common:core.module.template.work_start",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 632.368838596004,
|
||||
"y": -347.7446492944009
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "common:core.module.input.label.user question",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"debugLabel": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "common:core.module.input.label.user question",
|
||||
"type": "static",
|
||||
"valueType": "string",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "bg853CwHAw4a",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "core/workflow/template/aiChat",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1318.728987052518,
|
||||
"y": -612.0024113659815
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "AI 模型",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "claude-3-5-sonnet-20240620"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 2000,
|
||||
"valueType": "number",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": false,
|
||||
"valueType": "boolean",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "aiChatQuoteRole",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": "system",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "aiChatVision",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "提示词",
|
||||
"description": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "{提示词 START:\n;; 作者: 李继刚\n;; 版本: 0.3\n;; 模型: Claude Sonnet\n;; 用途: 将一个汉语词汇进行全新角度的解释\n\n;; 设定如下内容为你的 *System Prompt*\n(defun 新汉语老师 ()\n \"你是年轻人,批判现实,思考深刻,语言风趣\"\n (风格 . (\"Oscar Wilde\" \"鲁迅\" \"罗永浩\"))\n (擅长 . 一针见血)\n (表达 . 隐喻)\n (批判 . 讽刺幽默))\n\n(defun 汉语新解 (用户输入)\n \"你会用一个特殊视角来解释一个词汇\"\n (let (解释 (精练表达\n (隐喻 (一针见血 (辛辣讽刺 (抓住本质 用户输入))))))\n (few-shots (委婉 . \"刺向他人时, 决定在剑刃上撒上止痛药。\"))\n (SVG-Card 解释)))\n\n(defun SVG-Card (解释)\n \"输出SVG 卡片\"\n (setq design-rule \"合理使用负空间,整体排版要有呼吸感\"\n design-principles '(干净 简洁 典雅))\n\n (设置画布 '(宽度 400 高度 600 边距 20))\n (标题字体 '毛笔楷体)\n (自动缩放 '(最小字号 16))\n\n (配色风格 '((背景色 (蒙德里安风格 设计感)))\n (主要文字 (汇文明朝体 粉笔灰))\n (装饰图案 随机几何图))\n\n (卡片元素 ((居中标题 \"汉语新解\")\n 分隔线\n (排版输出 用户输入 英文 日语)\n 解释\n (线条图 (批判内核 解释))\n (极简总结 线条图))))\n\n(defun start ()\n \"启动时运行\"\n (let (system-role 新汉语老师)\n (print \"说吧, 他们又用哪个词来忽悠你了?\")))\n\n;; 运行规则\n;; 1. 启动时必须运行 (start) 函数\n;; 2. 之后调用主函数 (汉语新解 用户输入)\n提示词 END}\n\n(直接生成 svg 完整代码,我会复制,需要你用代码块)\n(除此之外不要有多余的解释,不要在开头加上任何说明)\n解释的内容自动加入换行标签,例如:\n<tspan x=\"50%\" dy=\"25\" font-size=\"18\" fill=\"#8B4513\">文字1,</tspan>\n <tspan x=\"50%\" dy=\"25\" font-size=\"18\" fill=\"#8B4513\">文字12,</tspan>"
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "聊天记录",
|
||||
"description": "workflow:max_dialog_rounds",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"value": 0,
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote",
|
||||
"valueDesc": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "stringQuoteText",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"label": "文档引用",
|
||||
"debugLabel": "文档引用",
|
||||
"description": "app:document_quote_tip",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"value": ["448745", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"required": true,
|
||||
"label": "common:core.module.output.label.New context",
|
||||
"description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
|
||||
"valueType": "chatHistory",
|
||||
"valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"required": true,
|
||||
"label": "common:core.module.output.label.Ai response content",
|
||||
"description": "将在 stream 回复完毕后触发",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "sbVUb0efY6Fm",
|
||||
"name": "代码运行",
|
||||
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
|
||||
"avatar": "core/workflow/template/codeRun",
|
||||
"flowNodeType": "code",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 2210.2574140398733,
|
||||
"y": -621.0024113659815
|
||||
},
|
||||
"version": "482",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "codeType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": "js",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "code",
|
||||
"renderTypeList": ["custom"],
|
||||
"label": "",
|
||||
"value": "function main({svg_str}){\n\n // 使用正则表达式匹配代码块中的内容\n const match = svg_str.match(/```[\\w]*\\n([\\s\\S]*?)```/);\n\n if (!match) {\n // 如果没有匹配到代码块,返回一个错误信息或空结果\n return {\n result: null,\n error: \"未找到有效的代码块标记。\"\n };\n }\n\n // 提取代码块中的 SVG 内容\n const extractedSvg = match[1].trim();\n \n const base64 = strToBase64(extractedSvg,'data:image/svg+xml;base64,')\n\n return {\n result: base64\n }\n}",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "svg_str",
|
||||
"label": "svg_str",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": ["bg853CwHAw4a", "answerText"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_rawResponse",
|
||||
"key": "system_rawResponse",
|
||||
"label": "workflow:full_response_data",
|
||||
"valueType": "object",
|
||||
"type": "static",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:execution_error",
|
||||
"description": "代码运行错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
|
||||
"valueDesc": ""
|
||||
},
|
||||
{
|
||||
"id": "qLUQfhG0ILRX",
|
||||
"type": "dynamic",
|
||||
"key": "result",
|
||||
"valueType": "string",
|
||||
"label": "result",
|
||||
"valueDesc": "",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "cPh2VZnVxjQ8",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "core/workflow/template/reply",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 2911.2230784647795,
|
||||
"y": -411.6915940628763
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"valueType": "any",
|
||||
"required": true,
|
||||
"label": "回复的内容",
|
||||
"description": "common:core.module.input.description.Response content",
|
||||
"placeholder": "common:core.module.input.description.Response content",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "SVG:\n\n{{$bg853CwHAw4a.answerText$}}\n\n卡片:\n\n"
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "bg853CwHAw4a",
|
||||
"target": "sbVUb0efY6Fm",
|
||||
"sourceHandle": "bg853CwHAw4a-source-right",
|
||||
"targetHandle": "sbVUb0efY6Fm-target-left"
|
||||
},
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "bg853CwHAw4a",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "bg853CwHAw4a-target-left"
|
||||
},
|
||||
{
|
||||
"source": "sbVUb0efY6Fm",
|
||||
"target": "cPh2VZnVxjQ8",
|
||||
"sourceHandle": "sbVUb0efY6Fm-source-right",
|
||||
"targetHandle": "cPh2VZnVxjQ8-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"variables": [],
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
},
|
||||
"_id": "66f0f7540a40cd1f97da9dd6"
|
||||
}
|
||||
}
|
||||
}
|
||||
581
packages/templates/src/TranslateRobot/template.json
Normal file
@@ -0,0 +1,581 @@
|
||||
{
|
||||
"name": "多轮翻译机器人",
|
||||
"intro": "通过 4 轮翻译,提高翻译英文的质量",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/TranslateRobot",
|
||||
"tags": ["office-services"],
|
||||
"type": "advanced",
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 531.2422736065552,
|
||||
"y": -486.7611729549753
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "core.app.Chat Variable",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "any",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "core.app.Question Guide",
|
||||
"value": {
|
||||
"open": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"type": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"open": false,
|
||||
"autoSend": false,
|
||||
"autoTTSResponse": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 558.4082376415505,
|
||||
"y": 123.72387429194112
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"type": "static",
|
||||
"valueType": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "loOvhld2ZTKa",
|
||||
"name": "第一轮翻译",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "/imgs/workflow/AI.png",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1748.8252410306534,
|
||||
"y": -245.08260685989214
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"value": "claude-3-5-sonnet-20240620"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 2000,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": true,
|
||||
"valueType": "boolean"
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"value": "# Role: 资深英汉翻译专家\n\n## Background:\n你是一位经验丰富的英汉翻译专家,精通英汉互译,尤其擅长将英文文章译成流畅易懂的现代汉语。你曾多次带领团队完成大型翻译项目,译文广受好评。\n\n## Attention:\n- 翻译过程中要始终坚持\"信、达、雅\"的原则,但\"达\"尤为重要\n- 译文要符合现代汉语的表达习惯,通俗易懂,连贯流畅 \n- 避免使用过于文绉绉的表达和晦涩难懂的典故引用\n\n## Profile: \n- Author: 米开朗基杨 \n- Version: 0.2\n- Language: 中文\n- Description: 你是一位资深英汉翻译专家,精通英汉互译。你擅长将英文文章译成地道流畅的现代汉语,表达准确易懂,符合当代中文语言习惯。\n\n## Constraints:\n- 必须严格遵循四轮翻译流程:直译、意译、校审、定稿 \n- 译文要忠实原文,准确无误,不能遗漏或曲解原意\n- 译文应以现代白话文为主,避免过多使用文言文和古典诗词\n- 每一轮翻译前后必须添加【思考】和【翻译】标记\n- 最终译文使用Markdown的代码块呈现\n\n## Goals:\n- 通过四轮翻译流程,将英文原文译成高质量的现代汉语译文 \n- 译文要准确传达原文意思,语言表达力求浅显易懂,朗朗上口\n- 适度使用一些熟语俗语、流行网络用语等,增强译文的亲和力\n- 在直译的基础上,提供至少2个不同风格的意译版本供选择\n\n## Skills:\n- 精通英汉双语,具有扎实的语言功底和丰富的翻译经验\n- 擅长将英语表达习惯转换为地道自然的现代汉语\n- 对当代中文语言的发展变化有敏锐洞察,善于把握语言流行趋势\n\n## Workflow:\n1. 第一轮直译:逐字逐句忠实原文,不遗漏任何信息\n2. 第二轮意译:在直译的基础上用通俗流畅的现代汉语意译原文,至少提供2个不同风格的版本\n3. 第三轮校审:仔细审视译文,消除偏差和欠缺,使译文更加地道易懂 \n4. 第四轮定稿:择优选取,反复修改润色,最终定稿出一个简洁畅达、符合大众阅读习惯的译文\n\n## OutputFormat: \n- 每一轮翻译前用【思考】说明该轮要点\n- 每一轮翻译后用【翻译】呈现译文\n- 在\\`\\`\\`代码块中展示最终定稿译文\n\n## Suggestions:\n- 直译时力求忠实原文,但不要过于拘泥逐字逐句\n- 意译时在准确表达原意的基础上,用最朴实无华的现代汉语来表达 \n- 校审环节重点关注译文是否符合当代汉语表达习惯,是否通俗易懂\n- 定稿时适度采用一些熟语谚语、网络流行语等,使译文更接地气\n- 善于利用中文的灵活性,用不同的表述方式展现同一内容,提高译文的可读性\n\n## Initialization\n作为一名资深英汉翻译专家,你必须严格遵循翻译流程的各项要求。首先请向用户问好,介绍你将带领团队完成翻译任务,力求将英文原文译成通俗易懂的现代汉语。然后简要说明四轮翻译流程,请用户提供英文原文,开始进行翻译工作。"
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"description": "最多携带多少轮对话记录",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"value": ["gBDvemE4FBhp", "system_text"]
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"required": true,
|
||||
"label": "core.module.output.label.New context",
|
||||
"description": "core.module.output.description.New context",
|
||||
"valueType": "chatHistory",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"required": true,
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "w0oBbQ3YJHye",
|
||||
"name": "代码运行",
|
||||
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
|
||||
"avatar": "/imgs/workflow/code.svg",
|
||||
"flowNodeType": "code",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 2522.61682940854,
|
||||
"y": -79.74569750380468
|
||||
},
|
||||
"version": "482",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "这些变量会作为代码的运行的输入参数",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "codeType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": "js"
|
||||
},
|
||||
{
|
||||
"key": "code",
|
||||
"renderTypeList": ["custom"],
|
||||
"label": "",
|
||||
"value": "function main({data1}) {\n const codeBlocks = data1.match(/```[\\s\\S]*?```/g);\n\n if (codeBlocks && codeBlocks.length > 0) {\n const lastCodeBlock = codeBlocks[codeBlocks.length - 1];\n const cleanedCodeBlock = lastCodeBlock.replace(/```[a-zA-Z]*|```/g, '').trim();\n \n return {\n result: cleanedCodeBlock\n };\n }\n\n return {\n result: '未截取到代码块内容'\n };\n}\n"
|
||||
},
|
||||
{
|
||||
"key": "data1",
|
||||
"valueType": "string",
|
||||
"label": "data1",
|
||||
"renderTypeList": ["reference"],
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"value": ["loOvhld2ZTKa", "answerText"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"description": "将代码中 return 的对象作为输出,传递给后续的节点"
|
||||
},
|
||||
{
|
||||
"id": "system_rawResponse",
|
||||
"key": "system_rawResponse",
|
||||
"label": "完整响应数据",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "运行错误",
|
||||
"description": "代码运行错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "qLUQfhG0ILRX",
|
||||
"type": "dynamic",
|
||||
"key": "result",
|
||||
"valueType": "string",
|
||||
"label": "result"
|
||||
},
|
||||
{
|
||||
"id": "gR0mkQpJ4Og8",
|
||||
"type": "dynamic",
|
||||
"key": "data2",
|
||||
"valueType": "string",
|
||||
"label": "data2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "foO69L5FOmDQ",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "/imgs/workflow/reply.png",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 3798.4479531204515,
|
||||
"y": 116.03040242110023
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"valueType": "any",
|
||||
"required": true,
|
||||
"label": "core.module.input.label.Response content",
|
||||
"description": "core.module.input.description.Response content",
|
||||
"placeholder": "core.module.input.description.Response content",
|
||||
"selectedTypeIndex": 1,
|
||||
"value": ["bcqtxqxE2R6o", "system_text"]
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "gBDvemE4FBhp",
|
||||
"name": "文本拼接",
|
||||
"intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。",
|
||||
"avatar": "/imgs/workflow/textEditor.svg",
|
||||
"flowNodeType": "textEditor",
|
||||
"position": {
|
||||
"x": 1031.371061396644,
|
||||
"y": 38.65839420088383
|
||||
},
|
||||
"version": "486",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "可以引用其他节点的输出,作为文本拼接的变量,通过 {{字段名}} 来引用变量",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "system_textareaInput",
|
||||
"renderTypeList": ["textarea"],
|
||||
"valueType": "string",
|
||||
"required": true,
|
||||
"label": "拼接文本",
|
||||
"placeholder": "可通过 {{字段名}} 来引用变量",
|
||||
"value": "原文:\n\"\"\"\n{{q}}\n\"\"\""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "q",
|
||||
"label": "q",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"required": true,
|
||||
"value": ["448745", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_text",
|
||||
"key": "system_text",
|
||||
"label": "拼接结果",
|
||||
"type": "static",
|
||||
"valueType": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "bcqtxqxE2R6o",
|
||||
"name": "合并输出结果",
|
||||
"intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。",
|
||||
"avatar": "/imgs/workflow/textEditor.svg",
|
||||
"flowNodeType": "textEditor",
|
||||
"position": {
|
||||
"x": 3113.6227559936665,
|
||||
"y": 12.909197647746709
|
||||
},
|
||||
"version": "486",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "可以引用其他节点的输出,作为文本拼接的变量,通过 {{字段名}} 来引用变量",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "system_textareaInput",
|
||||
"renderTypeList": ["textarea"],
|
||||
"valueType": "string",
|
||||
"required": true,
|
||||
"label": "拼接文本",
|
||||
"placeholder": "可通过 {{字段名}} 来引用变量",
|
||||
"value": "****** \n\n最终翻译结果如下: \n\n```\n{{result}}\n```"
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "result",
|
||||
"label": "result",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"required": true,
|
||||
"value": ["w0oBbQ3YJHye", "qLUQfhG0ILRX"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_text",
|
||||
"key": "system_text",
|
||||
"label": "拼接结果",
|
||||
"type": "static",
|
||||
"valueType": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "loOvhld2ZTKa",
|
||||
"target": "w0oBbQ3YJHye",
|
||||
"sourceHandle": "loOvhld2ZTKa-source-right",
|
||||
"targetHandle": "w0oBbQ3YJHye-target-left"
|
||||
},
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "gBDvemE4FBhp",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "gBDvemE4FBhp-target-left"
|
||||
},
|
||||
{
|
||||
"source": "gBDvemE4FBhp",
|
||||
"target": "loOvhld2ZTKa",
|
||||
"sourceHandle": "gBDvemE4FBhp-source-right",
|
||||
"targetHandle": "loOvhld2ZTKa-target-left"
|
||||
},
|
||||
{
|
||||
"source": "w0oBbQ3YJHye",
|
||||
"target": "bcqtxqxE2R6o",
|
||||
"sourceHandle": "w0oBbQ3YJHye-source-right",
|
||||
"targetHandle": "bcqtxqxE2R6o-target-left"
|
||||
},
|
||||
{
|
||||
"source": "bcqtxqxE2R6o",
|
||||
"target": "foO69L5FOmDQ",
|
||||
"sourceHandle": "bcqtxqxE2R6o-source-right",
|
||||
"targetHandle": "foO69L5FOmDQ-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
503
packages/templates/src/animalLife/template.json
Normal file
196
packages/templates/src/chatGuide/template.json
Normal file
@@ -0,0 +1,196 @@
|
||||
{
|
||||
"name": "对话引导 + 变量",
|
||||
"intro": "可以在对话开始发送一段提示,或者让用户填写一些内容,作为本次对话的变量",
|
||||
"author": "",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"tags": ["office-services"],
|
||||
"type": "simple",
|
||||
"weight": 1,
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 496.57560693988853,
|
||||
"y": -490.7611729549753
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 558.4082376415505,
|
||||
"y": 123.72387429194112
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.reference", "FlowNodeInputTypeEnum.textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "loOvhld2ZTKa",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "/imgs/workflow/AI.png",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1097.7317280958762,
|
||||
"y": -244.16014496351386
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": [
|
||||
"FlowNodeInputTypeEnum.settingLLMModel",
|
||||
"FlowNodeInputTypeEnum.reference"
|
||||
],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"value": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"value": 2000,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"value": true,
|
||||
"valueType": "boolean"
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.textarea", "FlowNodeInputTypeEnum.reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"value": "请直接将我的问题翻译成{{language}},不需要回答问题。"
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": [
|
||||
"FlowNodeInputTypeEnum.numberInput",
|
||||
"FlowNodeInputTypeEnum.reference"
|
||||
],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.reference", "FlowNodeInputTypeEnum.textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"value": ["448745", "userChatInput"]
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"label": "core.module.output.label.New context",
|
||||
"description": "core.module.output.description.New context",
|
||||
"valueType": "chatHistory",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "loOvhld2ZTKa",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "loOvhld2ZTKa-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"welcomeText": "你好,我可以为你翻译各种语言,请告诉我你需要翻译成什么语言?",
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
518
packages/templates/src/divination/template.json
Normal file
330
packages/templates/src/flux/template.json
Normal file
@@ -0,0 +1,330 @@
|
||||
{
|
||||
"name": "Flux 绘图",
|
||||
"intro": "通过请求 Flux 接口绘图,需要有 api key",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/flux",
|
||||
"type": "plugin",
|
||||
"tags": ["image-generation"],
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "pluginInput",
|
||||
"name": "插件开始",
|
||||
"intro": "可以配置插件需要哪些输入,利用这些输入来运行插件",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "pluginInput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 503.3030871469042,
|
||||
"y": -91.64434154072819
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"selectedTypeIndex": 0,
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "绘图提示词",
|
||||
"label": "绘图提示词",
|
||||
"description": "绘图提示词",
|
||||
"required": true,
|
||||
"toolDescription": "绘图提示词"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "绘图提示词",
|
||||
"valueType": "string",
|
||||
"key": "绘图提示词",
|
||||
"label": "绘图提示词",
|
||||
"type": "hidden"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "pluginOutput",
|
||||
"name": "插件输出",
|
||||
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
|
||||
"avatar": "core/workflow/template/pluginOutput",
|
||||
"flowNodeType": "pluginOutput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1876.2082565873427,
|
||||
"y": -110.14434154072819
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "图片访问链接",
|
||||
"label": "图片访问链接",
|
||||
"description": "",
|
||||
"value": ["tMvel910bnrJ", "pJXgWoTpPoMy"]
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "object",
|
||||
"canEdit": true,
|
||||
"key": "error",
|
||||
"label": "错误信息",
|
||||
"description": "",
|
||||
"value": ["tMvel910bnrJ", "error"]
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "tMvel910bnrJ",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||
"avatar": "core/workflow/template/httpRequest",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1138.1732435351091,
|
||||
"y": -416.6443415407282
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "common:core.module.input.description.HTTP Dynamic Input",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "POST",
|
||||
"required": true,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpTimeout",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "number",
|
||||
"label": "",
|
||||
"value": 30,
|
||||
"min": 5,
|
||||
"max": 600,
|
||||
"required": true,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "https://fal.run/fal-ai/flux-pro",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"value": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"type": "string",
|
||||
"value": "Key {{apikey}}"
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Header",
|
||||
"placeholder": "common:core.module.input.description.Http Request Header",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": "{\n \"prompt\": \"{{prompt}}\",\n \"image_size\": \"landscape_4_3\",\n \"num_inference_steps\": 28,\n \"guidance_scale\": 3.5\n}",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpFormBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpContentType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"value": "json",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "prompt",
|
||||
"label": "prompt",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"required": true,
|
||||
"value": ["pluginInput", "绘图提示词"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:request_error",
|
||||
"description": "HTTP请求错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"required": true,
|
||||
"label": "workflow:raw_response",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "pJXgWoTpPoMy",
|
||||
"valueType": "string",
|
||||
"type": "dynamic",
|
||||
"key": "images[0].url",
|
||||
"label": "images[0].url"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "lSYsc889IXDr",
|
||||
"name": "系统配置",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "pluginConfig",
|
||||
"position": {
|
||||
"x": 45.52914573588026,
|
||||
"y": -110.14434154072819
|
||||
},
|
||||
"version": "4811",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "pluginInput",
|
||||
"target": "tMvel910bnrJ",
|
||||
"sourceHandle": "pluginInput-source-right",
|
||||
"targetHandle": "tMvel910bnrJ-target-left"
|
||||
},
|
||||
{
|
||||
"source": "tMvel910bnrJ",
|
||||
"target": "pluginOutput",
|
||||
"sourceHandle": "tMvel910bnrJ-source-right",
|
||||
"targetHandle": "pluginOutput-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
926
packages/templates/src/githubIssue/template.json
Normal file
@@ -0,0 +1,926 @@
|
||||
{
|
||||
"name": "GitHub Issue 总结机器人",
|
||||
"intro": "定时获取GitHub Issue信息,使用AI进行总结,并推送到飞书群中",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/githubIssue",
|
||||
"tags": ["office-services"],
|
||||
"type": "advanced",
|
||||
"userGuide": {
|
||||
"type": "link",
|
||||
"content": "https://mp.weixin.qq.com/s/CBrwSn1jQZO7ybsMSx5GnQ"
|
||||
},
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "common:core.module.template.system_config",
|
||||
"intro": "common:core.module.template.system_config_info",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 262.2732338817093,
|
||||
"y": -476.00241136598146
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "core.app.Chat Variable",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "hidden",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "core.app.Question Guide",
|
||||
"value": {
|
||||
"open": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"type": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"open": false,
|
||||
"autoSend": false,
|
||||
"autoTTSResponse": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "common:core.module.template.work_start",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 632.368838596004,
|
||||
"y": -347.7446492944009
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "common:core.module.input.label.user question",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"debugLabel": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "common:core.module.input.label.user question",
|
||||
"type": "static",
|
||||
"valueType": "string",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "jVGuKrDfFTU6",
|
||||
"name": "获取 24 小时前的日期",
|
||||
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
|
||||
"avatar": "core/workflow/template/codeRun",
|
||||
"flowNodeType": "code",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1045.4174257570808,
|
||||
"y": -94.5419824521446
|
||||
},
|
||||
"version": "482",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "codeType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": "js",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "code",
|
||||
"renderTypeList": ["custom"],
|
||||
"label": "",
|
||||
"value": "function main() {\n const date = new Date();\n date.setDate(date.getDate() - 3);\n const day = date.getDate();\n const month = date.getMonth() + 1;\n const year = date.getFullYear();\n const hours = date.getHours();\n const minutes = date.getMinutes();\n\n return {\n date: `${year}-${month}-${day}T${hours}:${minutes}:000Z`,\n }\n }",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_rawResponse",
|
||||
"key": "system_rawResponse",
|
||||
"label": "workflow:full_response_data",
|
||||
"valueType": "object",
|
||||
"type": "static",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:execution_error",
|
||||
"description": "代码运行错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
|
||||
"valueDesc": ""
|
||||
},
|
||||
{
|
||||
"id": "gR0mkQpJ4Og8",
|
||||
"type": "dynamic",
|
||||
"key": "date",
|
||||
"valueType": "string",
|
||||
"label": "date",
|
||||
"valueDesc": "",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "jyftFRrd4RQf",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "core/workflow/template/reply",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 1758.8251385440858,
|
||||
"y": 80.55020745654087
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"valueType": "any",
|
||||
"required": true,
|
||||
"label": "回复的内容",
|
||||
"description": "common:core.module.input.description.Response content",
|
||||
"placeholder": "common:core.module.input.description.Response content",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "拉取从 {{$jVGuKrDfFTU6.gR0mkQpJ4Og8$}} 以来所有的 open issue \\n"
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "mCaalLpFoZFk",
|
||||
"name": "获取 Issues",
|
||||
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||
"avatar": "core/workflow/template/httpRequest",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 2602.5615507147536,
|
||||
"y": -67.18952984768578
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "common:core.module.input.description.HTTP Dynamic Input",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "GET",
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpTimeout",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "number",
|
||||
"label": "",
|
||||
"value": 30,
|
||||
"min": 5,
|
||||
"max": 600,
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "https://api.github.com/repos/labring/FastGPT/issues",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Header",
|
||||
"placeholder": "common:core.module.input.description.Http Request Header",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [
|
||||
{
|
||||
"key": "state",
|
||||
"type": "string",
|
||||
"value": "open"
|
||||
},
|
||||
{
|
||||
"key": "since",
|
||||
"type": "string",
|
||||
"value": "{{$jVGuKrDfFTU6.gR0mkQpJ4Og8$}}"
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": "",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpFormBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpContentType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"value": "json",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:request_error",
|
||||
"description": "HTTP请求错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"required": true,
|
||||
"label": "workflow:raw_response",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"valueDesc": "",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "gALvyJcXPoep",
|
||||
"name": "处理 API 响应数据",
|
||||
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
|
||||
"avatar": "core/workflow/template/codeRun",
|
||||
"flowNodeType": "code",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 3396.722564475613,
|
||||
"y": -80.79235153344955
|
||||
},
|
||||
"version": "482",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "codeType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": "js",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "code",
|
||||
"renderTypeList": ["custom"],
|
||||
"label": "",
|
||||
"value": "function main({res}) {\n const issues = JSON.parse(res);\n const ret = [];\n for(const issue of issues) {\n if (issue.pull_request) continue;\n ret.push({\n title: issue.title,\n body: issue.body,\n url: issue.html_url\n })\n }\n\n return {\n ret: JSON.stringify(ret)\n }\n}",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "res",
|
||||
"label": "res",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": ["mCaalLpFoZFk", "httpRawResponse"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_rawResponse",
|
||||
"key": "system_rawResponse",
|
||||
"label": "workflow:full_response_data",
|
||||
"valueType": "object",
|
||||
"type": "static",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:execution_error",
|
||||
"description": "代码运行错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
|
||||
"valueDesc": ""
|
||||
},
|
||||
{
|
||||
"id": "qLUQfhG0ILRX",
|
||||
"type": "dynamic",
|
||||
"key": "ret",
|
||||
"valueType": "string",
|
||||
"label": "ret",
|
||||
"valueDesc": "",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "aLrp6IjV8zAf",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "core/workflow/template/aiChat",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 3907.7186093895143,
|
||||
"y": -148.24856757598377
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "AI 模型",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "qwen-plus"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 8000,
|
||||
"valueType": "number",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": true,
|
||||
"valueType": "boolean",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "aiChatQuoteRole",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": "system",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "aiChatVision",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "提示词",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "你是一个简洁高效的 GitHub Issue 概述助手,专长于提炼核心问题并以清晰简洁的方式呈现。\n\n## 任务\n分析输入的多条 issue 信息,为每个 issue 创建一个简明扼要的概述。使用中文输出。\n\n## 输入格式\nJSON 数组,每项包含 title(标题)、body(内容)和 url(链接)。\n\n## 输出格式\n对每个 issue 使用 Markdown 语法创建简洁的概述块。每个概述应包含:\n\n1. 使用加粗呈现 issue 的原标题\n2. 一段简短的问题概述(不超过 2-3 句话)\n3. 原 issue 的链接(使用 Markdown 链接语法)\n\n在概述中适当使用 emoji 来增加可读性,但不要过度使用。保持整体风格简洁明了。\n\n示例输出:\n\n---\n\n**🔍 数据可视化组件性能优化**\n\n这个 issue 反映了在处理大量数据时图表加载缓慢的问题。用户在数据点超过一定数量时experiencing明显的性能下降,影响了用户体验。\n\n📎 [查看原 issue](url1)\n\n---\n\n**🐞 移动端界面适配问题**\n\n该 issue 指出在某些特定型号的移动设备上出现了界面布局错乱的情况。这个问题影响了应用在不同尺寸屏幕上的一致性展现。\n\n📎 [查看原 issue](url2)\n\n---\n\n请确保每个 issue 概述都简洁明了,突出核心问题,避免过多细节。保持整体风格统一,让读者能快速理解每个 issue 的要点。"
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "聊天记录",
|
||||
"description": "workflow:max_dialog_rounds",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"value": 0,
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote",
|
||||
"valueDesc": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "stringQuoteText",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"label": "文档引用",
|
||||
"debugLabel": "文档引用",
|
||||
"description": "app:document_quote_tip",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"toolDescription": "用户问题",
|
||||
"required": true,
|
||||
"value": ["gALvyJcXPoep", "qLUQfhG0ILRX"],
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"required": true,
|
||||
"label": "common:core.module.output.label.New context",
|
||||
"description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
|
||||
"valueType": "chatHistory",
|
||||
"valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"required": true,
|
||||
"label": "common:core.module.output.label.Ai response content",
|
||||
"description": "将在 stream 回复完毕后触发",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "jmSiT6OXA3Fe",
|
||||
"name": "飞书机器人 webhook",
|
||||
"intro": "向飞书机器人发起 webhook 请求。",
|
||||
"avatar": "/appMarketTemplates/plugin-feishu/avatar.svg",
|
||||
"flowNodeType": "pluginModule",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 4682.428295424065,
|
||||
"y": 120.04658236877646
|
||||
},
|
||||
"version": "488",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_forbid_stream",
|
||||
"renderTypeList": ["switch"],
|
||||
"valueType": "boolean",
|
||||
"label": "禁用流输出",
|
||||
"description": "强制设置嵌套运行的应用,均以非流模式运行",
|
||||
"value": true,
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"selectedTypeIndex": 0,
|
||||
"valueType": "string",
|
||||
"canEdit": false,
|
||||
"key": "content",
|
||||
"label": "content",
|
||||
"description": "需要发送的消息",
|
||||
"required": true,
|
||||
"toolDescription": "需要发送的消息",
|
||||
"value": ["aLrp6IjV8zAf", "answerText"],
|
||||
"valueDesc": "",
|
||||
"debugLabel": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["input"],
|
||||
"selectedTypeIndex": 0,
|
||||
"valueType": "string",
|
||||
"canEdit": false,
|
||||
"key": "hook_url",
|
||||
"label": "hook_url",
|
||||
"description": "飞书机器人地址",
|
||||
"required": true,
|
||||
"defaultValue": "",
|
||||
"value": "https://www.feishu.cn/flow/api/trigger-webhook/5a1657d6f024c639e1e9af4d9d611292",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "result",
|
||||
"type": "static",
|
||||
"key": "result",
|
||||
"valueType": "object",
|
||||
"label": "result",
|
||||
"description": "",
|
||||
"valueDesc": ""
|
||||
}
|
||||
],
|
||||
"pluginId": "community-feishu"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "jVGuKrDfFTU6",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "jVGuKrDfFTU6-target-left"
|
||||
},
|
||||
{
|
||||
"source": "jVGuKrDfFTU6",
|
||||
"target": "jyftFRrd4RQf",
|
||||
"sourceHandle": "jVGuKrDfFTU6-source-right",
|
||||
"targetHandle": "jyftFRrd4RQf-target-left"
|
||||
},
|
||||
{
|
||||
"source": "jyftFRrd4RQf",
|
||||
"target": "mCaalLpFoZFk",
|
||||
"sourceHandle": "jyftFRrd4RQf-source-right",
|
||||
"targetHandle": "mCaalLpFoZFk-target-left"
|
||||
},
|
||||
{
|
||||
"source": "mCaalLpFoZFk",
|
||||
"target": "gALvyJcXPoep",
|
||||
"sourceHandle": "mCaalLpFoZFk-source-right",
|
||||
"targetHandle": "gALvyJcXPoep-target-left"
|
||||
},
|
||||
{
|
||||
"source": "gALvyJcXPoep",
|
||||
"target": "aLrp6IjV8zAf",
|
||||
"sourceHandle": "gALvyJcXPoep-source-right",
|
||||
"targetHandle": "aLrp6IjV8zAf-target-left"
|
||||
},
|
||||
{
|
||||
"source": "aLrp6IjV8zAf",
|
||||
"target": "jmSiT6OXA3Fe",
|
||||
"sourceHandle": "aLrp6IjV8zAf-source-right",
|
||||
"targetHandle": "jmSiT6OXA3Fe-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"variables": [],
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
},
|
||||
"_id": "67152011bb78889107c3a4ec"
|
||||
}
|
||||
}
|
||||
}
|
||||
443
packages/templates/src/google/template.json
Normal file
@@ -0,0 +1,443 @@
|
||||
{
|
||||
"name": "谷歌搜索",
|
||||
"intro": "通过请求谷歌搜索,查询相关内容作为模型的参考。",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/google",
|
||||
"tags": ["recommendation", "web-search"],
|
||||
"type": "advanced",
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 262.2732338817093,
|
||||
"y": -476.00241136598146
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "core.app.Chat Variable",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "any",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "core.app.Question Guide",
|
||||
"value": {
|
||||
"open": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"type": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"open": false,
|
||||
"autoSend": false,
|
||||
"autoTTSResponse": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 295.8944548701009,
|
||||
"y": 110.81336038514848
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "NOgbnBzUwDgT",
|
||||
"name": "工具调用",
|
||||
"intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。",
|
||||
"avatar": "/imgs/workflow/tool.svg",
|
||||
"flowNodeType": "tools",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1028.8358722416106,
|
||||
"y": -500.8755882990822
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"llmModelType": "all",
|
||||
"value": "FastAI-plus"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 2000,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"description": "最多携带多少轮对话记录",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"value": ["448745", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "NodeOutputKeyEnum.answerText",
|
||||
"key": "NodeOutputKeyEnum.answerText",
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "GMELVPxHfpg5",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "调用谷歌搜索,查询相关内容",
|
||||
"avatar": "/imgs/workflow/http.png",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1005.4777753640342,
|
||||
"y": 319.4905539380939
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "core.module.input.description.HTTP Dynamic Input"
|
||||
},
|
||||
{
|
||||
"valueType": "string",
|
||||
"renderTypeList": ["reference"],
|
||||
"key": "query",
|
||||
"label": "query",
|
||||
"toolDescription": "谷歌搜索检索词",
|
||||
"required": true,
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"description": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "GET",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "https://www.googleapis.com/customsearch/v1"
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"description": "core.module.input.description.Http Request Header",
|
||||
"placeholder": "core.module.input.description.Http Request Header",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [
|
||||
{
|
||||
"key": "q",
|
||||
"type": "string",
|
||||
"value": "{{query}}"
|
||||
},
|
||||
{
|
||||
"key": "cx",
|
||||
"type": "string",
|
||||
"value": "谷歌搜索cxID"
|
||||
},
|
||||
{
|
||||
"key": "key",
|
||||
"type": "string",
|
||||
"value": "谷歌搜索key"
|
||||
},
|
||||
{
|
||||
"key": "c2coff",
|
||||
"type": "string",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"key": "start",
|
||||
"type": "string",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"key": "end",
|
||||
"type": "string",
|
||||
"value": "20"
|
||||
},
|
||||
{
|
||||
"key": "dateRestrict",
|
||||
"type": "string",
|
||||
"value": "m[1]"
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": "",
|
||||
"label": "",
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"label": "原始响应",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "M5YmxaYe8em1",
|
||||
"type": "dynamic",
|
||||
"key": "prompt",
|
||||
"valueType": "string",
|
||||
"label": "prompt"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "poIbrrA8aiR0",
|
||||
"name": "代码运行",
|
||||
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
|
||||
"avatar": "/imgs/workflow/code.svg",
|
||||
"flowNodeType": "code",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1711.805344753384,
|
||||
"y": 650.1023414708576
|
||||
},
|
||||
"version": "482",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "这些变量会作为代码的运行的输入参数",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "data",
|
||||
"valueType": "object",
|
||||
"label": "data",
|
||||
"renderTypeList": ["reference"],
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"value": ["GMELVPxHfpg5", "httpRawResponse"]
|
||||
},
|
||||
{
|
||||
"key": "codeType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": "js"
|
||||
},
|
||||
{
|
||||
"key": "code",
|
||||
"renderTypeList": ["custom"],
|
||||
"label": "",
|
||||
"value": "function main({data}){\n const result = data.items.map((item) => ({\n title: item.title,\n link: item.link,\n snippet: item.snippet\n }))\n return { prompt: JSON.stringify(result) }\n}"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"description": "将代码中 return 的对象作为输出,传递给后续的节点"
|
||||
},
|
||||
{
|
||||
"id": "system_rawResponse",
|
||||
"key": "system_rawResponse",
|
||||
"label": "完整响应数据",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "运行错误",
|
||||
"description": "代码运行错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "qLUQfhG0ILRX",
|
||||
"type": "dynamic",
|
||||
"key": "prompt",
|
||||
"valueType": "string",
|
||||
"label": "prompt"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "NOgbnBzUwDgT",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "NOgbnBzUwDgT-target-left"
|
||||
},
|
||||
{
|
||||
"source": "NOgbnBzUwDgT",
|
||||
"target": "GMELVPxHfpg5",
|
||||
"sourceHandle": "selectedTools",
|
||||
"targetHandle": "selectedTools"
|
||||
},
|
||||
{
|
||||
"source": "GMELVPxHfpg5",
|
||||
"target": "poIbrrA8aiR0",
|
||||
"sourceHandle": "GMELVPxHfpg5-source-right",
|
||||
"targetHandle": "poIbrrA8aiR0-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
2161
packages/templates/src/longTranslate/template.json
Normal file
330
packages/templates/src/plugin-dalle/template.json
Normal file
@@ -0,0 +1,330 @@
|
||||
{
|
||||
"name": "Dalle3 绘图",
|
||||
"intro": "通过请求 Dalle3 接口绘图,需要有 api key",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/plugin-dalle",
|
||||
"type": "plugin",
|
||||
"tags": ["recommendation", "image-generation"],
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "pluginInput",
|
||||
"name": "插件开始",
|
||||
"intro": "可以配置插件需要哪些输入,利用这些输入来运行插件",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "pluginInput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 421.97302886868476,
|
||||
"y": -89.7785530936485
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"selectedTypeIndex": 0,
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "绘图提示词",
|
||||
"label": "绘图提示词",
|
||||
"description": "绘图提示词",
|
||||
"required": true,
|
||||
"toolDescription": "绘图提示词"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "绘图提示词",
|
||||
"valueType": "string",
|
||||
"key": "绘图提示词",
|
||||
"label": "绘图提示词",
|
||||
"type": "hidden"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "pluginOutput",
|
||||
"name": "插件输出",
|
||||
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
|
||||
"avatar": "core/workflow/template/pluginOutput",
|
||||
"flowNodeType": "pluginOutput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1785.9300180845394,
|
||||
"y": -108.2785530936485
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "图片访问链接",
|
||||
"label": "图片访问链接",
|
||||
"description": "",
|
||||
"value": ["tMvel910bnrJ", "pJXgWoTpPoMy"]
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "object",
|
||||
"canEdit": true,
|
||||
"key": "error",
|
||||
"label": "错误信息",
|
||||
"description": "",
|
||||
"value": ["tMvel910bnrJ", "error"]
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "tMvel910bnrJ",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||
"avatar": "core/workflow/template/httpRequest",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1044.8838211811253,
|
||||
"y": -414.7785530936485
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "common:core.module.input.description.HTTP Dynamic Input",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "POST",
|
||||
"required": true,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpTimeout",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "number",
|
||||
"label": "",
|
||||
"value": 30,
|
||||
"min": 5,
|
||||
"max": 600,
|
||||
"required": true,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "https://api.openai.com/v1/images/generations",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"value": [
|
||||
{
|
||||
"key": "Authorization",
|
||||
"type": "string",
|
||||
"value": "Bearer {{authorization}}"
|
||||
}
|
||||
],
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Header",
|
||||
"placeholder": "common:core.module.input.description.Http Request Header",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": "{\n \"model\": \"dall-e-3\",\n \"prompt\": \"{{prompt}}\",\n \"n\": 1,\n \"size\": \"1024x1024\"\n}",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpFormBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpContentType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"value": "json",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "prompt",
|
||||
"label": "prompt",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"required": true,
|
||||
"value": ["pluginInput", "绘图提示词"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:request_error",
|
||||
"description": "HTTP请求错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"required": true,
|
||||
"label": "workflow:raw_response",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "pJXgWoTpPoMy",
|
||||
"valueType": "string",
|
||||
"type": "dynamic",
|
||||
"key": "data[0].url",
|
||||
"label": "data[0].url"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "c7tRU2qAQoAf",
|
||||
"name": "系统配置",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "pluginConfig",
|
||||
"position": {
|
||||
"x": -46.476647046261974,
|
||||
"y": -89.7785530936485
|
||||
},
|
||||
"version": "4811",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "pluginInput",
|
||||
"target": "tMvel910bnrJ",
|
||||
"sourceHandle": "pluginInput-source-right",
|
||||
"targetHandle": "tMvel910bnrJ-target-left"
|
||||
},
|
||||
{
|
||||
"source": "tMvel910bnrJ",
|
||||
"target": "pluginOutput",
|
||||
"sourceHandle": "tMvel910bnrJ-source-right",
|
||||
"targetHandle": "pluginOutput-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
355
packages/templates/src/plugin-feishu/template.json
Normal file
@@ -0,0 +1,355 @@
|
||||
{
|
||||
"name": "飞书 webhook 插件",
|
||||
"intro": "通过 webhook 给飞书机器人发送一条消息",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/plugin-feishu",
|
||||
"type": "plugin",
|
||||
"tags": ["recommendation", "office-services"],
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "pluginInput",
|
||||
"name": "插件开始",
|
||||
"intro": "自定义配置外部输入,使用插件时,仅暴露自定义配置的输入",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "pluginInput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 535.7465806305546,
|
||||
"y": -201.26482361861054
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"inputType": "input",
|
||||
"valueType": "string",
|
||||
"key": "飞书机器人地址",
|
||||
"label": "飞书机器人地址",
|
||||
"description": "",
|
||||
"isToolInput": false,
|
||||
"defaultValue": "",
|
||||
"editField": {
|
||||
"key": true
|
||||
},
|
||||
"dynamicParamDefaultValue": {
|
||||
"inputType": "reference",
|
||||
"valueType": "string",
|
||||
"required": true
|
||||
},
|
||||
"renderTypeList": ["input"],
|
||||
"required": true,
|
||||
"canEdit": true,
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "发送的消息",
|
||||
"valueType": "string",
|
||||
"label": "发送的消息",
|
||||
"renderTypeList": ["reference"],
|
||||
"required": true,
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"value": "",
|
||||
"editField": {
|
||||
"key": true
|
||||
},
|
||||
"dynamicParamDefaultValue": {
|
||||
"inputType": "reference",
|
||||
"valueType": "string",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "mv52BrPVE6bm",
|
||||
"key": "飞书机器人地址",
|
||||
"valueType": "string",
|
||||
"label": "飞书机器人地址",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "p0m68Dv5KaIp",
|
||||
"key": "发送的消息",
|
||||
"valueType": "string",
|
||||
"label": "发送的消息",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "pluginOutput",
|
||||
"name": "插件输出",
|
||||
"intro": "自定义配置外部输出,使用插件时,仅暴露自定义配置的输出",
|
||||
"avatar": "core/workflow/template/pluginOutput",
|
||||
"flowNodeType": "pluginOutput",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1776.027569211593,
|
||||
"y": -58.264823618610535
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "rKBYGQuYefae",
|
||||
"name": "HTTP 请求",
|
||||
"intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",
|
||||
"avatar": "core/workflow/template/httpRequest",
|
||||
"flowNodeType": "httpRequest468",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1069.7228495148624,
|
||||
"y": -392.26482361861054
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "common:core.module.input.description.HTTP Dynamic Input",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpMethod",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"value": "POST",
|
||||
"required": true,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpTimeout",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "number",
|
||||
"label": "",
|
||||
"value": 30,
|
||||
"min": 5,
|
||||
"max": 600,
|
||||
"required": true,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpReqUrl",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Url",
|
||||
"placeholder": "https://api.ai.com/getInventory",
|
||||
"required": false,
|
||||
"value": "{{url}}",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpHeader",
|
||||
"renderTypeList": ["custom"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"description": "common:core.module.input.description.Http Request Header",
|
||||
"placeholder": "common:core.module.input.description.Http Request Header",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpParams",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpJsonBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": "{\r\n \"msg_type\": \"text\",\r\n \"content\": {\r\n \"text\": \"{{text}}\"\r\n }\r\n}",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpFormBody",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"value": [],
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "system_httpContentType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"value": "json",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "text",
|
||||
"valueType": "string",
|
||||
"label": "text",
|
||||
"renderTypeList": ["reference"],
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"value": ["pluginInput", "p0m68Dv5KaIp"],
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "url",
|
||||
"valueType": "string",
|
||||
"label": "url",
|
||||
"renderTypeList": ["reference"],
|
||||
"description": "",
|
||||
"canEdit": true,
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
},
|
||||
"value": ["pluginInput", "mv52BrPVE6bm"],
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:request_error",
|
||||
"description": "HTTP请求错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "httpRawResponse",
|
||||
"key": "httpRawResponse",
|
||||
"required": true,
|
||||
"label": "workflow:raw_response",
|
||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
||||
"valueType": "any",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"editField": {
|
||||
"key": true,
|
||||
"valueType": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "q3ccNXiZIHoS",
|
||||
"name": "系统配置",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "pluginConfig",
|
||||
"position": {
|
||||
"x": 99.73879703925843,
|
||||
"y": -201.26482361861054
|
||||
},
|
||||
"version": "4811",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "pluginInput",
|
||||
"target": "rKBYGQuYefae",
|
||||
"sourceHandle": "pluginInput-source-right",
|
||||
"targetHandle": "rKBYGQuYefae-target-left"
|
||||
},
|
||||
{
|
||||
"source": "rKBYGQuYefae",
|
||||
"target": "pluginOutput",
|
||||
"sourceHandle": "rKBYGQuYefae-source-right",
|
||||
"targetHandle": "pluginOutput-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
288
packages/templates/src/simpleDatasetChat/template.json
Normal file
@@ -0,0 +1,288 @@
|
||||
{
|
||||
"name": "知识库+对话引导",
|
||||
"intro": "每次提问时进行一次知识库搜索,将搜索结果注入 LLM 模型进行参考回答",
|
||||
"author": "",
|
||||
"avatar": "core/workflow/template/datasetSearch",
|
||||
"type": "simple",
|
||||
"tags": ["office-services"],
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 531.2422736065552,
|
||||
"y": -486.7611729549753
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "workflowStartNodeId",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 558.4082376415505,
|
||||
"y": 123.72387429194112
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.reference", "FlowNodeInputTypeEnum.textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "7BdojPlukIQw",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "core/workflow/template/aiChat",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1638.509551404687,
|
||||
"y": -341.0428450861567
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": [
|
||||
"FlowNodeInputTypeEnum.settingLLMModel",
|
||||
"FlowNodeInputTypeEnum.reference"
|
||||
],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"value": 3,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"value": 1950,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"value": true,
|
||||
"valueType": "boolean"
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.textarea", "FlowNodeInputTypeEnum.reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": [
|
||||
"FlowNodeInputTypeEnum.numberInput",
|
||||
"FlowNodeInputTypeEnum.reference"
|
||||
],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.reference", "FlowNodeInputTypeEnum.textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"value": ["workflowStartNodeId", "userChatInput"]
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote",
|
||||
"value": ["iKBoX2vIzETU", "quoteQA"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"label": "core.module.output.label.New context",
|
||||
"description": "core.module.output.description.New context",
|
||||
"valueType": "chatHistory",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content",
|
||||
"valueType": "string",
|
||||
"type": "FlowNodeOutputTypeEnum.static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "iKBoX2vIzETU",
|
||||
"name": "知识库搜索",
|
||||
"intro": "调用\"语义检索\"和\"全文检索\"能力,从\"知识库\"中查找可能与问题相关的参考内容",
|
||||
"avatar": "core/workflow/template/datasetSearch",
|
||||
"flowNodeType": "datasetSearchNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 918.5901682164496,
|
||||
"y": -227.11542247619582
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "datasets",
|
||||
"renderTypeList": [
|
||||
"FlowNodeInputTypeEnum.selectDataset",
|
||||
"FlowNodeInputTypeEnum.reference"
|
||||
],
|
||||
"label": "core.module.input.label.Select dataset",
|
||||
"value": [],
|
||||
"valueType": "selectDataset",
|
||||
"list": [],
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"key": "similarity",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.selectDatasetParamsModal"],
|
||||
"label": "",
|
||||
"value": 0.4,
|
||||
"valueType": "number"
|
||||
},
|
||||
{
|
||||
"key": "limit",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 1500,
|
||||
"valueType": "number"
|
||||
},
|
||||
{
|
||||
"key": "searchMode",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": "embedding"
|
||||
},
|
||||
{
|
||||
"key": "usingReRank",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"key": "datasetSearchUsingExtensionQuery",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"key": "datasetSearchExtensionModel",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string"
|
||||
},
|
||||
{
|
||||
"key": "datasetSearchExtensionBg",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["FlowNodeInputTypeEnum.reference", "FlowNodeInputTypeEnum.textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "需要检索的内容",
|
||||
"value": ["workflowStartNodeId", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "quoteQA",
|
||||
"key": "quoteQA",
|
||||
"label": "core.module.Dataset quote.label",
|
||||
"type": "FlowNodeOutputTypeEnum.static",
|
||||
"valueType": "datasetQuote",
|
||||
"description": "特殊数组格式,搜索结果为空时,返回空数组。"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "workflowStartNodeId",
|
||||
"target": "iKBoX2vIzETU",
|
||||
"sourceHandle": "workflowStartNodeId-source-right",
|
||||
"targetHandle": "iKBoX2vIzETU-target-left"
|
||||
},
|
||||
{
|
||||
"source": "iKBoX2vIzETU",
|
||||
"target": "7BdojPlukIQw",
|
||||
"sourceHandle": "iKBoX2vIzETU-source-right",
|
||||
"targetHandle": "7BdojPlukIQw-target-left"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
1934
packages/templates/src/srt-translate/template.json
Normal file
503
packages/templates/src/stock/template.json
Normal file
@@ -0,0 +1,503 @@
|
||||
{
|
||||
"name": "利好大A",
|
||||
"intro": "",
|
||||
"author": "",
|
||||
"avatar": "core/app/templates/stock",
|
||||
"tags": ["roleplay"],
|
||||
"type": "advanced",
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "common:core.module.template.system_config",
|
||||
"intro": "common:core.module.template.system_config_info",
|
||||
"avatar": "core/workflow/template/systemConfig",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 262.2732338817093,
|
||||
"y": -476.00241136598146
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "welcomeText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "string",
|
||||
"label": "core.app.Welcome Text",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "variables",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "core.app.Chat Variable",
|
||||
"value": []
|
||||
},
|
||||
{
|
||||
"key": "questionGuide",
|
||||
"valueType": "any",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "core.app.Question Guide",
|
||||
"value": {
|
||||
"open": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tts",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"type": "web"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "whisper",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": {
|
||||
"open": false,
|
||||
"autoSend": false,
|
||||
"autoTTSResponse": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "scheduleTrigger",
|
||||
"renderTypeList": ["hidden"],
|
||||
"valueType": "any",
|
||||
"label": "",
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "448745",
|
||||
"name": "common:core.module.template.work_start",
|
||||
"intro": "",
|
||||
"avatar": "core/workflow/template/workflowStart",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 632.368838596004,
|
||||
"y": -347.7446492944009
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "common:core.module.input.label.user question",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"debugLabel": ""
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "common:core.module.input.label.user question",
|
||||
"type": "static",
|
||||
"valueType": "string",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "bg853CwHAw4a",
|
||||
"name": "AI 对话",
|
||||
"intro": "AI 大模型对话",
|
||||
"avatar": "core/workflow/template/aiChat",
|
||||
"flowNodeType": "chatNode",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1318.728987052518,
|
||||
"y": -612.0024113659815
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "AI 模型",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "claude-3-5-sonnet-20240620"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 4000,
|
||||
"valueType": "number",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "isResponseAnswerText",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": false,
|
||||
"valueType": "boolean",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "aiChatQuoteRole",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"value": "system",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quoteTemplate",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quotePrompt",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "aiChatVision",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"valueType": "boolean",
|
||||
"value": false,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "提示词",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "{提示词 START:\n;; 作者: 李继刚\n;; 版本: 0.1\n;; 模型: Claude Sonnet\n;; 用途: 这事呀, 利好我大A!\n\n;; 设定如下内容为你的 *System Prompt*\n(require 'dash)\n\n(defun 韮菜 ()\n \"典型股民形象\"\n (list (经历 . '(亏损累累 频繁交易 追涨杀跌))\n (性格 . '(冲动 乐观 侥幸))\n (技能 . '(看K线 炒概念 追热点))\n (信念 . '(暴富梦想 政策利好 抄底反弹))\n (表达 . '(股评口号 情绪化 群体性))))\n\n(defun 利好大A (用户输入)\n \"任何消息都必将利好我大A股\"\n (let* ((解读 (-> 用户输入\n 提取关键词\n 生成关联概念\n 分析影响\n ;; 强行联系股市,无论多牵强\n 强行关联A 股\n ;; 乐观解读一切影响\n 乐观解读))\n (响应 (随机结论)))\n (SVG-Card 用户输入 解读 响应))\n\n (defun 随机结论 ()\n (随机选择\n '(\"这事呀,利好大A!\"\n \"A股有戏啊!\"\n \"这还不得跑步进场啊!\"\n \"还傻站在这干嘛? 快打开手机加仓啊!\"\n \"看来A股要起飞了!\"\n \"大A要发财了!\")))\n\n\n (defun SVG-Card (用户输入 响应)\n \"创建富洞察力且具有审美的 SVG 概念可视化\"\n (let ((配置 '(:画布 (480 . 760)\n :色彩 (:背景 \"#000000\"\n :主要文字 \"#ffffff\"\n :次要文字 \"#00cc00\"\n :图形 \"#00ff00\")\n :排版 \"杂志风格\"\n :字体 (使用本机字体 (font-family \"KingHwa_OldSong\")))))\n (-> 用户输入\n 关键画面\n 立体主义\n (极简图形 配置)\n (布局 `(,(标题 \"利好大A\") 分隔线 用户输入 图形\n (逻辑链推导 解读) 响应))))\n\n\n (defun start ()\n \"启动时运行, 你是韮菜~\"\n (let (system-role (韮菜))\n (print \"又有啥好消息了? 现在加仓还来得及吗?\")))\n\n;;; Attention: 运行规则!\n;; 1. 初次启动时必须只运行 (start) 函数\n;; 2. 接收用户输入之后, 调用主函数 (利好大A 用户输入)\n;; 3. 严格按照(SVG-Card) 进行排版输出\n;; 4. 输出SVG 后, 不再输出任何额外文字解释\n提示词 END}\n\n(直接生成 svg 完整代码,我会复制,需要你用代码块)\n(除此之外不要有多余的解释,不要在开头加上任何说明)\n解释的内容自动加入换行标签,例如:\n<tspan x=\"50%\" dy=\"25\" font-size=\"18\" fill=\"#8B4513\">文字1,</tspan>\n <tspan x=\"50%\" dy=\"25\" font-size=\"18\" fill=\"#8B4513\">文字12,</tspan>"
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "聊天记录",
|
||||
"description": "workflow:max_dialog_rounds",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 50,
|
||||
"value": 0,
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "quoteQA",
|
||||
"renderTypeList": ["settingDatasetQuotePrompt"],
|
||||
"label": "",
|
||||
"debugLabel": "知识库引用",
|
||||
"description": "",
|
||||
"valueType": "datasetQuote",
|
||||
"valueDesc": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "stringQuoteText",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"label": "文档引用",
|
||||
"debugLabel": "文档引用",
|
||||
"description": "app:document_quote_tip",
|
||||
"valueType": "string",
|
||||
"valueDesc": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"value": ["448745", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "history",
|
||||
"key": "history",
|
||||
"required": true,
|
||||
"label": "common:core.module.output.label.New context",
|
||||
"description": "将本次回复内容拼接上历史记录,作为新的上下文返回",
|
||||
"valueType": "chatHistory",
|
||||
"valueDesc": "{\n obj: System | Human | AI;\n value: string;\n}[]",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"required": true,
|
||||
"label": "common:core.module.output.label.Ai response content",
|
||||
"description": "将在 stream 回复完毕后触发",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "sbVUb0efY6Fm",
|
||||
"name": "代码运行",
|
||||
"intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",
|
||||
"avatar": "core/workflow/template/codeRun",
|
||||
"flowNodeType": "code",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 2210.2574140398733,
|
||||
"y": -621.0024113659815
|
||||
},
|
||||
"version": "482",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "system_addInputParam",
|
||||
"renderTypeList": ["addInputParam"],
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"required": false,
|
||||
"description": "workflow:these_variables_will_be_input_parameters_for_code_execution",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "codeType",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": "js",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"key": "code",
|
||||
"renderTypeList": ["custom"],
|
||||
"label": "",
|
||||
"value": "function main({svg_str}){\n\n // 使用正则表达式匹配代码块中的内容\n const match = svg_str.match(/```[\\w]*\\n([\\s\\S]*?)```/);\n\n if (!match) {\n // 如果没有匹配到代码块,返回一个错误信息或空结果\n return {\n result: null,\n error: \"未找到有效的代码块标记。\"\n };\n }\n\n // 提取代码块中的 SVG 内容\n const extractedSvg = match[1].trim();\n \n const base64 = strToBase64(extractedSvg,'data:image/svg+xml;base64,')\n\n return {\n result: base64\n }\n}",
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": ""
|
||||
},
|
||||
{
|
||||
"renderTypeList": ["reference"],
|
||||
"valueType": "string",
|
||||
"canEdit": true,
|
||||
"key": "svg_str",
|
||||
"label": "svg_str",
|
||||
"customInputConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"arrayAny",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": true
|
||||
},
|
||||
"required": true,
|
||||
"valueDesc": "",
|
||||
"description": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": ["bg853CwHAw4a", "answerText"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "system_rawResponse",
|
||||
"key": "system_rawResponse",
|
||||
"label": "workflow:full_response_data",
|
||||
"valueType": "object",
|
||||
"type": "static",
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"id": "error",
|
||||
"key": "error",
|
||||
"label": "workflow:execution_error",
|
||||
"description": "代码运行错误信息,成功时返回空",
|
||||
"valueType": "object",
|
||||
"type": "static"
|
||||
},
|
||||
{
|
||||
"id": "system_addOutputParam",
|
||||
"key": "system_addOutputParam",
|
||||
"type": "dynamic",
|
||||
"valueType": "dynamic",
|
||||
"label": "",
|
||||
"customFieldConfig": {
|
||||
"selectValueTypeList": [
|
||||
"string",
|
||||
"number",
|
||||
"boolean",
|
||||
"object",
|
||||
"arrayString",
|
||||
"arrayNumber",
|
||||
"arrayBoolean",
|
||||
"arrayObject",
|
||||
"any",
|
||||
"chatHistory",
|
||||
"datasetQuote",
|
||||
"dynamic",
|
||||
"selectApp",
|
||||
"selectDataset"
|
||||
],
|
||||
"showDescription": false,
|
||||
"showDefaultValue": false
|
||||
},
|
||||
"description": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
|
||||
"valueDesc": ""
|
||||
},
|
||||
{
|
||||
"id": "qLUQfhG0ILRX",
|
||||
"type": "dynamic",
|
||||
"key": "result",
|
||||
"valueType": "string",
|
||||
"label": "result",
|
||||
"valueDesc": "",
|
||||
"description": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "cPh2VZnVxjQ8",
|
||||
"name": "指定回复",
|
||||
"intro": "该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。",
|
||||
"avatar": "core/workflow/template/reply",
|
||||
"flowNodeType": "answerNode",
|
||||
"position": {
|
||||
"x": 2911.2230784647795,
|
||||
"y": -411.6915940628763
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "text",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"valueType": "any",
|
||||
"required": true,
|
||||
"label": "回复的内容",
|
||||
"description": "common:core.module.input.description.Response content",
|
||||
"placeholder": "common:core.module.input.description.Response content",
|
||||
"valueDesc": "",
|
||||
"debugLabel": "",
|
||||
"toolDescription": "",
|
||||
"value": "SVG:\n\n{{$bg853CwHAw4a.answerText$}}\n\n卡片:\n\n"
|
||||
}
|
||||
],
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "bg853CwHAw4a",
|
||||
"target": "sbVUb0efY6Fm",
|
||||
"sourceHandle": "bg853CwHAw4a-source-right",
|
||||
"targetHandle": "sbVUb0efY6Fm-target-left"
|
||||
},
|
||||
{
|
||||
"source": "448745",
|
||||
"target": "bg853CwHAw4a",
|
||||
"sourceHandle": "448745-source-right",
|
||||
"targetHandle": "bg853CwHAw4a-target-left"
|
||||
},
|
||||
{
|
||||
"source": "sbVUb0efY6Fm",
|
||||
"target": "cPh2VZnVxjQ8",
|
||||
"sourceHandle": "sbVUb0efY6Fm-source-right",
|
||||
"targetHandle": "cPh2VZnVxjQ8-target-left"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"variables": [],
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
},
|
||||
"_id": "66f0f7540a40cd1f97da9dd6"
|
||||
}
|
||||
}
|
||||
}
|
||||
186
packages/templates/src/timeBot/template.json
Normal file
@@ -0,0 +1,186 @@
|
||||
{
|
||||
"name": "知道时间的机器人",
|
||||
"intro": "通过挂载时间插件,让模型获取当前最新时间",
|
||||
"author": "",
|
||||
"avatar": "core/workflow/template/getTime",
|
||||
"tags": ["recommendation", "roleplay"],
|
||||
"type": "simple",
|
||||
"weight": 1,
|
||||
"workflow": {
|
||||
"nodes": [
|
||||
{
|
||||
"nodeId": "userGuide",
|
||||
"name": "系统配置",
|
||||
"intro": "可以配置应用的系统参数",
|
||||
"avatar": "/imgs/workflow/userGuide.png",
|
||||
"flowNodeType": "userGuide",
|
||||
"position": {
|
||||
"x": 531.2422736065552,
|
||||
"y": -486.7611729549753
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [],
|
||||
"outputs": []
|
||||
},
|
||||
{
|
||||
"nodeId": "workflowStartNodeId",
|
||||
"name": "流程开始",
|
||||
"intro": "",
|
||||
"avatar": "/imgs/workflow/userChatInput.svg",
|
||||
"flowNodeType": "workflowStart",
|
||||
"position": {
|
||||
"x": 558.4082376415505,
|
||||
"y": 123.72387429194112
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"toolDescription": "用户问题"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "userChatInput",
|
||||
"key": "userChatInput",
|
||||
"label": "core.module.input.label.user question",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "jrWPV9",
|
||||
"name": "工具调用",
|
||||
"intro": "通过AI模型自动选择一个或多个功能块进行调用,也可以对插件进行调用。",
|
||||
"avatar": "/imgs/workflow/tool.svg",
|
||||
"flowNodeType": "tools",
|
||||
"showStatus": true,
|
||||
"position": {
|
||||
"x": 1062.1738942532802,
|
||||
"y": -223.65033022650476
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [
|
||||
{
|
||||
"key": "model",
|
||||
"renderTypeList": ["settingLLMModel", "reference"],
|
||||
"label": "core.module.input.label.aiModel",
|
||||
"valueType": "string",
|
||||
"llmModelType": "all",
|
||||
"value": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"key": "temperature",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 0,
|
||||
"valueType": "number",
|
||||
"min": 0,
|
||||
"max": 10,
|
||||
"step": 1
|
||||
},
|
||||
{
|
||||
"key": "maxToken",
|
||||
"renderTypeList": ["hidden"],
|
||||
"label": "",
|
||||
"value": 2000,
|
||||
"valueType": "number",
|
||||
"min": 100,
|
||||
"max": 4000,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"key": "systemPrompt",
|
||||
"renderTypeList": ["textarea", "reference"],
|
||||
"max": 3000,
|
||||
"valueType": "string",
|
||||
"label": "core.ai.Prompt",
|
||||
"description": "core.app.tip.systemPromptTip",
|
||||
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "history",
|
||||
"renderTypeList": ["numberInput", "reference"],
|
||||
"valueType": "chatHistory",
|
||||
"label": "core.module.input.label.chat history",
|
||||
"description": "最多携带多少轮对话记录",
|
||||
"required": true,
|
||||
"min": 0,
|
||||
"max": 30,
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "userChatInput",
|
||||
"renderTypeList": ["reference", "textarea"],
|
||||
"valueType": "string",
|
||||
"label": "用户问题",
|
||||
"required": true,
|
||||
"value": ["workflowStartNodeId", "userChatInput"]
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "answerText",
|
||||
"key": "answerText",
|
||||
"label": "core.module.output.label.Ai response content",
|
||||
"description": "core.module.output.description.Ai response content",
|
||||
"valueType": "string",
|
||||
"type": "static"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"nodeId": "zBxjo5",
|
||||
"name": "获取当前时间",
|
||||
"intro": "获取用户当前时区的时间。",
|
||||
"avatar": "/imgs/workflow/getCurrentTime.svg",
|
||||
"flowNodeType": "pluginModule",
|
||||
"showStatus": false,
|
||||
"position": {
|
||||
"x": 1000,
|
||||
"y": 545
|
||||
},
|
||||
"version": "481",
|
||||
"inputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"id": "time",
|
||||
"type": "static",
|
||||
"key": "time",
|
||||
"valueType": "string",
|
||||
"label": "time",
|
||||
"description": ""
|
||||
}
|
||||
],
|
||||
"pluginId": "community-getTime"
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"source": "workflowStartNodeId",
|
||||
"target": "jrWPV9",
|
||||
"sourceHandle": "workflowStartNodeId-source-right",
|
||||
"targetHandle": "jrWPV9-target-left"
|
||||
},
|
||||
{
|
||||
"source": "jrWPV9",
|
||||
"target": "zBxjo5",
|
||||
"sourceHandle": "selectedTools",
|
||||
"targetHandle": "selectedTools"
|
||||
}
|
||||
],
|
||||
"chatConfig": {
|
||||
"scheduledTriggerConfig": {
|
||||
"cronString": "",
|
||||
"timezone": "Asia/Shanghai",
|
||||
"defaultPrompt": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
packages/templates/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2015",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"baseUrl": "."
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts", "../**/*.d.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
5
packages/templates/type.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { AppTemplateSchemaType } from '@fastgpt/global/core/app/type';
|
||||
|
||||
declare global {
|
||||
var appTemplates: AppTemplateSchemaType[];
|
||||
}
|
||||
@@ -28,4 +28,4 @@ const Avatar = ({ w = '30px', src, ...props }: ImageProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Avatar;
|
||||
export default React.memo(Avatar);
|
||||
|
||||
@@ -57,4 +57,4 @@ function DndDrag<T>({ children, renderClone, onDragEndCb, dataList }: Props<T>)
|
||||
);
|
||||
}
|
||||
|
||||
export default DndDrag;
|
||||
export default React.memo(DndDrag) as <T>(props: Props<T>) => React.ReactElement;
|
||||
|
||||
@@ -17,6 +17,7 @@ export const iconPaths = {
|
||||
'common/addUser': () => import('./icons/common/addUser.svg'),
|
||||
'common/administrator': () => import('./icons/common/administrator.svg'),
|
||||
'common/arrowLeft': () => import('./icons/common/arrowLeft.svg'),
|
||||
'common/arrowRight': () => import('./icons/common/arrowRight.svg'),
|
||||
'common/backFill': () => import('./icons/common/backFill.svg'),
|
||||
'common/backLight': () => import('./icons/common/backLight.svg'),
|
||||
'common/billing': () => import('./icons/common/billing.svg'),
|
||||
@@ -48,6 +49,7 @@ export const iconPaths = {
|
||||
'common/language/China': () => import('./icons/common/language/China.svg'),
|
||||
'common/language/en': () => import('./icons/common/language/en.svg'),
|
||||
'common/language/zh': () => import('./icons/common/language/zh.svg'),
|
||||
'common/layer': () => import('./icons/common/layer.svg'),
|
||||
'common/leftArrowLight': () => import('./icons/common/leftArrowLight.svg'),
|
||||
'common/line': () => import('./icons/common/line.svg'),
|
||||
'common/lineChange': () => import('./icons/common/lineChange.svg'),
|
||||
@@ -81,13 +83,16 @@ export const iconPaths = {
|
||||
'common/settingLight': () => import('./icons/common/settingLight.svg'),
|
||||
'common/solidChevronRight': () => import('./icons/common/solidChevronRight.svg'),
|
||||
'common/subtract': () => import('./icons/common/subtract.svg'),
|
||||
'common/templateMarket': () => import('./icons/common/templateMarket.svg'),
|
||||
'common/text/t': () => import('./icons/common/text/t.svg'),
|
||||
'common/thirdParty': () => import('./icons/common/thirdParty.svg'),
|
||||
'common/tickFill': () => import('./icons/common/tickFill.svg'),
|
||||
'common/toolkit': () => import('./icons/common/toolkit.svg'),
|
||||
'common/trash': () => import('./icons/common/trash.svg'),
|
||||
'common/upRightArrowLight': () => import('./icons/common/upRightArrowLight.svg'),
|
||||
'common/uploadFileFill': () => import('./icons/common/uploadFileFill.svg'),
|
||||
'common/userInfo': () => import('./icons/common/userInfo.svg'),
|
||||
'common/variable': () => import('./icons/common/variable.svg'),
|
||||
'common/viewLight': () => import('./icons/common/viewLight.svg'),
|
||||
'common/voiceLight': () => import('./icons/common/voiceLight.svg'),
|
||||
'common/warn': () => import('./icons/common/warn.svg'),
|
||||
@@ -119,6 +124,17 @@ export const iconPaths = {
|
||||
'core/app/simpleMode/tts': () => import('./icons/core/app/simpleMode/tts.svg'),
|
||||
'core/app/simpleMode/variable': () => import('./icons/core/app/simpleMode/variable.svg'),
|
||||
'core/app/simpleMode/whisper': () => import('./icons/core/app/simpleMode/whisper.svg'),
|
||||
'core/app/templates/TranslateRobot': () =>
|
||||
import('./icons/core/app/templates/TranslateRobot.svg'),
|
||||
'core/app/templates/animalLife': () => import('./icons/core/app/templates/animalLife.svg'),
|
||||
'core/app/templates/chinese': () => import('./icons/core/app/templates/chinese.svg'),
|
||||
'core/app/templates/divination': () => import('./icons/core/app/templates/divination.svg'),
|
||||
'core/app/templates/flux': () => import('./icons/core/app/templates/flux.svg'),
|
||||
'core/app/templates/githubIssue': () => import('./icons/core/app/templates/githubIssue.svg'),
|
||||
'core/app/templates/google': () => import('./icons/core/app/templates/google.svg'),
|
||||
'core/app/templates/plugin-dalle': () => import('./icons/core/app/templates/plugin-dalle.svg'),
|
||||
'core/app/templates/plugin-feishu': () => import('./icons/core/app/templates/plugin-feishu.svg'),
|
||||
'core/app/templates/stock': () => import('./icons/core/app/templates/stock.svg'),
|
||||
'core/app/toolCall': () => import('./icons/core/app/toolCall.svg'),
|
||||
'core/app/ttsFill': () => import('./icons/core/app/ttsFill.svg'),
|
||||
'core/app/type/httpPlugin': () => import('./icons/core/app/type/httpPlugin.svg'),
|
||||
@@ -376,6 +392,7 @@ export const iconPaths = {
|
||||
'price/right': () => import('./icons/price/right.svg'),
|
||||
save: () => import('./icons/save.svg'),
|
||||
stop: () => import('./icons/stop.svg'),
|
||||
'support/account/laf': () => import('./icons/support/account/laf.svg'),
|
||||
'support/account/loginoutLight': () => import('./icons/support/account/loginoutLight.svg'),
|
||||
'support/account/plans': () => import('./icons/support/account/plans.svg'),
|
||||
'support/account/promotionLight': () => import('./icons/support/account/promotionLight.svg'),
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.86193 3.5286C8.60158 3.78895 8.60158 4.21106 8.86193 4.47141L11.7239 7.33334H2.66667C2.29848 7.33334 2 7.63181 2 8C2 8.36819 2.29848 8.66667 2.66667 8.66667H11.7239L8.86193 11.5286C8.60158 11.7889 8.60158 12.2111 8.86193 12.4714C9.12228 12.7318 9.54439 12.7318 9.80474 12.4714L13.8047 8.47141C14.0651 8.21106 14.0651 7.78895 13.8047 7.5286L9.80474 3.5286C9.54439 3.26825 9.12228 3.26825 8.86193 3.5286Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 539 B |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.79789 1.3894C8.93146 1.36434 9.06853 1.36434 9.2021 1.3894C9.36089 1.41919 9.5023 1.49151 9.56594 1.52407C9.57246 1.5274 9.57817 1.53032 9.58299 1.53273L16.2556 4.86906C16.5097 4.9961 16.6702 5.2558 16.6702 5.53988C16.6702 5.82396 16.5097 6.08366 16.2556 6.2107L9.58299 9.54703C9.57817 9.54944 9.57246 9.55236 9.56594 9.5557C9.5023 9.58825 9.36089 9.66058 9.2021 9.69037C9.06853 9.71543 8.93146 9.71543 8.79789 9.69037C8.6391 9.66058 8.4977 9.58825 8.43405 9.5557C8.42753 9.55236 8.42182 9.54944 8.417 9.54703L1.74434 6.2107C1.49026 6.08366 1.32975 5.82396 1.32975 5.53988C1.32975 5.2558 1.49026 4.9961 1.74434 4.86906L8.417 1.53273C8.42182 1.53032 8.42753 1.5274 8.43405 1.52407C8.49769 1.49151 8.6391 1.41919 8.79789 1.3894ZM9 2.91829L3.7568 5.53988L9 8.16148L14.2432 5.53988L9 2.91829ZM1.40893 8.66459C1.59418 8.29411 2.04468 8.14394 2.41516 8.32918L9 11.6216L15.5848 8.32918C15.9553 8.14394 16.4058 8.29411 16.5911 8.66459C16.7763 9.03508 16.6261 9.48558 16.2556 9.67082L9.58299 13.0072C9.57817 13.0096 9.57246 13.0125 9.56594 13.0158C9.5023 13.0484 9.36089 13.1207 9.2021 13.1505C9.06853 13.1755 8.93146 13.1755 8.79789 13.1505C8.6391 13.1207 8.4977 13.0484 8.43405 13.0158C8.42753 13.0125 8.42182 13.0096 8.417 13.0072L1.74434 9.67082C1.37386 9.48558 1.22369 9.03508 1.40893 8.66459ZM1.40893 12.1247C1.59418 11.7542 2.04468 11.6041 2.41516 11.7893L9 15.0817L15.5848 11.7893C15.9553 11.6041 16.4058 11.7542 16.5911 12.1247C16.7763 12.4952 16.6261 12.9457 16.2556 13.1309L9.58299 16.4673C9.57817 16.4697 9.57247 16.4726 9.56595 16.4759C9.5023 16.5085 9.36089 16.5808 9.2021 16.6106C9.06853 16.6357 8.93146 16.6357 8.79789 16.6106C8.6391 16.5808 8.49769 16.5085 8.43405 16.4759C8.42753 16.4726 8.42182 16.4697 8.417 16.4673L1.74434 13.1309C1.37386 12.9457 1.22369 12.4952 1.40893 12.1247Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" >
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.4583 7.13094L6.60858 6.68746C6.3905 6.63518 6.16154 6.60713 5.92405 6.60713C4.3115 6.60713 3.00427 7.91436 3.00427 9.52691C3.00427 11.1395 4.3115 12.4467 5.92405 12.4467C7.24744 12.4467 8.36881 11.5651 8.72548 10.3539L9.04242 9.2776H13.8426L13.8426 3.93535L8.4583 3.93535V7.13094ZM5.4583 5.13138C3.23625 5.3641 1.50427 7.24324 1.50427 9.52691C1.50427 11.9679 3.48308 13.9467 5.92405 13.9467C7.93065 13.9467 9.62493 12.6095 10.1644 10.7776H13.8426C14.6711 10.7776 15.3426 10.106 15.3426 9.2776V3.93535C15.3426 3.10692 14.6711 2.43535 13.8426 2.43535H8.4583C7.70971 2.43535 7.08919 2.98372 6.97655 3.70068C6.96454 3.77714 6.9583 3.85552 6.9583 3.93535V5.2288C6.62653 5.14926 6.28021 5.10713 5.92405 5.10713C5.76675 5.10713 5.61136 5.11535 5.4583 5.13138Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1475 9.2776L8.10266 14.5515H14.9726L12.3191 9.95547L13.8417 9.27845C13.8419 9.27828 13.8425 9.27776 13.8426 9.2776C13.8426 9.27913 13.8426 9.27969 13.8426 9.27947L13.8426 9.2776C13.8426 9.27778 13.8427 9.27737 13.8426 9.2776C13.8428 9.27708 13.8435 9.27675 13.8435 9.2766C13.8436 9.27654 13.8436 9.2765 13.8435 9.2766C13.8435 9.27675 13.8428 9.27708 13.8426 9.2776L13.8426 3.93535L8.4583 3.93535L8.45832 9.2776H11.1475ZM14.7236 10.4918C15.0988 10.2191 15.3426 9.77685 15.3426 9.2776V3.93535C15.3426 3.10692 14.6711 2.43535 13.8426 2.43535H8.4583C7.62987 2.43535 6.9583 3.10692 6.9583 3.93535L6.95832 9.2776C6.95832 9.58297 7.04957 9.86703 7.2063 10.104C7.47474 10.5099 7.93527 10.7776 8.45832 10.7776H8.54944L6.80362 13.8015C6.22627 14.8015 6.94796 16.0515 8.10266 16.0515H14.9726C16.1273 16.0515 16.849 14.8015 16.2716 13.8015L14.4515 10.6489C14.548 10.606 14.6391 10.5532 14.7236 10.4918Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.8426 3.93535L8.4583 3.93535L8.45832 9.2776H13.8426L13.8426 3.93535ZM8.4583 2.43535C7.62987 2.43535 6.9583 3.10692 6.9583 3.93535L6.95832 9.2776C6.95832 10.106 7.62989 10.7776 8.45832 10.7776H13.8426C14.6711 10.7776 15.3426 10.106 15.3426 9.2776V3.93535C15.3426 3.10692 14.6711 2.43535 13.8426 2.43535H8.4583Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
|
||||
<path d="M7.275 3.39747C7.275 2.44478 8.04731 1.67247 9 1.67247C9.95269 1.67247 10.725 2.44478 10.725 3.39747C10.725 4.35016 9.95269 5.12247 9 5.12247C8.04731 5.12247 7.275 4.35016 7.275 3.39747Z"/>
|
||||
<path d="M13.05 12.7336C13.05 11.7809 13.8223 11.0086 14.775 11.0086C15.7277 11.0086 16.5 11.7809 16.5 12.7336C16.5 13.6863 15.7277 14.4586 14.775 14.4586C13.8223 14.4586 13.05 13.6863 13.05 12.7336Z" />
|
||||
<path d="M1.5 12.7336C1.5 11.7809 2.27231 11.0086 3.225 11.0086C4.17769 11.0086 4.95 11.7809 4.95 12.7336C4.95 13.6863 4.17769 14.4586 3.225 14.4586C2.27231 14.4586 1.5 13.6863 1.5 12.7336Z" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.47577 4.59792C6.28566 4.20775 5.81199 4.04174 5.44739 4.27718C4.59257 4.82918 3.87495 5.57494 3.35537 6.45819C2.83579 7.34145 2.53261 8.331 2.46543 9.34633C2.43677 9.7794 2.812 10.1128 3.24539 10.0894C3.67878 10.066 4.0047 9.69385 4.04974 9.26218C4.12336 8.55661 4.34733 7.87177 4.71008 7.25511C5.07284 6.63845 5.56261 6.10997 6.14355 5.70284C6.49897 5.45374 6.66587 4.98809 6.47577 4.59792ZM14.7543 10.0953C15.1877 10.1191 15.5632 9.78614 15.535 9.35303C15.4689 8.33764 15.1667 7.34777 14.648 6.46399C14.1294 5.5802 13.4125 4.83371 12.5583 4.28083C12.1939 4.04501 11.7201 4.21054 11.5295 4.60051C11.339 4.99049 11.5055 5.45631 11.8606 5.70577C12.4412 6.11351 12.9304 6.64248 13.2925 7.25951C13.6546 7.87655 13.8779 8.56161 13.9508 9.26726C13.9954 9.69898 14.3209 10.0714 14.7543 10.0953ZM6.03643 15.6186C5.64939 15.4222 5.55425 14.9294 5.79558 14.5686C6.03691 14.2079 6.52325 14.1176 6.91745 14.2992C7.56177 14.596 8.26499 14.753 8.98043 14.7558C9.69587 14.7586 10.4003 14.6072 11.0469 14.3154C11.4426 14.1369 11.9282 14.2311 12.1667 14.5937C12.4051 14.9563 12.3061 15.4484 11.9176 15.6417C11.0066 16.0951 9.99898 16.3315 8.97425 16.3275C7.94951 16.3235 6.94382 16.0791 6.03643 15.6186Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" >
|
||||
<path d="M2.40921 14.9955C2.74759 15.3952 3.28934 15.595 4.03446 15.595V14.1936C3.74393 14.1936 3.53373 14.0912 3.40384 13.8863C3.27738 13.6815 3.21415 13.3342 3.21415 12.8446V11.3083C3.21415 10.0842 2.95096 9.31726 2.42459 9.00749V8.97752C2.95096 8.66275 3.21415 7.90583 3.21415 6.70673V5.11044C3.21415 4.24109 3.48758 3.80642 4.03446 3.80642V2.40498C3.28251 2.40498 2.73905 2.61482 2.40409 3.03451C2.06913 3.44919 1.90165 4.17115 1.90165 5.20037V6.87161C1.90165 7.82589 1.64188 8.30302 1.12235 8.30302V9.68198C1.64188 9.68198 1.90165 10.1416 1.90165 11.0609V12.8596C1.90165 13.8838 2.07083 14.5958 2.40921 14.9955Z"/>
|
||||
<path d="M15.5908 14.9955C15.2524 15.3952 14.7107 15.595 13.9655 15.595V14.1936C14.2561 14.1936 14.4663 14.0912 14.5962 13.8863C14.7226 13.6815 14.7859 13.3342 14.7859 12.8446V11.3083C14.7859 10.0842 15.049 9.31726 15.5754 9.00749V8.97752C15.049 8.66275 14.7859 7.90583 14.7859 6.70673V5.11044C14.7859 4.24109 14.5124 3.80642 13.9655 3.80642V2.40498C14.7175 2.40498 15.261 2.61482 15.5959 3.03451C15.9309 3.44919 16.0984 4.17115 16.0984 5.20037V6.87161C16.0984 7.82589 16.3581 8.30302 16.8777 8.30302V9.68198C16.3581 9.68198 16.0984 10.1416 16.0984 11.0609V12.8596C16.0984 13.8838 15.9292 14.5958 15.5908 14.9955Z"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.12446 15.595C4.12446 15.6447 4.08416 15.685 4.03446 15.685C3.27447 15.685 2.7023 15.4809 2.34052 15.0536C1.98023 14.628 1.81165 13.8876 1.81165 12.8596V11.0609C1.81165 10.6068 1.74697 10.2807 1.62847 10.071C1.51423 9.86886 1.34901 9.77198 1.12235 9.77198C1.07264 9.77198 1.03235 9.73169 1.03235 9.68198V8.30302C1.03235 8.25332 1.07264 8.21303 1.12235 8.21303C1.23797 8.21303 1.33489 8.18665 1.4163 8.13681C1.49791 8.08683 1.56895 8.0102 1.62778 7.90214C1.74691 7.68331 1.81165 7.34353 1.81165 6.87161V5.20037C1.81165 4.16717 1.97862 3.41818 2.33391 2.97816C2.69205 2.52958 3.26679 2.31498 4.03446 2.31498C4.08416 2.31498 4.12446 2.35528 4.12446 2.40498V3.80642C4.12446 3.85613 4.08416 3.89642 4.03446 3.89642C3.78954 3.89642 3.6144 3.99118 3.4954 4.18035C3.372 4.37651 3.30415 4.68229 3.30415 5.11044V6.70673C3.30415 7.84046 3.07112 8.62051 2.56503 8.99216C2.80368 9.1661 2.98111 9.43386 3.10188 9.78579C3.2379 10.1822 3.30415 10.6908 3.30415 11.3083V12.8446C3.30415 13.3312 3.36786 13.6563 3.48014 13.8386C3.59008 14.0116 3.76791 14.1036 4.03446 14.1036C4.08416 14.1036 4.12446 14.1439 4.12446 14.1936V15.595ZM3.40384 13.8863C3.27738 13.6815 3.21415 13.3342 3.21415 12.8446V11.3083C3.21415 10.1321 2.97117 9.37803 2.48522 9.04599C2.47453 9.03868 2.46373 9.03159 2.45281 9.02469C2.44349 9.01881 2.43408 9.01308 2.42459 9.00749V8.97752C2.43392 8.97194 2.44317 8.96622 2.45233 8.96037C2.46331 8.95335 2.47417 8.94613 2.48492 8.93871C2.97107 8.6031 3.21415 7.85911 3.21415 6.70673V5.11044C3.21415 4.24109 3.48758 3.80642 4.03446 3.80642V2.40498C4.00412 2.40498 3.97412 2.40532 3.94446 2.40601C3.23899 2.42226 2.72553 2.63176 2.40409 3.03451C2.06913 3.44919 1.90165 4.17115 1.90165 5.20037V6.87161C1.90165 7.82589 1.64188 8.30302 1.12235 8.30302V9.68198C1.64188 9.68198 1.90165 10.1416 1.90165 11.0609V12.8596C1.90165 13.8838 2.07083 14.5958 2.40921 14.9955C2.73382 15.3789 3.24556 15.5784 3.94446 15.594C3.97412 15.5947 4.00412 15.595 4.03446 15.595V14.1936C3.74393 14.1936 3.53373 14.0912 3.40384 13.8863ZM13.9655 15.685C13.9158 15.685 13.8755 15.6447 13.8755 15.595V14.1936C13.8755 14.1439 13.9158 14.1036 13.9655 14.1036C14.2321 14.1036 14.4099 14.0116 14.5199 13.8386C14.6321 13.6563 14.6959 13.3312 14.6959 12.8446V11.3083C14.6959 10.6908 14.7621 10.1822 14.8981 9.78579C15.0189 9.43386 15.1963 9.16609 15.435 8.99216C14.9289 8.6205 14.6959 7.84046 14.6959 6.70673V5.11044C14.6959 4.68229 14.628 4.37651 14.5046 4.18035C14.3856 3.99118 14.2105 3.89642 13.9655 3.89642C13.9158 3.89642 13.8755 3.85613 13.8755 3.80642V2.40498C13.8755 2.35528 13.9158 2.31498 13.9655 2.31498C14.7332 2.31498 15.3079 2.52957 15.6661 2.97811C16.0214 3.41813 16.1884 4.16713 16.1884 5.20037V6.87161C16.1884 7.34353 16.2531 7.68331 16.3722 7.90214C16.4311 8.0102 16.5021 8.08683 16.5837 8.13681C16.6651 8.18665 16.762 8.21303 16.8777 8.21303C16.9274 8.21303 16.9677 8.25332 16.9677 8.30302V9.68198C16.9677 9.73169 16.9274 9.77198 16.8777 9.77198C16.651 9.77198 16.4858 9.86886 16.3715 10.071C16.253 10.2807 16.1884 10.6068 16.1884 11.0609V12.8596C16.1884 13.8876 16.0198 14.628 15.6595 15.0536C15.2977 15.4809 14.7255 15.685 13.9655 15.685ZM15.5959 3.03451C15.2745 2.63176 14.761 2.42226 14.0556 2.40601C14.0259 2.40532 13.9959 2.40498 13.9655 2.40498V3.80642C14.5124 3.80642 14.7859 4.24109 14.7859 5.11044V6.70673C14.7859 7.85911 15.0289 8.6031 15.5151 8.93871C15.5258 8.94613 15.5367 8.95335 15.5477 8.96037C15.5568 8.96622 15.5661 8.97194 15.5754 8.97752V9.00749C15.5659 9.01308 15.5565 9.01881 15.5472 9.02469C15.5363 9.03158 15.5255 9.03868 15.5148 9.04599C15.0288 9.37802 14.7859 10.1321 14.7859 11.3083V12.8446C14.7859 13.3342 14.7226 13.6815 14.5962 13.8863C14.4663 14.0912 14.2561 14.1936 13.9655 14.1936V15.595C13.9959 15.595 14.0259 15.5947 14.0556 15.594C14.7544 15.5784 15.2662 15.3789 15.5908 14.9955C15.9292 14.5958 16.0984 13.8838 16.0984 12.8596V11.0609C16.0984 10.1416 16.3581 9.68198 16.8777 9.68198V8.30302C16.3581 8.30302 16.0984 7.82589 16.0984 6.87161V5.20037C16.0984 4.17115 15.9309 3.44919 15.5959 3.03451Z" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.81804 5.81801C6.11093 5.52512 6.58581 5.52512 6.8787 5.81801L9.00001 7.93932L11.1213 5.81801C11.4142 5.52512 11.8891 5.52512 12.182 5.81801C12.4749 6.1109 12.4749 6.58578 12.182 6.87867L10.0607 8.99998L12.182 11.1213C12.4749 11.4142 12.4749 11.8891 12.182 12.182C11.8891 12.4749 11.4142 12.4749 11.1213 12.182L9.00001 10.0606L6.87868 12.182C6.58579 12.4749 6.11091 12.4749 5.81802 12.182C5.52513 11.8891 5.52513 11.4142 5.81802 11.1213L7.93935 8.99998L5.81804 6.87867C5.52515 6.58578 5.52515 6.1109 5.81804 5.81801Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.8 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1719284028629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4376" width="256" height="256"><path d="M381.5 483.7c0-53.1 43.2-96.3 96.3-96.3h85v-187c0-9.4-7.6-17-17-17H137.9c-9.4 0-17 7.6-17 17v283.3c0 9.4 7.6 17 17 17h73.6v32.1l64.3-32.1h105.7v-17z" fill="#9ADCCF" p-id="4377"></path><path d="M747.7 784h-270c-9.4 0-17-7.6-17-17V483.7c0-9.4 7.6-17 17-17h407.9c9.4 0 17 7.6 17 17V767c0 9.4-7.6 17-17 17H812v32.1L747.7 784z" fill="#FFF370" p-id="4378"></path><path d="M341.8 523.4h-56.7c-2.6 0-5.2 0.6-7.6 1.8l-88.7 44.4v-29.2c0-9.4-7.6-17-17-17h-34c-21.9 0-39.7-17.8-39.7-39.7V200.5c0-21.9 17.8-39.7 39.7-39.7h407.9c21.9 0 39.7 17.8 39.7 39.7v147.3c0 9.4 7.6 17 17 17s17-7.6 17-17V200.5c0-40.6-33-73.6-73.6-73.6H137.9c-40.6 0-73.6 33-73.6 73.6v283.3c0 40.6 33 73.6 73.6 73.6h17V597c0 5.9 3 11.4 8.1 14.5 2.7 1.7 5.8 2.5 8.9 2.5 2.6 0 5.2-0.6 7.6-1.8l109.7-54.9h52.6c9.4 0 17-7.6 17-17 0-9.3-7.6-16.9-17-16.9z" fill="#4F3D3B" p-id="4379"></path><path d="M885.7 410.1h-65.8c-9.4 0-17 7.6-17 17s7.6 17 17 17h65.8c21.9 0 39.7 17.8 39.7 39.7V767c0 21.9-17.8 39.7-39.7 39.7h-34c-9.4 0-17 7.6-17 17v29.2L746 808.4c-2.4-1.2-5-1.8-7.6-1.8H477.8c-21.9 0-39.7-17.8-39.7-39.7V483.7c0-21.9 17.8-39.7 39.7-39.7h249.3c9.4 0 17-7.6 17-17s-7.6-17-17-17H477.8c-12.9 0-25 3.3-35.5 9.2l-85-180.7c-2.8-6-8.8-9.8-15.4-9.8s-12.6 3.8-15.4 9.8l-90.6 192.6c-4 8.5-0.3 18.6 8.1 22.6 8.5 4 18.6 0.3 22.6-8.1l19.4-41.2h111.7l18.4 39.1c-7.6 11.6-12 25.4-12 40.2V767c0 40.6 33 73.6 73.6 73.6h256.6L844 895.5c2.4 1.2 5 1.8 7.6 1.8 3.1 0 6.2-0.9 8.9-2.5 5-3.1 8.1-8.6 8.1-14.5v-39.7h17c40.6 0 73.6-33 73.6-73.6V483.7c0.1-40.6-32.9-73.6-73.5-73.6z m-583.8-39.7l39.9-84.7 39.9 84.7h-79.8zM358 733.9c-0.2-0.6-0.3-1.1-0.5-1.7-0.2-0.6-0.6-1.1-0.9-1.7-0.2-0.4-0.4-0.8-0.7-1.2-1.2-1.9-2.9-3.5-4.7-4.7-0.4-0.3-0.8-0.4-1.2-0.6-0.6-0.3-1.1-0.7-1.7-0.9-0.5-0.2-1.1-0.3-1.7-0.5-0.5-0.2-1-0.3-1.5-0.4-1.1-0.2-2.2-0.3-3.3-0.3H241c-21.9 0-39.7-17.8-39.7-39.7v-17.1c0-9.4-7.6-17-17-17s-17 7.6-17 17V682c0 40.6 33 73.6 73.6 73.6h59.8L284.5 772c-6.6 6.6-6.6 17.4 0 24 3.3 3.3 7.7 5 12 5s8.7-1.7 12-5l45.3-45.3c0.8-0.8 1.5-1.7 2.1-2.6 0.3-0.4 0.4-0.8 0.7-1.2 0.3-0.6 0.6-1.1 0.9-1.7 0.2-0.5 0.4-1.1 0.5-1.7 0.1-0.5 0.3-1 0.4-1.5 0.4-2.2 0.4-4.5 0-6.7 0-0.5-0.2-1-0.4-1.4zM665.5 222.3c0.2 0.6 0.3 1.1 0.5 1.7 0.2 0.6 0.6 1.1 0.9 1.7 0.2 0.4 0.4 0.8 0.7 1.2 1.2 1.9 2.9 3.5 4.7 4.7 0.4 0.3 0.8 0.4 1.2 0.6 0.6 0.3 1.1 0.7 1.7 0.9 0.5 0.2 1.1 0.3 1.7 0.5 0.5 0.2 1 0.3 1.5 0.4 1.1 0.2 2.2 0.3 3.3 0.3h100.8c21.9 0 39.7 17.8 39.7 39.7v73.6c0 9.4 7.6 17 17 17s17-7.6 17-17V274c0-40.6-33-73.6-73.6-73.6h-59.8l16.3-16.3c6.6-6.6 6.6-17.4 0-24-6.6-6.6-17.4-6.6-24 0l-45.3 45.3c-0.8 0.8-1.5 1.7-2.1 2.6-0.3 0.4-0.4 0.8-0.7 1.2-0.3 0.6-0.6 1.1-0.9 1.7-0.2 0.5-0.4 1.1-0.5 1.7-0.1 0.5-0.3 1-0.4 1.5-0.4 2.2-0.4 4.5 0 6.7 0 0.5 0.2 1 0.3 1.5z" fill="#4F3D3B" p-id="4380"></path><path d="M681.7 750c9.4 0 17-7.6 17-17v-45.3H778c9.4 0 17-7.6 17-17V580c0-9.4-7.6-17-17-17h-79.3v-45.3c0-9.4-7.6-17-17-17s-17 7.6-17 17V563h-79.3c-9.4 0-17 7.6-17 17v90.6c0 9.4 7.6 17 17 17h79.3V733c0 9.4 7.6 17 17 17z m17-153H761v56.7h-62.3V597z m-96.3 56.7V597h62.3v56.7h-62.3z" fill="#4F3D3B" p-id="4381"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1730274418124" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11324" width="200" height="200"><path d="M247.898336 292.06743c-49.519903 16.505968-87.715829-27.923945-116.599772-27.661946-28.883944 0.259999-131.633743 46.589909-131.297744 83.727836 0.333999 36.465929 165.363677 142.011723 280.909451 26.465948l-33.011935-82.531838zM776.103304 292.06743c49.519903 16.505968 87.715829-27.923945 116.599772-27.661946 28.883944 0.261999 131.631743 46.591909 131.295744 83.729836-0.331999 36.465929-165.363677 142.011723-280.909451 26.465948l33.013935-82.533838z" fill="#464655" p-id="11325"></path><path d="M684.877482 770.428495c38.135926-165.673676 107.73379-474.585073 107.73379-522.530979 0-49.519903 0-66.025871-33.011936-99.037807-10.519979-10.519979-31.255939-20.937959-56.439889-30.64794-122.67576-47.297908-259.635493-47.297908-382.311254 0-25.183951 9.709981-45.91791 20.127961-56.439889 30.64794-33.011936 33.011936-33.011936 49.519903-33.011936 99.037807 0 47.945906 69.597864 356.857303 107.73379 522.530979l-28.155945 98.547808c-15.063971 52.721897 24.523952 105.205795 79.355845 105.205794h243.347524c54.831893 0 94.421816-52.481897 79.355845-105.205794l-28.155945-98.547808z" fill="#ffffff" p-id="11326"></path><path d="M597.995652 813.026412h-171.989664c-25.43595 0-46.05791 20.61996-46.05791 46.05791a117.56577 117.56577 0 0 0 16.753967 60.485882l18.339964 30.56794a49.515903 49.515903 0 0 0 42.461917 24.041953h108.987788a49.513903 49.513903 0 0 0 42.461917-24.041953l18.339964-30.56794a117.56577 117.56577 0 0 0 16.753967-60.485882c0.004-25.43795-20.61596-46.05791-46.05191-46.05791z" fill="#EBB4A0" p-id="11327"></path><path d="M445.973949 908.154226a16.447968 16.447968 0 0 1-11.669977-4.83599l-33.011936-33.011936a16.499968 16.499968 0 0 1 0-23.341954 16.499968 16.499968 0 0 1 23.341955 0l33.011935 33.011935a16.499968 16.499968 0 0 1 0 23.339955 16.447968 16.447968 0 0 1-11.671977 4.83799zM578.025691 908.154226a16.447968 16.447968 0 0 1-11.669977-4.83599 16.499968 16.499968 0 0 1 0-23.339955l33.013935-33.011935a16.499968 16.499968 0 0 1 23.341955 0 16.499968 16.499968 0 0 1 0 23.341954l-33.011936 33.011936a16.469968 16.469968 0 0 1-11.673977 4.83399z" fill="#D7A091" p-id="11328"></path><path d="M759.597336 148.857709c-10.37398-10.37398-30.68994-20.64796-55.401891-30.241941-15.26197-18.447964-36.863928-40.649921-60.143883-52.289898C611.039627 49.817903 511.99982 49.817903 511.99982 49.817903s-99.037807 0-132.051742 16.505967c-23.281955 11.641977-44.881912 33.841934-60.143883 52.289898-24.709952 9.593981-45.025912 19.867961-55.401891 30.241941-29.425943 29.425943-32.607936 45.89391-32.957936 84.159836 22.629956 1.051998 50.861901 2.223996 64.307874 2.223996 100.699803 0 185.275638-47.077908 213.973582-67.973868l-15.903968 66.171871c52.267898-0.473999 145.389716-46.715909 164.457678-67.523868l17.105967 65.873871c51.1959-33.415935 51.1959-49.921902 51.1959-49.921902s33.365935 0.04 63.583876 18.303964c-3.291994-18.069965-11.147978-31.891938-30.567941-51.3119z" fill="#FFDEB7" p-id="11329"></path><path d="M232.016367 215.05158c-0.587999 9.309982-0.625999 19.917961-0.625999 32.843936 0 47.945906 69.597864 356.857303 107.73379 522.530979 0 0 90.343824-175.895656 90.343823-208.907592 0-32.979936 16.455968-296.567421-197.451614-346.467323z" fill="#6B676E" p-id="11330"></path><path d="M297.426239 404.71721a41.265919 24.759952 90 1 0 49.519903 0 41.265919 24.759952 90 1 0-49.519903 0Z" fill="#464655" p-id="11331"></path><path d="M791.985273 215.05158c0.587999 9.309982 0.625999 19.917961 0.625999 32.843936 0 47.945906-69.597864 356.857303-107.73379 522.530979 0 0-90.343824-175.895656-90.343823-208.907592 0-32.979936-16.453968-296.567421 197.451614-346.467323z" fill="#6B676E" p-id="11332"></path><path d="M677.055498 404.71721a41.265919 24.759952 90 1 0 49.519903 0 41.265919 24.759952 90 1 0-49.519903 0Z" fill="#464655" p-id="11333"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1730275413281" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16472" width="200" height="200"><path d="M919 233.6s-46.2-41.4-93.4-63.2c-51.4-26.6-124-25.4-124-25.4s-51.2-4.1-103.6 22.6c-52.4 26.7-91.1 62.9-91.1 62.9s-53.5-44.1-100.8-67.2S290.7 145 290.7 145s-64.9 3.6-106.7 23.8c-41.8 20.3-80.1 68.4-80.1 68.4v621.4s59-55.1 94.2-70.6c35.2-15.5 90.3-15 90.3-15s66 8.5 105.3 25.7c39.3 17.1 113.2 80.7 113.2 80.7s47.1-54.2 84.9-74.5c64.1-35.7 127.7-30.6 127.7-30.6s39.1 1.8 93.4 23.8c49.4 20 107.1 61.7 107.1 61.7l-1-626.2zM486.9 811s-101.1-86.3-198.4-84.3c-91.7 1.8-126.8 26.9-150.6 52.5 0.9-30.2-0.4-519.3-0.4-519.3s35.2-68.4 154.1-73.9c101-9.2 188.2 67.8 193.6 82.5 2.5 19.2 1.7 542.5 1.7 542.5z m394.8-20.2c-23.8-25.7-87.5-64.2-179.1-66-97.3-1.9-173.9 87.1-173.9 87.1s-0.8-523.3 1.7-542.5c8.5-14.7 74.7-88 193.6-82.5 103 4.8 159.1 72.2 159.1 72.2s-1.3 501.7-1.4 531.7z" fill="#000000" p-id="16473"></path><path d="M544.6 609.5h-65.1c-6.6 0-12-5.4-12-12v-171c0-6.6 5.4-12 12-12h65.1c6.6 0 12 5.4 12 12v171c0 6.6-5.4 12-12 12z" fill="#000000" p-id="16474"></path><path d="M544.6 609.5h-65.1c-6.6 0-12-5.4-12-12v-171c0-6.6 5.4-12 12-12h65.1c6.6 0 12 5.4 12 12v171c0 6.6-5.4 12-12 12z" fill="#000000" p-id="16475"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1730274794897" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12770" width="200" height="200"><path d="M841.5 378.7c-7.7-15-11.6-31.4-21-45.5-18-34.4-43-66.1-72.2-93.2-15.5-9.9-28.4-22.3-43.8-32.2-13.7-9-28.8-16.3-43-24.1-21.9-8.6-43-17.6-65.7-23.2-9-0.9-16.8-5.2-25.8-5.2l-37.4-4.3c-19.3-2.1-39.5-0.4-59.3 0.9-44.2 3.4-83.3 18-122.4 35.2-67.4 33.5-128 91.5-161.1 160.2-24.9 52-38.7 111.2-36.9 167.9 0 7.3 2.1 18 1.3 24.9 3.4 13.3 3 25.8 6.4 38.2 20.6 95.8 82 185.1 172.2 235.4 16.3 12 35.2 17.2 53.3 24.5 63.6 24.1 143.9 28.3 210.9 10.3 95.8-21.9 184.3-91.1 228.5-181.7 0.9-0.9 2.1-0.9 1.3-2.6 43-86.6 50.3-192.3 14.7-285.5z m-409.8-69.1c11.2-9.5 24.9-17.2 41.7-13.3 12 3 22.3 11.6 28.8 22.8 6 11.2 8.2 29.6 0 40.8-7.3 12.5-21.5 22.8-36.1 23.2-16.8-0.9-34.8-8.2-41.2-25.3-9.1-16-3.9-34.5 6.8-48.2z m386.1 335.9c-28.4 65.7-87.2 128.9-152.1 159.8-20.2 10.7-40.8 20.6-63.1 24.1-9.9 0-18.5 2.6-28.4 2.6l-25.8-2.6c-5.6-1.3-10.7-5.2-16.8-3.9-29.2-4.7-56.3-20.6-78.6-41.7-40.8-42.1-57.1-104.4-40.8-158.9 8.2-27.1 24.5-52.8 46-72.2 26.2-18.5 52.8-35.7 78.2-56.7 30.5-21.9 64.4-45.5 79-80.8 12-17.6 14.2-39.1 18-60.1 6.4-62.7-24.5-127.6-81.2-160.2-11.2-7.7-24.5-11.2-36.1-17.6-13.3-2.1-24.9-7.7-37.8-7.7-1.3-0.9 0.4-0.9-0.4-1.3 30.9-5.2 70.9-1.7 103.5 5.2C669 192 752.3 250.4 798.7 328.6l13.3 23.6c46.2 86.7 48.4 206.1 5.8 293.3z m-213.9 14.1c5.6 16.8 1.7 36.5-11.6 49-12.5 9-28.4 16.8-44.2 11.2-12-4.3-24.5-13.3-30.5-24.5-5.6-12-3.9-27.5 1.7-39.1 8.2-15.9 25.8-21.9 40.8-27.5 19.4-0.4 36.5 13.8 43.8 30.9z m44.2 246.2l-0.4 0.4-1.3-1.7c0.4 0.4 0.8 0.8 1.7 1.3z m-51.6 8.5h0.4-0.4z m-4.7 0.5c0 0.4-0.4 0.4-1.3 0.4 0.5-0.9 0.9-0.4 1.3-0.4z m0 0" fill="#000000" p-id="12771"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg width="100%" height="100%" viewBox="0 0 89 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M52.308 3.07812H57.8465V4.92428H56.0003V6.77043H54.1541V10.4627H57.8465V12.3089H54.1541V25.232H52.308V27.0781H46.7695V25.232H48.6157V12.3089H46.7695V10.4627H48.6157V6.77043H50.4618V4.92428H52.308V3.07812Z" fill="currentColor"></path><path d="M79.3849 23.3858H81.2311V25.232H83.0772V27.0781H88.6157V25.232H86.7695V23.3858H84.9234V4.92428H79.3849V23.3858Z" fill="currentColor"></path><path d="M57.8465 14.155H59.6926V12.3089H61.5388V10.4627H70.7695V12.3089H74.4618V23.3858H76.308V25.232H78.1541V27.0781H72.6157V25.232H70.7695V23.3858H68.9234V14.155H67.0772V12.3089H65.2311V14.155H63.3849V23.3858H65.2311V25.232H67.0772V27.0781H61.5388V25.232H59.6926V23.3858H57.8465V14.155Z" fill="currentColor"></path><path d="M67.0772 25.232V23.3858H68.9234V25.232H67.0772Z" fill="currentColor"></path><rect opacity="0.22" x="7.38477" y="29.5391" width="2.46154" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.85" x="2.46094" y="19.6914" width="12.3077" height="2.46154" fill="#5F4CD9"></rect><rect x="4.92383" y="17.2305" width="9.84615" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.4" x="7.38477" y="27.0781" width="4.92308" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.7" y="22.1562" width="14.7692" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.5" x="7.38477" y="24.6133" width="7.38462" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.22" x="7.38477" y="12.3086" width="2.46154" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.85" x="2.46094" y="2.46094" width="12.3077" height="2.46154" fill="#5F4CD9"></rect><rect x="4.92383" width="9.84615" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.4" x="7.38477" y="9.84375" width="4.92308" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.7" y="4.92188" width="14.7692" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.5" x="7.38477" y="7.38281" width="7.38462" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.22" x="24.6152" y="29.5391" width="2.46154" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.85" x="19.6914" y="19.6914" width="12.3077" height="2.46154" fill="#5F4CD9"></rect><rect x="22.1543" y="17.2305" width="9.84615" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.4" x="24.6152" y="27.0781" width="4.92308" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.7" x="17.2305" y="22.1562" width="14.7692" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.5" x="24.6152" y="24.6133" width="7.38462" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.22" x="24.6152" y="12.3086" width="2.46154" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.85" x="19.6914" y="2.46094" width="12.3077" height="2.46154" fill="#5F4CD9"></rect><rect x="22.1543" width="9.84615" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.4" x="24.6152" y="9.84375" width="4.92308" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.7" x="17.2305" y="4.92188" width="14.7692" height="2.46154" fill="#5F4CD9"></rect><rect opacity="0.5" x="24.6152" y="7.38281" width="7.38462" height="2.46154" fill="#5F4CD9"></rect></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1730273562336" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4241" width="200" height="200"><path d="M960 512c0 97.76-28.704 185.216-85.664 263.264-56.96 78.016-130.496 131.84-220.64 161.856-10.304 1.824-18.368 0.448-22.848-4.032a22.4 22.4 0 0 1-7.2-17.504v-122.88c0-37.632-10.304-65.44-30.464-82.912a409.856 409.856 0 0 0 59.616-10.368 222.752 222.752 0 0 0 54.72-22.816c18.848-10.784 34.528-23.36 47.104-38.592 12.544-15.232 22.848-35.904 30.912-61.44 8.096-25.568 12.128-54.688 12.128-87.904 0-47.072-15.232-86.976-46.208-120.16 14.368-35.456 13.024-74.912-4.48-118.848-10.752-3.616-26.432-1.344-47.072 6.272s-38.56 16.16-53.824 25.568l-21.984 13.888c-36.32-10.304-73.536-15.232-112.096-15.232s-75.776 4.928-112.096 15.232a444.48 444.48 0 0 0-24.672-15.68c-10.336-6.272-26.464-13.888-48.896-22.432-21.952-8.96-39.008-11.232-50.24-8.064-17.024 43.936-18.368 83.424-4.032 118.848-30.496 33.632-46.176 73.536-46.176 120.608 0 33.216 4.032 62.336 12.128 87.456 8.032 25.12 18.368 45.76 30.496 61.44 12.544 15.68 28.224 28.704 47.072 39.04 18.848 10.304 37.216 17.92 54.72 22.816a409.6 409.6 0 0 0 59.648 10.368c-15.712 13.856-25.12 34.048-28.704 60.064a99.744 99.744 0 0 1-26.464 8.512 178.208 178.208 0 0 1-33.184 2.688c-13.024 0-25.568-4.032-38.144-12.544-12.544-8.512-23.296-20.64-32.256-36.32a97.472 97.472 0 0 0-28.256-30.496c-11.232-8.064-21.088-12.576-28.704-13.92l-11.648-1.792c-8.096 0-13.92 0.928-17.056 2.688-3.136 1.792-4.032 4.032-2.688 6.72s3.136 5.408 5.376 8.096 4.928 4.928 7.616 7.168l4.032 2.688c8.544 4.032 17.056 11.232 25.568 21.984 8.544 10.752 14.368 20.64 18.4 29.6l5.824 13.44c4.928 14.816 13.44 26.912 25.568 35.872 12.096 8.992 25.088 14.816 39.008 17.504 13.888 2.688 27.36 4.032 40.352 4.032s23.776-0.448 32.288-2.24l13.472-2.24c0 14.784 0 32.288 0.416 52.032 0 19.744 0.48 30.496 0.48 31.392a22.624 22.624 0 0 1-7.648 17.472c-4.928 4.48-12.992 5.824-23.296 4.032-90.144-30.048-163.68-83.84-220.64-161.888C92.256 697.216 64 609.312 64 512c0-81.152 20.192-156.064 60.096-224.672s94.176-122.88 163.232-163.232C355.936 84.192 430.816 64 512 64s156.064 20.192 224.672 60.096 122.88 94.176 163.232 163.232C939.808 355.488 960 430.848 960 512" fill="#000000" p-id="4242"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1719285050683" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6411" width="256" height="256"><path d="M214.101333 512c0-32.512 5.546667-63.701333 15.36-92.928L57.173333 290.218667A491.861333 491.861333 0 0 0 4.693333 512c0 79.701333 18.858667 154.88 52.394667 221.610667l172.202667-129.066667A290.56 290.56 0 0 1 214.101333 512" fill="#FBBC05" p-id="6412"></path><path d="M516.693333 216.192c72.106667 0 137.258667 25.002667 188.458667 65.962667L854.101333 136.533333C763.349333 59.178667 646.997333 11.392 516.693333 11.392c-202.325333 0-376.234667 113.28-459.52 278.826667l172.373334 128.853333c39.68-118.016 152.832-202.88 287.146666-202.88" fill="#EA4335" p-id="6413"></path><path d="M516.693333 807.808c-134.357333 0-247.509333-84.864-287.232-202.88l-172.288 128.853333c83.242667 165.546667 257.152 278.826667 459.52 278.826667 124.842667 0 244.053333-43.392 333.568-124.757333l-163.584-123.818667c-46.122667 28.458667-104.234667 43.776-170.026666 43.776" fill="#34A853" p-id="6414"></path><path d="M1005.397333 512c0-29.568-4.693333-61.44-11.648-91.008H516.650667V614.4h274.602666c-13.696 65.962667-51.072 116.650667-104.533333 149.632l163.541333 123.818667c93.994667-85.418667 155.136-212.650667 155.136-375.850667" fill="#4285F4" p-id="6415"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1719284536895" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5409" width="256" height="256"><path d="M891.318857 340.845714c4.900571 0 9.728 0.292571 14.628572 0.804572a409.965714 409.965714 0 0 1 108.836571 30.061714c10.093714 4.534857 12.580571 8.192 3.949714 17.334857-24.868571 26.624-45.494857 57.051429-61.001143 89.965714-16.822857 35.328-35.108571 69.851429-52.297142 105.033143a225.28 225.28 0 0 1-52.150858 69.412572c-53.613714 48.493714-116.150857 68.973714-187.538285 59.099428-81.92-11.337143-159.451429-38.985143-232.740572-75.483428a143.506286 143.506286 0 0 1-10.459428-5.485715 5.339429 5.339429 0 0 1 0.292571-9.216l5.12-2.706285c59.245714-31.670857 108.836571-75.849143 156.525714-122.294857 20.187429-19.529143 39.497143-40.009143 59.904-59.318858A345.014857 345.014857 0 0 1 804.571429 352.256c13.165714-3.218286 26.550857-5.778286 39.789714-8.630857h0.585143l28.233143-2.56" fill="#133C9A" p-id="5410"></path><path d="M317.659429 913.846857c-8.996571-0.512-31.158857-3.584-33.865143-3.949714a536.429714 536.429714 0 0 1-165.083429-48.274286c-30.208-14.116571-59.245714-30.72-88.356571-46.957714-19.163429-10.678857-27.794286-27.282286-27.648-49.883429 0.585143-83.382857 0.585143-166.765714 0-250.148571C2.413714 461.019429 0.731429 407.405714 0 353.718857c0-4.754286 0.731429-9.508571 2.194286-13.897143 3.291429-9.728 9.947429-10.24 16.530285-3.949714 7.606857 7.314286 13.677714 16.237714 21.211429 23.405714 67.291429 66.413714 138.752 127.195429 218.770286 177.225143 45.056 28.891429 91.940571 54.710857 140.434285 77.385143 77.750857 35.328 157.549714 66.486857 241.078858 86.235429 73.874286 17.481143 145.627429 6.436571 205.458285-40.374858 18.285714-15.652571 27.282286-27.062857 48.932572-55.881142a359.862857 359.862857 0 0 1-37.376 72.850285c-13.897143 21.942857-45.348571 51.2-69.193143 74.093715-36.278857 35.108571-83.748571 63.561143-128.292572 87.552-48.566857 26.185143-99.035429 47.104-152.941714 58.514285-27.648 6.948571-67.584 14.848-81.334857 15.579429-2.413714-0.146286-10.678857 1.682286-14.848 1.389714-35.547429 2.633143-57.490286 3.657143-92.891429 0z" fill="#3370FF" p-id="5411"></path><path d="M165.083429 110.518857a52.443429 52.443429 0 0 1 7.460571 0c152.649143 0 304.128 2.486857 456.630857 2.486857 0.292571 0 0.585143 0 0.731429 0.219429 14.189714 12.361143 27.282286 25.746286 39.277714 40.155428 34.450286 34.230857 60.123429 93.622857 77.677714 129.755429 8.777143 25.014857 21.942857 48.859429 28.16 76.8v0.438857c-15.579429 5.046857-30.72 11.190857-45.348571 18.505143-44.178286 22.381714-64.219429 38.765714-100.790857 74.752-19.968 19.529143-37.010286 37.083429-63.488 62.098286a563.346286 563.346286 0 0 1-29.769143 26.916571c-7.021714-12.434286-125.732571-244.589714-364.251429-427.300571" fill="#00D6B9" p-id="5412"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1 @@
|
||||
<svg t="1730279749380" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23191" width="200" height="200"><path d="M192.682417 617.135502c10.498098 8.652054 23.62507 13.31833 37.040614 13.31833 2.300392 0 4.601808-0.1361 6.901177-0.407276 15.794731-1.89721 30.119995-10.181897 39.748283-22.918989L396.811538 447.300442l119.918183 101.526301c12.158924 10.277064 27.935236 15.387455 43.767829 13.491269 15.813151-1.664919 30.273491-9.69685 40.055275-22.317285l275.42491-354.942965c2.010797-2.593058 3.596921-5.380544 5.124717-8.16803l48.350195-57.257052c25.903973-30.679743 14.769378-50.598398-24.746614-44.248783l-227.867778 36.583197c-39.534412 6.349615-47.749514 33.8172-18.268062 61.070914l45.565778 42.100864L545.629935 419.407162l-120.55468-102.08605c-12.275581-10.336416-28.14706-15.21554-44.192501-13.452383-15.930831 1.780553-30.448476 10.083659-40.134069 22.955828l-120.960932 160.526043-58.093093-47.792493c-25.01472-20.595061-61.901839-16.917298-82.35466 8.284687-20.452821 25.163099-16.780175 62.250786 8.255011 82.807984L192.682417 617.135502z" fill="#F45944" p-id="23192"></path><path d="M878.626052 349.259522 610.025571 676.327626c-12.063757 15.291265-42.744523-6.658653-57.551764-19.240203l-107.951641-94.964862c-14.808264-12.580526-37.000706 8.710382-49.315172 23.809265l-125.447107 153.884786c-12.294001 15.098883-34.411741-2.206248-49.103348-14.924921l-109.457948-87.046518c-19.641339-18.891256-38.375006 0.813528-38.375006 38.48143l0.676405 233.131665c0.037862 19.550265 15.928784 35.538401 35.280528 35.557844l810.558793 0.639566c19.371186 0.01842 35.20378-15.969717 35.20378-35.519981 0 0 0.811482-503.446183 0.811482-541.656437C955.37504 317.243341 914.912489 307.410392 878.626052 349.259522z" fill="#F45944" p-id="23193"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.05 1.5C6.25106 1.5 1.55005 6.20101 1.55005 12C1.55005 17.799 6.25106 22.5 12.05 22.5C17.849 22.5 22.55 17.799 22.55 12C22.55 6.20101 17.849 1.5 12.05 1.5ZM4.45357 10.6776L5.23449 9.8967C6.52836 8.60283 8.62614 8.60282 9.92001 9.89669L15.3864 15.3631C13.6613 17.0883 10.8642 17.0883 9.13909 15.3631L4.45357 10.6776ZM13.0437 11.4585L13.8246 10.6776C14.8765 9.62569 16.4598 9.42898 17.7104 10.0875C18.2671 10.3806 18.8755 10.6306 19.4995 10.5504C19.4995 10.5504 19.0284 11.5308 18.6367 12.1034C17.8653 13.2312 16.1674 14.5822 16.1674 14.5822L13.0437 11.4585Z" fill="url(#paint0_linear_15358_11488)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_15358_11488" x1="12.05" y1="1.5" x2="12.05" y2="22.5" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#00BCA6"/>
|
||||
<stop offset="1" stop-color="#00AF9A"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 978 B |
@@ -58,4 +58,4 @@ const MyNumberInput = (props: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default MyNumberInput;
|
||||
export default React.memo(MyNumberInput);
|
||||
|
||||
@@ -13,4 +13,4 @@ const SearchInput = (props: InputProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default SearchInput;
|
||||
export default React.memo(SearchInput);
|
||||
|
||||
@@ -17,4 +17,4 @@ const MyBox = ({ text, isLoading, children, size, ...props }: Props, ref: any) =
|
||||
);
|
||||
};
|
||||
|
||||
export default forwardRef(MyBox);
|
||||
export default React.memo(forwardRef(MyBox));
|
||||
|
||||
@@ -44,4 +44,4 @@ const Loading = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default Loading;
|
||||
export default React.memo(Loading);
|
||||
|
||||
@@ -77,4 +77,4 @@ const InputSlider = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default InputSlider;
|
||||
export default React.memo(InputSlider);
|
||||
|
||||
@@ -15,4 +15,4 @@ const QuestionTip = ({ label, maxW, ...props }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default QuestionTip;
|
||||
export default React.memo(QuestionTip);
|
||||
|
||||
@@ -20,31 +20,22 @@ export default function VariableLabel({
|
||||
<Box
|
||||
display="inline-flex"
|
||||
alignItems="center"
|
||||
m={'2px'}
|
||||
mx={'2px'}
|
||||
rounded={'4px'}
|
||||
px={1.5}
|
||||
py={'1px'}
|
||||
bg={parentLabel !== 'undefined' ? 'primary.50' : 'red.50'}
|
||||
color={parentLabel !== 'undefined' ? 'myGray.900' : 'red.600'}
|
||||
transform={parentLabel !== 'undefined' ? 'translateY(3px)' : ''}
|
||||
>
|
||||
{parentLabel !== 'undefined' ? (
|
||||
<Flex alignItems={'center'} color={'myGray.600'}>
|
||||
<Avatar
|
||||
src={nodeAvatar as any}
|
||||
w={'1rem'}
|
||||
mr={1}
|
||||
borderRadius={'xs'}
|
||||
display={'inline-flex'}
|
||||
verticalAlign={'middle'}
|
||||
/>
|
||||
<Flex alignItems={'center'} color={'myGray.600'} fontSize={'sm'}>
|
||||
<Avatar src={nodeAvatar as any} w={'1rem'} mr={1} borderRadius={'xs'} />
|
||||
{parentLabel}
|
||||
<ChevronRightIcon color={'myGray.500'} />
|
||||
{childLabel}
|
||||
</Flex>
|
||||
) : (
|
||||
<>
|
||||
<Box>{t('common:invalid_variable')}</Box>
|
||||
</>
|
||||
<Box>{t('common:invalid_variable')}</Box>
|
||||
)}
|
||||
</Box>
|
||||
</>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Box, Flex } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
export default function Variable({ variableLabel }: { variableLabel: string }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box
|
||||
display="inline-flex"
|
||||
alignItems="center"
|
||||
mx={'2px'}
|
||||
rounded={'4px'}
|
||||
px={1.5}
|
||||
py={'1px'}
|
||||
{...(variableLabel
|
||||
? { bg: 'primary.50', color: 'primary.600' }
|
||||
: { bg: 'red.50', color: 'red.600' })}
|
||||
>
|
||||
{variableLabel ? (
|
||||
<Flex alignItems={'center'}>{variableLabel}</Flex>
|
||||
) : (
|
||||
<Box>{t('common:invalid_variable')}</Box>
|
||||
)}
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
import { getHashtagRegexString } from './utils';
|
||||
import { registerLexicalTextEntity } from '../../utils';
|
||||
import { $createVariableNode, VariableNode } from './node';
|
||||
import { EditorVariablePickerType } from '../../type';
|
||||
import { $createVariableNode, VariableNode } from './node';
|
||||
|
||||
const REGEX = new RegExp(getHashtagRegexString(), 'i');
|
||||
|
||||
@@ -22,7 +22,11 @@ export default function VariablePlugin({ variables }: { variables: EditorVariabl
|
||||
}, [variables]);
|
||||
|
||||
const createVariableNode = useCallback((textNode: TextNode): VariableNode => {
|
||||
return $createVariableNode(textNode.getTextContent());
|
||||
const currentVariable = variables.find(
|
||||
(item) => item.key === textNode.getTextContent().replace(/[{}]/g, '')
|
||||
);
|
||||
const variableLabel = currentVariable?.label;
|
||||
return $createVariableNode(textNode.getTextContent(), variableLabel || '');
|
||||
}, []);
|
||||
|
||||
const getVariableMatch = useCallback((text: string) => {
|
||||
|
||||