AI玩游戏:我用FASTGPT实现了与原神游戏的互动


关注微信公众号“极光之门”了解更多

效果展示

1、查询原神游戏帐号信息

2、查询帐号内的游戏人物信息

3、看看是不是能收割一波了?

4、 查看剧情进度…

那么,这样一个能实时查询原神帐号数据的AI助手,你喜欢吗?下面我们来动手实现一个吧!

(不想看步骤的话,可以直接翻到最后获取源码,导入即可使用)

(仅供学习研究使用,切勿他用)教程步骤

1、打开FASTGPT

官网地址:https://cloud.fastgpt.in/

选择新建应用,点击“高级编排”

2、点击问题分类,先明确用户需要查什么信息

3、准备原神查询API

原神米游社API

这里需要在米游社App登录你的原神帐号,通过对应平台获取API接口信息。

接口URL:

实时便签APIhttps://api-takumi-record.mihoyo.com/game_record/app/genshin/api/dailyNote

帐号数据APIhttps://api-takumi-record.mihoyo.com/game_record/app/genshin/api/index

经测试,以下接口Header和Param必传:

Header部分:’Cookie’: ‘ltoken=xx;ltuid=xx’,
‘x-rpc-device_id’: ‘xx’,
‘x-rpc-app_version’: ‘2.68.1’,
‘DS’: ‘xx,xx,xx’,
‘x-rpc-client_type’: ‘5’

其中,仅有DS部分是需要根据时间戳和请求参数加密的,

Cookie内容需要抓取,其中ltoken和ltuid必传,

其他值均为固定。

Param部分:’server’: ‘cn_gf01’,
‘role_id’: ‘123456’,

role_id为你的游戏id。

DS参数算法(PHP代码):/**
* 米游社加密DS算法21.9.6
*
* @return string
*/
function getDS($query = null, $body) {
$i = "". time();
$r = random_str(6);
$q = "";
if ($query != null){
$que = [];
foreach ($query as $queryKey => $queryValue) {
$que[] = $queryKey . "=" . $queryValue;
}
$q = implode('&', $que);
}
$c = md5("salt=" . API_SALT . "&t=" . $i . "&r=" . $r . "&b=" . $body . "&q=" . $q);
return $i . "," . $r . "," . $c;
}

function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') {
$str = '';
$max = mb_strlen($keyspace, '8bit') - 1;
if ($max < 1) {
throw new Exception('$keyspace must be at least two characters long');
}
for ($i = 0; $i < $length; ++$i) {
$str .= $keyspace[random_int(0, $max)];
}
return $str;
}

query为请求参数,body为空即可

也可以直接使用我精简过的API:

参数名称说明
did大写字母字符串登录过App的设备ID,接口请求里有
rid帐号ID你要查询的游戏帐号ID
ltokentokenCookie里获取
ltuidtoken-2Cookie里获取

组合以后是:

https://51coolplay.cc/api/genshin/index.php?did=xx&rid=xx&ck=ltoken=xx;ltuid=xx

https://51coolplay.cc/api/genshin/dailyNote.php?did=xx&rid=xx&ck=ltoken=xx;ltuid=xx

替换xx为你的数据后,直接塞入HTTP模块里即可

4、设置模块触发顺序

需要注意,问题分类以后,触点接到HTTP请求上,再把URL填好,输出里选择你要的信息,像我这样:

然后点击“添加出参”,选择字段编辑:

data.homes是key,是json响应体中的data字段下homes字段的内容。

比如这样,具体的需要看接口有什么信息了。

5、设置 AI 请求样式,使用文本加工完成

通过问题和对应的原神游戏数据加工成Ai能看懂的样式,作为用户问题。

6、为AI解读接口字段信息

要想让AI解读接口信息的数据,你需要告诉他,哪个字段是什么含义。我把总结好的结果发出来:

提示词

壶中天/洞天的item_num字段代表摆设数量;

角色信息中的name字段是角色名称;fetter代表好感度等级;

世界探索度中的exploration_percentage字段除以100,代表百分比的探索度;

世界探索度中的level代表声望等级,0代表没有开启声望;

