{ "Name": "AI对话", "Enabled": true, "Triggers": [ { "$type": "Forguncy.SaveLoad.PostRequestTriggerSaveData, ServerDesignerCommon", "Permission": { "PermissionData": { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionData, Forguncy.RbacPermission.Core", "permissionResource": { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionResource, Forguncy.RbacPermission.Core" }, "permissionBindings": [ { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionBinding, Forguncy.RbacPermission.Core", "roleNames": [ "FGC_LoginUser" ] } ] } }, "Parameters": [ { "Name": "主题ID", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "2" } ], "InvokeTriggerTestData": { "UserName": "Administrator" } } ], "Commands": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "主题信息", "TableValue": { "TableName": "对话主题", "TableValueType": 1, "BindingInfos": [ { "GUID": "90894556-d981-4368-9f92-ecb4d6ca7ffb", "BindingInfo": { "TableName": "对话主题", "ColumnName": "ID", "GUID": "83a31143-581e-4afc-8910-2826889e35af" }, "ColumnName": "ID" }, { "GUID": "e6315872-b0aa-4ea7-8842-e63a17eecd17", "BindingInfo": { "TableName": "对话主题", "ColumnName": "主题", "GUID": "7ec162b4-dcd0-4cc1-87a3-3b9c711e09f4" }, "ColumnName": "主题" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "对话主题", "ColumnName": "ID", "GUID": "c7b1e947-30c5-4550-ab96-3458a2f0d10a" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=主题ID" } }, "NullFormulaValueQueryPolicy": 0 }, "ID": "a4e6f9bd1d114334a198e9c5952f9396" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=主题信息" } }, "value": "%Null%" }, "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "对话主题", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "对话主题", "ColumnName": "用户", "GUID": "1041a413-15a6-41d2-b7cd-6c4c93a9ec6a" }, "Value": "%CurrentUser%" }, { "BindingInfo": { "TableName": "对话主题", "ColumnName": "主题", "GUID": "c1419f50-4e91-4e36-ad86-99086a9ae013" }, "Value": "新创建的主题" } ], "ParamNameToSaveNewRowValue": "主题信息" } ], "ID": "23a84d0a-4a11-44ae-b4ba-5078a5a6f266" } ] }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "当前用户", "ParameterValue": "%CurrentUser%", "ID": "9adec28510a64178b629bf740173d72f" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "消息记录", "TableValue": { "TableName": "对话历史", "BindingInfos": [ { "GUID": "05c68ac8-2b71-4abd-99e0-e6e0f4d195b1", "BindingInfo": { "TableName": "对话历史", "ColumnName": "角色", "GUID": "2b8d2f47-f447-4851-b920-3f8917ed16e3" }, "ColumnName": "role" }, { "GUID": "7847e49c-4254-499b-ac14-cbc81ed29335", "BindingInfo": { "TableName": "对话历史", "ColumnName": "内容", "GUID": "e9fe5d96-47d4-49b9-aa7a-a5b3ed984c7b" }, "ColumnName": "content" }, { "GUID": "009b02ae-8ac0-4699-8446-28f0df518ecb", "BindingInfo": { "TableName": "对话历史", "ColumnName": "图片", "GUID": "c3d18449-c1a4-4754-abd8-0edc49309d48" }, "ColumnName": "img" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "对话历史", "ColumnName": "主题", "GUID": "f7d70ba9-3871-4633-a196-b8967915305b" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=主题ID" } }, "OrderBySqlCondition": { "OrderByColumns": [ { "ColumnBindingInfo": { "TableName": "对话历史", "ColumnName": "FGC_CreateDate", "GUID": "834fe33b-50ff-4c97-9211-aa91de5726c0" }, "Order": 0 } ] } }, "ID": "ee09c660717e4658aad9d1f056d4a294" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=消息记录.Count" } }, "value": "0", "compareType": 2 }, "CommandList": [ { "$type": "Forguncy.Model.NotificationMessageCommand, ServerDesignerCommon", "NotificationName": "AI流消息", "SendType": 1, "UserNames": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=当前用户" }, "Params": [ { "Name": "角色" }, { "Name": "内容", "Value": "strat" } ], "ID": "33b6a7ea5aeb40d78695440299de376e" }, { "$type": "OPENAIFORGUNCY.Completions, OPENAIFORGUNCY", "URL": "https://openai.api2d.net", "APIKEY": "fk211858-C6yKrsealBkvHao04yT9Ypg6GR0NVPyh", "ORGANIZATION": "", "IsDataSource": "json", "MessageJSON": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=消息记录" }, "Parameter": { "Model": 42, "Temperature": 1.0, "TopP": 1.0, "MaxTokens": 1000, "SystemContent": "你是一个乐于助人的智能助手,请您为我解答我提出的问题。", "Response_format": "text", "Stream": true }, "Tools": [], "ResultTo": "result", "CommandList": [ { "$type": "Forguncy.Model.NotificationMessageCommand, ServerDesignerCommon", "NotificationName": "AI流消息", "SendType": 1, "UserNames": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=当前用户" }, "Params": [ { "Name": "角色", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.role" } }, { "Name": "内容", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.content" } } ], "ID": "9d2bb17a5f964e2c9e8a874273cafbe4" } ] }, { "$type": "Forguncy.Model.NotificationMessageCommand, ServerDesignerCommon", "NotificationName": "AI流消息", "SendType": 1, "UserNames": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=当前用户" }, "Params": [ { "Name": "角色" }, { "Name": "内容", "Value": "done" } ], "ID": "0cf23e921fd44b7bad72bad1d0446d31" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=主题信息.主题" } }, "value": "新创建的主题" }, "CommandList": [ { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "对话主题", "ShowConfirm": false, "RowsToUpdate": 1, "RowsToUpdateCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "对话主题", "ColumnName": "ID", "GUID": "665e9b45-d556-43f1-be2f-3344a1529679" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=主题信息.ID" } }, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "对话主题", "ColumnName": "主题", "GUID": "d5b820d6-2ce8-404d-b278-811dd721fb59" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=LEFT(消息记录.0.content,12)" } } ] } ], "ID": "783a0517-f995-4d73-82be-c7c6936eba22" } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "回答完毕" } ], "ID": "341980fc-96ae-4bfb-b828-d5dec4c113da" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "请输入消息" } ], "ID": "75a883a7-a2ad-470a-a644-0df702c8bc17" } ] } ] }