Files
clue/ServerCommands/AI/AI对话.json

371 lines
13 KiB
JSON

{
"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": "7279057e-3b7f-4107-ba4a-e3a05dd993be",
"BindingInfo": {
"TableName": "对话主题",
"ColumnName": "ID",
"GUID": "83a31143-581e-4afc-8910-2826889e35af"
},
"ColumnName": "ID"
},
{
"GUID": "b75193c7-b3cf-4a34-b095-f00dc18cf561",
"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": "6b4bb154d8474e388bad84d8baa146aa"
},
{
"$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": "d6b8fb4a-01bd-4371-99f1-18aaa3b4c169"
}
]
},
{
"$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": "4d179a9d07d24f95bdeaf92d55da33db"
}
]
},
{
"$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": "03d86005-473f-46ad-b5e1-b31f48cef5c1"
}
]
},
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "0",
"Message": "回答完毕"
}
],
"ID": "6c2da05e-4900-40ba-8eb5-96411b30c69e"
},
{
"CommandList": [
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "400",
"Message": "请输入消息"
}
],
"ID": "ee0ed562-635a-4011-9c69-4b9266f42647"
}
]
}
]
}