忽略世界探索度信息的二级以及子级的JSON数据;

原粹树脂信息中的current_resin字段代表现在的原粹树脂数量;

原粹树脂信息中的max_resin字段代表最大原粹树脂数量;

洞天宝钱信息中的current_home_coin字段代表现在聚集的洞天宝钱数量;

洞天宝钱信息中的max_home_coin字段代表现在最大洞天宝钱数量;

finished_task_num代表今天已经完成的委托任务数量;

total_task_num代表今天总的委托任务数量;

archon_quest_progress代表主线剧情进展。

然后保存即可。这样基于提示词、用户问题、聊天记录的AI对话就做好了,还可以再增加知识库来辅助回答,增强回答专业度。甚至背包物品、经验等等更多信息也可以实时查询,是不是很炫酷方便呢?(你也可以做成API,定时轮询,达到条件就推送到你手机上)

源码/导入参考

复制以下内容,创建应用,点击高级编排,点击导入

粘贴以下配置(记得把自己帐号参数改进来)

[
{
"moduleId": "userGuide",
"name": "core.module.template.User guide",
"avatar": "/imgs/module/userGuide.png",
"flowType": "userGuide",
"position": {
"x": -1769.9625778094617,
"y": 565.3352299880999
   },
"inputs": [
{
"key": "welcomeText",
"type": "hidden",
"valueType": "string",
"label": "core.app.Welcome Text",
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "我是原神帐号查询器,你需要查询什么呢?\n[查询我的原神帐号基础信息]\n[查询我的原神帐号游戏角色]\n[查询我的原神帐号的世界探索度]\n[查询我的原神帐号洞天宝钱满了吗]",
"connected": false
},
{
"key": "variables",
"type": "hidden",
"valueType": "any",
"label": "core.module.Variable",
"value": [],
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "questionGuide",
"valueType": "boolean",
"type": "switch",
"label": "",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "tts",
"type": "hidden",
"valueType": "any",
"label": "",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}
],
"outputs": []
},
{
"moduleId": "userChatInput",
"name": "core.module.template.Chat entrance",
"avatar": "/imgs/module/userChatInput.svg",
"flowType": "questionInput",
"position": {
"x": -1763.0033149316773,
"y": 970.0482198023894
   },
"inputs": [
{
"key": "userChatInput",
"type": "systemInput",
"valueType": "string",
"label": "core.module.input.label.user question",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}
],
"outputs": [
{
"key": "userChatInput",
"label": "core.module.input.label.user question",
"type": "source",
"valueType": "string",
"targets": [
{
"moduleId": "h945mj",
"key": "userChatInput"
         }
]
}
]
},
{
"moduleId": "2aef1r",
"name": "core.module.template.Http request",
"avatar": "/imgs/module/http.png",
"flowType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1045.9199186321248,
"y": -1739.2774050773357
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "system_httpMethod",
"type": "custom",
"valueType": "string",
"label": "",
"value": "GET",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpReqUrl",
"type": "hidden",
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "https://51coolplay.cc/api/genshin/",
"connected": false
},
{
"key": "system_httpHeader",
"type": "custom",
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpParams",
"type": "hidden",
"valueType": "any",
"value": [
{
"key": "did",
"value": "xxx",
"type": "string"
         },
{
"key": "rid",
"value": "123",
"type": "string"
         },
{
"key": "ck",
"value": "ltoken=xxx;ltuid=xxx",
"type": "string"
         }
],
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpJsonBody",
"type": "hidden",
"valueType": "any",
"value": "",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "DYNAMIC_INPUT_KEY",
"type": "target",
"valueType": "any",
"label": "core.module.inputType.dynamicTargetInput",
"description": "core.module.input.description.dynamic input",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": true,
"hideInApp": true,
"connected": false
},
{
"key": "system_addInputParam",
"type": "addInputParam",
"valueType": "any",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string",
"required": true
},
"connected": false
}
],
"outputs": [
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": [
{
"moduleId": "fjgjzj",
"key": "switch"
         }
]
},
{
"key": "system_addOutputParam",
"type": "addOutputParam",
"valueType": "any",
"label": "",
"targets": [],
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
       }
},
{
"type": "source",
"valueType": "string",
"label": "帐号信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [
{
"moduleId": "fjgjzj",
"key": "data"
         }
],
"key": "data.role"
     },
{
"type": "source",
"valueType": "string",
"label": "角色信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [],
"key": "data.avatars"
     },
{
"type": "source",
"valueType": "string",
"key": "data.world_explorations",
"label": "世界探索度",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": []
},
{
"type": "source",
"valueType": "string",
"key": "data.homes",
"label": "洞天宝地信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": []
}
]
},
{
"moduleId": "h945mj",
"name": "core.module.template.Classify question",
"avatar": "/imgs/module/cq.png",
"flowType": "classifyQuestion",
"showStatus": true,
"position": {
"x": -1385.3052022334589,
"y": 517.7764436446594
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "model",
"type": "selectCQModel",
"valueType": "string",
"label": "core.module.input.label.Classify model",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "gpt-3.5-turbo-1106",
"connected": false
},
{
"key": "systemPrompt",
"type": "textarea",
"valueType": "string",
"label": "core.module.input.label.Background",
"description": "core.module.input.description.Background",
"placeholder": "core.module.input.placeholder.Classify background",
"showTargetInApp": true,
"showTargetInPlugin": true,
"value": "你是原神查询器,原神是一款游戏,可以查询的信息有帐号基础信息、帐号内游戏角色信息、世界探索度和洞天宝地的信息。",
"connected": false
},
{
"key": "history",
"type": "numberInput",
"label": "core.module.input.label.chat history",
"required": true,
"min": 0,
"max": 30,
"valueType": "chatHistory",
"value": 6,
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "userChatInput",
"type": "custom",
"label": "",
"required": true,
"valueType": "string",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "agents",
"type": "custom",
"valueType": "any",
"label": "",
"value": [
{
"value": "查询帐号信息",
"key": "wqre"
         },
{
"value": "查询帐号角色/游戏人物信息",
"key": "sdfa"
         },
{
"value": "查询世界探索度",
"key": "agex"
         },
{
"value": "查询洞天宝地、壶中天信息",
"key": "hd1r"
         },
{
"value": "其他",
"key": "qbun"
         },
{
"value": "查询原粹树脂数量",
"key": "9aiv"
         },
{
"value": "查询洞天宝钱数量",
"key": "42kx"
         },
{
"value": "查询日常任务/委托任务",
"key": "e4lz"
         },
{
"value": "查询主线剧情完成度",
"key": "b1s5"
         }
],
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
}
],
"outputs": [
{
"key": "userChatInput",
"label": "core.module.input.label.user question",
"type": "hidden",
"valueType": "string",
"targets": [
{
"moduleId": "fjgjzj",
"key": "question"
         },
{
"moduleId": "jyr27h",
"key": "userChatInput"
         }
]
},
{
"key": "wqre",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "2aef1r",
"key": "switch"
         }
]
},
{
"key": "sdfa",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "p3klfu",
"key": "switch"
         }
]
},
{
"key": "agex",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "r29eai",
"key": "switch"
         }
]
},
{
"key": "hd1r",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "59u9kr",
"key": "switch"
         }
]
},
{
"key": "qbun",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "jyr27h",
"key": "switch"
         }
]
},
{
"key": "9aiv",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "twewha",
"key": "switch"
         }
]
},
{
"key": "42kx",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "twewha",
"key": "switch"
         }
]
},
{
"key": "e4lz",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "twewha",
"key": "switch"
         }
]
},
{
"key": "b1s5",
"label": "",
"type": "hidden",
"targets": [
{
"moduleId": "twewha",
"key": "switch"
         }
]
}
]
},
{
"moduleId": "fjgjzj",
"name": "core.module.template.textEditor",
"avatar": "/imgs/module/textEditor.svg",
"flowType": "pluginModule",
"showStatus": false,
"position": {
"x": 1867.3500836551827,
"y": 856.9161556863568
   },
"inputs": [
{
"key": "pluginId",
"type": "hidden",
"label": "",
"value": "community-textEditor",
"valueType": "string",
"connected": false,
"showTargetInApp": false,
"showTargetInPlugin": false
},
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "textarea",
"valueType": "string",
"label": "文本内容",
"type": "textarea",
"required": true,
"description": "可以通过 {{key}} 的方式引用传入的变量。变量仅支持字符串或数字。",
"edit": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true,
"inputType": true
},
"connected": false,
"placeholder": "可以通过 {{key}} 的方式引用传入的变量。变量仅支持字符串或数字。",
"value": "问题:{{question}};\n原神游戏数据:{{data}}"
     },
{
"key": "data",
"valueType": "string",
"label": "数据",
"type": "target",
"required": true,
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true,
"inputType": false
},
"connected": true
},
{
"valueType": "string",
"label": "用户问题",
"type": "target",
"required": true,
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true,
"inputType": false
},
"key": "question",
"connected": true
},
{
"key": "DYNAMIC_INPUT_KEY",
"valueType": "any",
"label": "需要加工的输入",
"type": "addInputParam",
"required": false,
"description": "可动态的添加字符串类型变量,在文本编辑中通过 {{key}} 使用变量。非字符串类型,会自动转成字符串类型。",
"edit": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true,
"inputType": false
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string",
"required": true
},
"connected": false
}
],
"outputs": [
{
"key": "text",
"valueType": "string",
"label": "core.module.output.label.text",
"type": "source",
"edit": false,
"targets": [
{
"moduleId": "c2h9bp",
"key": "userChatInput"
         }
]
}
]
},
{
"moduleId": "c2h9bp",
"name": "core.module.template.Ai chat",
"avatar": "/imgs/module/AI.png",
"flowType": "chatNode",
"showStatus": true,
"position": {
"x": 2503.283030089195,
"y": 282.9643655833643
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "model",
"type": "selectChatModel",
"label": "core.module.input.label.aiModel",
"required": true,
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "gpt-3.5-turbo-1106",
"connected": false
},
{
"key": "temperature",
"type": "hidden",
"label": "",
"value": 0,
"valueType": "number",
"min": 0,
"max": 10,
"step": 1,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "maxToken",
"type": "hidden",
"label": "",
"value": 2000,
"valueType": "number",
"min": 100,
"max": 4000,
"step": 50,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "isResponseAnswerText",
"type": "hidden",
"label": "",
"value": true,
"valueType": "boolean",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "quoteTemplate",
"type": "hidden",
"label": "",
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "quotePrompt",
"type": "hidden",
"label": "",
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "aiSettings",
"type": "aiSettings",
"label": "",
"valueType": "any",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "systemPrompt",
"type": "textarea",
"label": "core.ai.Prompt",
"max": 300,
"valueType": "string",
"description": "core.app.tip.chatNodeSystemPromptTip",
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
"showTargetInApp": true,
"showTargetInPlugin": true,
"value": "壶中天/洞天的item_num字段代表摆设数量;\n角色信息中的name字段是角色名称;fetter代表好感度等级;\n世界探索度中的exploration_percentage字段除以100,代表百分比的探索度;\n世界探索度中的level代表声望等级,0代表没有开启声望;\n忽略世界探索度信息的二级以及子级的JSON数据;\n原粹树脂信息中的current_resin字段代表现在的原粹树脂数量;\n原粹树脂信息中的max_resin字段代表最大原粹树脂数量;\n洞天宝钱信息中的current_home_coin字段代表现在聚集的洞天宝钱数量;\n洞天宝钱信息中的max_home_coin字段代表现在最大洞天宝钱数量;\nfinished_task_num代表今天已经完成的委托任务数量;\ntotal_task_num代表今天总的委托任务数量;\narchon_quest_progress代表主线剧情进展。",
"connected": false
},
{
"key": "history",
"type": "numberInput",
"label": "core.module.input.label.chat history",
"required": true,
"min": 0,
"max": 30,
"valueType": "chatHistory",
"value": 6,
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "userChatInput",
"type": "custom",
"label": "",
"required": true,
"valueType": "string",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "quoteQA",
"type": "target",
"label": "知识库引用",
"description": "core.module.Dataset quote.Input description",
"valueType": "datasetQuote",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
}
],
"outputs": [
{
"key": "userChatInput",
"label": "core.module.input.label.user question",
"type": "hidden",
"valueType": "string",
"targets": []
},
{
"key": "history",
"label": "core.module.output.label.New context",
"description": "core.module.output.description.New context",
"valueType": "chatHistory",
"type": "source",
"targets": []
},
{
"key": "answerText",
"label": "core.module.output.label.Ai response content",
"description": "core.module.output.description.Ai response content",
"valueType": "string",
"type": "source",
"targets": []
},
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": []
}
]
},
{
"moduleId": "p3klfu",
"name": "core.module.template.Http request",
"avatar": "/imgs/module/http.png",
"flowType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1044.7588491481492,
"y": -671.002432512604
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "system_httpMethod",
"type": "custom",
"valueType": "string",
"label": "",
"value": "GET",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpReqUrl",
"type": "hidden",
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "https://51coolplay.cc/api/genshin/",
"connected": false
},
{
"key": "system_httpHeader",
"type": "custom",
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpParams",
"type": "hidden",
"valueType": "any",
"value": [
{
"key": "did",
"value": "xxx",
"type": "string"
         },
{
"key": "rid",
"value": "123",
"type": "string"
         },
{
"key": "ck",
"value": "ltoken=xxx;ltuid=xxx",
"type": "string"
         }
],
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpJsonBody",
"type": "hidden",
"valueType": "any",
"value": "",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "DYNAMIC_INPUT_KEY",
"type": "target",
"valueType": "any",
"label": "core.module.inputType.dynamicTargetInput",
"description": "core.module.input.description.dynamic input",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": true,
"hideInApp": true,
"connected": false
},
{
"key": "system_addInputParam",
"type": "addInputParam",
"valueType": "any",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string",
"required": true
},
"connected": false
}
],
"outputs": [
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": [
{
"moduleId": "fjgjzj",
"key": "switch"
         }
]
},
{
"key": "system_addOutputParam",
"type": "addOutputParam",
"valueType": "any",
"label": "",
"targets": [],
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
       }
},
{
"type": "source",
"valueType": "string",
"label": "帐号信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [],
"key": "data.role"
     },
{
"type": "source",
"valueType": "string",
"label": "角色信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [
{
"moduleId": "fjgjzj",
"key": "data"
         }
],
"key": "data.avatars"
     },
{
"type": "source",
"valueType": "string",
"key": "data.world_explorations",
"label": "世界探索度",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": []
},
{
"type": "source",
"valueType": "string",
"key": "data.homes",
"label": "洞天宝地信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": []
}
]
},
{
"moduleId": "r29eai",
"name": "core.module.template.Http request",
"avatar": "/imgs/module/http.png",
"flowType": "httpRequest468",
"showStatus": true,
"position": {
"x": 960.7398202888276,
"y": 255.35855600246805
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "system_httpMethod",
"type": "custom",
"valueType": "string",
"label": "",
"value": "GET",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpReqUrl",
"type": "hidden",
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "https://51coolplay.cc/api/genshin/",
"connected": false
},
{
"key": "system_httpHeader",
"type": "custom",
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpParams",
"type": "hidden",
"valueType": "any",
"value": [
{
"key": "did",
"value": "xxx",
"type": "string"
         },
{
"key": "rid",
"value": "123",
"type": "string"
         },
{
"key": "ck",
"value": "ltoken=xxx;ltuid=xxx",
"type": "string"
         }
],
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpJsonBody",
"type": "hidden",
"valueType": "any",
"value": "",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "DYNAMIC_INPUT_KEY",
"type": "target",
"valueType": "any",
"label": "core.module.inputType.dynamicTargetInput",
"description": "core.module.input.description.dynamic input",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": true,
"hideInApp": true,
"connected": false
},
{
"key": "system_addInputParam",
"type": "addInputParam",
"valueType": "any",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string",
"required": true
},
"connected": false
}
],
"outputs": [
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": [
{
"moduleId": "fjgjzj",
"key": "switch"
         }
]
},
{
"key": "system_addOutputParam",
"type": "addOutputParam",
"valueType": "any",
"label": "",
"targets": [],
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
       }
},
{
"type": "source",
"valueType": "string",
"label": "帐号信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [],
"key": "data.role"
     },
{
"type": "source",
"valueType": "string",
"label": "角色信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [],
"key": "data.avatars"
     },
{
"type": "source",
"valueType": "string",
"key": "data.world_explorations",
"label": "世界探索度",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [
{
"moduleId": "fjgjzj",
"key": "data"
         }
]
},
{
"type": "source",
"valueType": "string",
"key": "data.homes",
"label": "洞天宝地信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": []
}
]
},
{
"moduleId": "59u9kr",
"name": "core.module.template.Http request",
"avatar": "/imgs/module/http.png",
"flowType": "httpRequest468",
"showStatus": true,
"position": {
"x": -453.4484591522724,
"y": 696.6925638927709
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "system_httpMethod",
"type": "custom",
"valueType": "string",
"label": "",
"value": "GET",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpReqUrl",
"type": "hidden",
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "https://51coolplay.cc/api/genshin/",
"connected": false
},
{
"key": "system_httpHeader",
"type": "custom",
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpParams",
"type": "hidden",
"valueType": "any",
"value": [
{
"key": "did",
"value": "xxx",
"type": "string"
         },
{
"key": "rid",
"value": "123",
"type": "string"
         },
{
"key": "ck",
"value": "ltoken=xxx;ltuid=xxx",
"type": "string"
         }
],
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpJsonBody",
"type": "hidden",
"valueType": "any",
"value": "",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "DYNAMIC_INPUT_KEY",
"type": "target",
"valueType": "any",
"label": "core.module.inputType.dynamicTargetInput",
"description": "core.module.input.description.dynamic input",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": true,
"hideInApp": true,
"connected": false
},
{
"key": "system_addInputParam",
"type": "addInputParam",
"valueType": "any",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string",
"required": true
},
"connected": false
}
],
"outputs": [
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": [
{
"moduleId": "fjgjzj",
"key": "switch"
         }
]
},
{
"key": "system_addOutputParam",
"type": "addOutputParam",
"valueType": "any",
"label": "",
"targets": [],
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
       }
},
{
"type": "source",
"valueType": "string",
"label": "帐号信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [],
"key": "data.role"
     },
{
"type": "source",
"valueType": "string",
"label": "角色信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [],
"key": "data.avatars"
     },
{
"type": "source",
"valueType": "string",
"key": "data.world_explorations",
"label": "世界探索度",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": []
},
{
"type": "source",
"valueType": "string",
"key": "data.homes",
"label": "洞天宝地信息",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [
{
"moduleId": "fjgjzj",
"key": "data"
         }
]
}
]
},
{
"moduleId": "jyr27h",
"name": "core.module.template.Ai chat",
"avatar": "/imgs/module/AI.png",
"flowType": "chatNode",
"showStatus": true,
"position": {
"x": -2172.6844009311235,
"y": 1672.7840182913578
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "model",
"type": "selectChatModel",
"label": "core.module.input.label.aiModel",
"required": true,
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "gpt-3.5-turbo-1106",
"connected": false
},
{
"key": "temperature",
"type": "hidden",
"label": "",
"value": 0,
"valueType": "number",
"min": 0,
"max": 10,
"step": 1,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "maxToken",
"type": "hidden",
"label": "",
"value": 2000,
"valueType": "number",
"min": 100,
"max": 4000,
"step": 50,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "isResponseAnswerText",
"type": "hidden",
"label": "",
"value": true,
"valueType": "boolean",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "quoteTemplate",
"type": "hidden",
"label": "",
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "quotePrompt",
"type": "hidden",
"label": "",
"valueType": "string",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "aiSettings",
"type": "aiSettings",
"label": "",
"valueType": "any",
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "systemPrompt",
"type": "textarea",
"label": "core.ai.Prompt",
"max": 300,
"valueType": "string",
"description": "core.app.tip.chatNodeSystemPromptTip",
"placeholder": "core.app.tip.chatNodeSystemPromptTip",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "history",
"type": "numberInput",
"label": "core.module.input.label.chat history",
"required": true,
"min": 0,
"max": 30,
"valueType": "chatHistory",
"value": 6,
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
},
{
"key": "userChatInput",
"type": "custom",
"label": "",
"required": true,
"valueType": "string",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "quoteQA",
"type": "target",
"label": "知识库引用",
"description": "core.module.Dataset quote.Input description",
"valueType": "datasetQuote",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": false
}
],
"outputs": [
{
"key": "userChatInput",
"label": "core.module.input.label.user question",
"type": "hidden",
"valueType": "string",
"targets": []
},
{
"key": "history",
"label": "core.module.output.label.New context",
"description": "core.module.output.description.New context",
"valueType": "chatHistory",
"type": "source",
"targets": []
},
{
"key": "answerText",
"label": "core.module.output.label.Ai response content",
"description": "core.module.output.description.Ai response content",
"valueType": "string",
"type": "source",
"targets": []
},
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": []
}
]
},
{
"moduleId": "twewha",
"name": "core.module.template.Http request",
"avatar": "/imgs/module/http.png",
"flowType": "httpRequest468",
"showStatus": true,
"position": {
"x": 1122.1148928432947,
"y": 1650.0884931396301
   },
"inputs": [
{
"key": "switch",
"type": "target",
"label": "core.module.input.label.switch",
"description": "core.module.input.description.Trigger",
"valueType": "any",
"showTargetInApp": true,
"showTargetInPlugin": true,
"connected": true
},
{
"key": "system_httpMethod",
"type": "custom",
"valueType": "string",
"label": "",
"value": "GET",
"required": true,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpReqUrl",
"type": "hidden",
"valueType": "string",
"label": "",
"description": "core.module.input.description.Http Request Url",
"placeholder": "https://api.ai.com/getInventory",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"value": "https://51coolplay.cc/api/genshin/dailyNote.php",
"connected": false
},
{
"key": "system_httpHeader",
"type": "custom",
"valueType": "any",
"value": [],
"label": "",
"description": "core.module.input.description.Http Request Header",
"placeholder": "core.module.input.description.Http Request Header",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpParams",
"type": "hidden",
"valueType": "any",
"value": [
{
"key": "did",
"value": "xxx",
"type": "string"
         },
{
"key": "rid",
"value": "123",
"type": "string"
         },
{
"key": "ck",
"value": "ltoken=xxx;ltuid=xxx",
"type": "string"
         }
],
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "system_httpJsonBody",
"type": "hidden",
"valueType": "any",
"value": "",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"connected": false
},
{
"key": "DYNAMIC_INPUT_KEY",
"type": "target",
"valueType": "any",
"label": "core.module.inputType.dynamicTargetInput",
"description": "core.module.input.description.dynamic input",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": true,
"hideInApp": true,
"connected": false
},
{
"key": "system_addInputParam",
"type": "addInputParam",
"valueType": "any",
"label": "",
"required": false,
"showTargetInApp": false,
"showTargetInPlugin": false,
"editField": {
"key": true,
"name": true,
"description": true,
"required": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"inputType": "target",
"valueType": "string",
"required": true
},
"connected": false
}
],
"outputs": [
{
"key": "finish",
"label": "core.module.output.label.running done",
"description": "core.module.output.description.running done",
"valueType": "boolean",
"type": "source",
"targets": [
{
"moduleId": "fjgjzj",
"key": "switch"
         }
]
},
{
"key": "system_addOutputParam",
"type": "addOutputParam",
"valueType": "any",
"label": "",
"targets": [],
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"defaultEditField": {
"label": "",
"key": "",
"description": "",
"outputType": "source",
"valueType": "string"
       }
},
{
"type": "source",
"valueType": "string",
"label": "数据",
"description": "",
"edit": true,
"editField": {
"key": true,
"name": true,
"description": true,
"dataType": true
},
"targets": [
{
"moduleId": "fjgjzj",
"key": "data"
         }
],
"key": "data"
     }
]
}
]

点击蓝字关注我们