首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >手把手教你用腾讯云服务器搭建自己的fastgpt机器人

手把手教你用腾讯云服务器搭建自己的fastgpt机器人

原创
作者头像
怪盗LYL
发布2024-11-18 23:42:50
发布2024-11-18 23:42:50
1.2K0
举报
文章被收录于专栏:AIAI

服务器购买地址

  • 抢不到页不要担心,可以参加拼团活动
IMG_257
IMG_257

1.活动时间:11.1~11.30 2.上百款折扣商品可参与拼团,认准带“可拼团”角标的商品,仅需2人即可拼团成功。 3.参与拼团活动可获得「成团礼」和「PK礼」。「成团礼」只要成团,全员即送,买包年包月赠时长,买资源包赠额度;「PK礼」 团员的订单金额>团长的订单金额,全团即可获得最高2W元代金券。

购买

  • 因为我之前已经买过了,所以我是续费,续费也可以参与拼团活动。
IMG_258
IMG_258
  • 我的实例信息,注意我用的是OpenCloudOS系统,也可以选择centos或者ubuntu。
IMG_259
IMG_259

安装docker

记住设置的密码,ip为公网这个ip,默认用户名root,使用crt、windterm登录

亦可以在控制台直接登录网页连接。

IMG_260
IMG_260
IMG_261
IMG_261
  • 需要安装docker和docker-compose v2
代码语言:shell
复制
Debian使用:
apt update
apt install -y docker docker-compose-plugin
ubuntu使用:
apt update
apt install -y docker docker-compose-v2
OpenCloudOS使用:
_#更新系统软件包索引:_
执行以下命令,安装 Docker。
yum install docker -y
执行以下命令,运行 Docker。
systemctl start docker
执行以下命令,检查安装结果。
docker info
  • 如果不会可以使用腾讯云网页连接右上角这个ai询问。
IMG_262
IMG_262
代码语言:shell
复制
yum install docker -y 
IMG_263
IMG_263
代码语言:shell
复制
systemctl start docker

执行以下命令,检查安装结果。

代码语言:shell
复制
docker info
IMG_264
IMG_264
代码语言:shell
复制
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-(uname -m)" -o /usr/local/bin/docker-compose

速度慢的话可以下本地手动传上去。

https://github.com/docker/compose/releases

IMG_265
IMG_265
IMG_266
IMG_266
  • mv docker-compose-linux-x86_64 docker-compose
  • 为下载的 Docker Compose 文件添加执行权限:
  • chmod +x /usr/local/bin/docker-compose
  • 验证安装成功
IMG_267
IMG_267

安装fastgpt

IMG_268
IMG_268

配置config.json文件内容

  • vim config.json 修改配置
  • "llmModels": []里添加
代码语言:vim
复制
  {
      "model": "Qwen/Qwen2.5-7B-Instruct", // 模型名(对应OneAPI中渠道的模型名)
      "name": "Qwen/Qwen2.5-7B-Instruct", // 模型别名
      "avatar": "/imgs/model/openai.svg", // 模型的logo
      "maxContext": 16000, // 最大上下文
      "maxResponse": 4000, // 最大回复
      "quoteMaxToken": 13000, // 最大引用内容
      "maxTemperature": 1.2, // 最大温度
      "charsPointsPrice": 0, // n积分/1k token(商业版)
      "censor": false, // 是否开启敏感校验(商业版)
      "vision": true, // 是否支持图片输入
      "datasetProcess": true, // 是否设置为知识库处理模型(QA),务必保证至少有一个为true,否则知识库会报错
      "usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
      "usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
      "usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
      "usedInQueryExtension": true, // 是否用于问题优化(务必保证至少有一个为true)
      "toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。目前只有gpt支持)
      "functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式)
      "customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
      "customExtractPrompt": "", // 自定义内容提取提示词
      "defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
      "defaultConfig": {} // 请求API时,挟带一些默认配置(比如 GLM4 的 top\_p)
    },
IMG_269
IMG_269
  • 这是为了使用硅基流动提供的免费模型Qwen/Qwen2.5-7B-Instruct。

添加免费向量模型(不用知识库可以跳过这里)

  • 还是config.json里找到vectorModels部分如图
代码语言:vim
复制
{
      "model": "BAAI/bge-large-zh-v1.5",
      "name": "BAAI/bge-large-zh-v1.5",
      "avatar": "/imgs/model/openai.svg",
      "charsPointsPrice": 0,
      "defaultToken": 512,
      "maxToken": 3000,
      "weight": 100,
      "endpoint": "https://api.siliconflow.cn/v1/embeddings",
      "apikey": "硅基流动的apikey"
    },
IMG_270
IMG_270

添加免费重排模型(不用知识库可以跳过这里)

  • 还是config.json里,找到reRankModels

默认是没有填模型的,需要把下面代码复制到括号里面,并把硅基流动的api填入apikey里面

代码语言:vim
复制
{
      "model": "BAAI/bge-reranker-v2-m3",
      "name": "BAAI/bge-reranker-v2-m3",
      "charsPointsPrice": 0,
      "return\_documents": false,
      "max\_chunks\_per\_doc": 1024,
      "overlap\_tokens": 80,
      "requestUrl": "https://api.siliconflow.cn/v1/rerank",
      "requestAuth": "硅基流动的apikey"
      }
  • 到这里关于config.json的配置就完成了可以保存进行下一个文件的配置。esc然后:wq
IMG_271
IMG_271

docker-compose.yml配置

  • 把http://oneapi:3000/v1改成https://api.siliconflow.cn/v1
  • 把sk-fastgpt改成硅基流动的key
IMG_272
IMG_272
  • 修改sandbox和fastgpt为v4.8.13版本
IMG_273
IMG_273
  • 后台启动:docker-compose up -d
IMG_274
IMG_274
  • 因为网络问题可能会报错。
IMG_275
IMG_275
修改docker源
  • cd /etc
  • mkdir docker
  • vi /etc/docker/daemon.json
代码语言:vim
复制
{
   "registry-mirrors": [
   "https://mirror.ccs.tencentyun.com"
  ]
}
  • 将腾讯云的源加入
IMG_276
IMG_276
  • :wq保存
  • 执行以下命令,重启 Docker 即可。示例命令以 CentOS 7 为例。
  • sudo systemctl restart docker
  • 查看信息
  • sudo docker info
IMG_277
IMG_277
IMG_278
IMG_278
  • 如镜像源配置成功,则输出的内容中会包含以下部分:
代码语言:vim
复制
Registry Mirrors:

 https://mirror.ccs.tencentyun.com

运行

  • 回到cd /root/fastgpt/ 运行docker-compose up -d
IMG_279
IMG_279
  • 等全部显示绿色就部署好了
  • 打开3000端口
IMG_280
IMG_280
  • 接下来打开浏览器进入
  • http://你的ip:3000
  • 登录用户名root,密码1234
IMG_281
IMG_281
  • 工作台里点击新建简易应用,随便取个名字
  • 点击ai模型进行配置,选择刚才配置进去的模型,确认
IMG_282
IMG_282
IMG_283
IMG_283
  • 然后可以在右边对话测试一下没问题就可以点击发布
IMG_284
IMG_284
IMG_285
IMG_285

编写插件

  • 工作台右上角新建插件
IMG_286
IMG_286
  • 我写了个天气的可以导入试用下看看
代码语言:vim
复制
{
/*
* 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 
* "nodes": [{  "nodeId": "pluginInput",  "name": "workflow:template.plugin_start",  "intro": "workflow:intro_plugin_input",  "avatar": "core/workflow/template/workflowStart",  "flowNodeType": "pluginInput",  "showStatus": false,  "position": {    "x": -430.3069592486844,    "y": -450.3674570354825  },  "version": "481",  "inputs": [    {      "renderTypeList": [        "input",        "reference"      ],      "selectedTypeIndex": 0,      "valueType": "string",      "canEdit": true,      "key": "城市名字",      "label": "城市名字",      "description": "搜索的关键词",      "defaultValue": "",      "list": [        {          "label": "",          "value": ""        }      ],      "required": true,      "maxLength": 500,      "toolDescription": "搜索的关键词"    }  ],  "outputs": [    {      "id": "关键词",      "valueType": "string",      "key": "城市名字",      "label": "城市名字",      "type": "hidden"    }  ]},{  "nodeId": "pluginOutput",  "name": "common:core.module.template.self_output",  "intro": "workflow:intro_custom_plugin_output",  "avatar": "core/workflow/template/pluginOutput",  "flowNodeType": "pluginOutput",  "showStatus": false,  "position": {    "x": 4087.656977615906,    "y": -411.16288721335434  },  "version": "481",  "inputs": [    {      "renderTypeList": [        "reference"      ],      "valueType": "string",      "canEdit": true,      "key": "今天天气",      "label": "今天天气",      "isToolOutput": true,      "description": "",      "value": [        "ulyQYL47Sz4c",        "system_text"      ]    }  ],  "outputs": []},{  "nodeId": "pluginConfig",  "name": "common:core.module.template.system_config",  "intro": "",  "avatar": "core/workflow/template/systemConfig",  "flowNodeType": "pluginConfig",  "position": {    "x": -1422.5477631683134,    "y": -84.69050842930429  },  "version": "4811",  "inputs": [],  "outputs": []},{  "nodeId": "xSa9GOjOsm67",  "name": "HTTP 请求",  "intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",  "avatar": "core/workflow/template/httpRequest",  "flowNodeType": "httpRequest468",  "showStatus": true,  "position": {    "x": 163.61065676529563,    "y": -611.659635474579  },  "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://restapi.amap.com/v3/geocode/geo",      "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": "address",          "value": "{{$pluginInput.关键词$}}",          "type": "string"        },        {          "key": "output",          "value": "JSON",          "type": "string"        },        {          "key": "key",          "type": "string",          "value": "高德key"        }      ],      "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": "x-www-form-urlencoded",      "label": "",      "required": false,      "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      },      "description": "可以通过 JSONPath 语法来提取响应值中的指定字段",      "valueDesc": ""    }  ]},{  "nodeId": "x41a5RKNRcIC",  "name": "处理返回",  "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",  "avatar": "core/workflow/template/codeRun",  "flowNodeType": "code",  "showStatus": true,  "position": {    "x": 2385.452945067469,    "y": -640.8674570354824  },  "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({ data }) {\n    // 尝试将字符串解析为 JSON 对象\n    let weatherData;\n    try {\n        weatherData = JSON.parse(data);\n    } catch (error) {\n        return {\n            formattedWeatherInfo: \"提供的数据处理错误,请检查输入的JSON格式是否正确。\",\n            error: error.message\n        };\n    }\n\n    // 定义一个函数来格式化每个天气信息\n    function formatWeatherInfo(weatherInfo) {\n        const formattedUpdateTime = new Date(weatherInfo[\"reporttime\"]).toLocaleString();\n        return `🏙️ 城市: ${weatherInfo[\"city\"]}\\n` +\n               `🕒 更新: ${formattedUpdateTime}\\n` +\n               `🌦️ 天气: ${weatherInfo[\"weather\"]}\\n` +\n               `🌡️ 温度: ↓${weatherInfo[\"temperature\"]}℃\\n` +\n               `🌬️ 风向: ${weatherInfo[\"windpower\"]}\\n` +\n               `💦 湿度: ${weatherInfo[\"humidity\"] || '未知'}\\n`;\n    }\n\n    // 检查 weatherData 是否有 lives 属性,并且它是一个数组\n    if (weatherData && Array.isArray(weatherData[\"lives\"]) && weatherData[\"lives\"].length > 0) {\n        // 将所有天气信息格式化并合并到一个字符串中\n        const formattedWeatherInfo = formatWeatherInfo(weatherData[\"lives\"][0]);\n        return { formattedWeatherInfo };\n    } else {\n        // 如果没有 lives 属性,返回错误信息\n        return {\n            formattedWeatherInfo: \"提供的数据中没有找到有效的天气信息。\",\n            error: weatherData && weatherData[\"message\"] || \"无效的天气数据结构。\"\n        };\n    }\n}\n",      "valueDesc": "",      "description": "",      "debugLabel": "",      "toolDescription": ""    },    {      "renderTypeList": [        "reference"      ],      "valueType": "string",      "canEdit": true,      "key": "data",      "label": "data",      "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": [        "jrFy0GvpwLw2",        "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": "formattedWeatherInfo",      "valueType": "string",      "label": "formattedWeatherInfo",      "valueDesc": "",      "description": ""    }  ]},{  "nodeId": "ulyQYL47Sz4c",  "name": "文本拼接",  "intro": "可对固定或传入的文本进行加工后输出,非字符串类型数据最终会转成字符串类型。",  "avatar": "core/workflow/template/textConcat",  "flowNodeType": "textEditor",  "position": {    "x": 3399.76545416112,    "y": -389.8842566050879  },  "version": "486",  "inputs": [    {      "key": "system_textareaInput",      "renderTypeList": [        "textarea"      ],      "valueType": "string",      "required": true,      "label": "拼接文本",      "placeholder": "workflow:input_variable_list",      "valueDesc": "",      "description": "",      "debugLabel": "",      "toolDescription": "",      "value": "现在时间:{{$VARIABLE_NODE_ID.cTime$}}\n今天天气情况:\n{{$x41a5RKNRcIC.qLUQfhG0ILRX$}}"    },    {      "key": "system_addInputParam",      "renderTypeList": [        "addInputParam"      ],      "valueType": "dynamic",      "label": "",      "required": false,      "description": "workflow:dynamic_input_description_concat",      "customInputConfig": {        "selectValueTypeList": [          "string",          "number",          "boolean",          "object",          "arrayString",          "arrayNumber",          "arrayBoolean",          "arrayObject",          "arrayAny",          "any",          "chatHistory",          "datasetQuote",          "dynamic",          "selectApp",          "selectDataset"        ],        "showDescription": false,        "showDefaultValue": false      },      "valueDesc": "",      "debugLabel": "",      "toolDescription": ""    }  ],  "outputs": [    {      "id": "system_text",      "key": "system_text",      "label": "workflow:concatenation_result",      "type": "static",      "valueType": "string",      "description": ""    }  ]},{  "nodeId": "kw8u5ZeqskBe",  "name": "代码运行#2",  "intro": "执行一段简单的脚本代码,通常用于进行复杂的数据处理。",  "avatar": "core/workflow/template/codeRun",  "flowNodeType": "code",  "showStatus": true,  "position": {    "x": 885.2433749352831,    "y": -592.8674570354824  },  "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      },      "debugLabel": "",      "toolDescription": ""    },    {      "key": "codeType",      "renderTypeList": [        "hidden"      ],      "label": "",      "value": "js",      "debugLabel": "",      "toolDescription": ""    },    {      "key": "code",      "renderTypeList": [        "custom"      ],      "label": "",      "value": "function main({data}){\n            const parsedData = JSON.parse(data);\n            const code = parsedData[\"geocodes\"][0][\"adcode\"]\n\n    return {\n        code: code\n        \n    }\n}",      "debugLabel": "",      "toolDescription": ""    },    {      "renderTypeList": [        "reference"      ],      "valueType": "string",      "canEdit": true,      "key": "data",      "label": "data",      "customInputConfig": {        "selectValueTypeList": [          "string",          "number",          "boolean",          "object",          "arrayString",          "arrayNumber",          "arrayBoolean",          "arrayObject",          "arrayAny",          "any",          "chatHistory",          "datasetQuote",          "dynamic",          "selectApp",          "selectDataset"        ],        "showDescription": false,        "showDefaultValue": true      },      "required": true,      "value": [        "xSa9GOjOsm67",        "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": "workflow:pass_returned_object_as_output_to_next_nodes"    },    {      "id": "qLUQfhG0ILRX",      "type": "dynamic",      "key": "code",      "valueType": "string",      "label": "code"    }  ]},{  "nodeId": "jrFy0GvpwLw2",  "name": "HTTP 请求#2",  "intro": "可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)",  "avatar": "core/workflow/template/httpRequest",  "flowNodeType": "httpRequest468",  "showStatus": true,  "position": {    "x": 1411.8609553459844,    "y": -692.8674570354824  },  "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://restapi.amap.com/v3/weather/weatherInfo",      "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": "key",          "value": "高德key",          "type": "string"        },        {          "key": "extensions",          "value": "base",          "type": "string"        },        {          "key": "output",          "value": "JSONhttps://restapi.amap.com/v3/weather/weatherInfo",          "type": "string"        },        {          "key": "city",          "type": "string",          "value": "{{$kw8u5ZeqskBe.qLUQfhG0ILRX$}}"        }      ],      "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      },      "description": "可以通过 JSONPath 语法来提取响应值中的指定字段",      "valueDesc": ""    }  ]}
*/
  ],
  "edges": [{  "source": "x41a5RKNRcIC",  "target": "ulyQYL47Sz4c",  "sourceHandle": "x41a5RKNRcIC-source-right",  "targetHandle": "ulyQYL47Sz4c-target-left"},{  "source": "ulyQYL47Sz4c",  "target": "pluginOutput",  "sourceHandle": "ulyQYL47Sz4c-source-right",  "targetHandle": "pluginOutput-target-left"},{  "source": "pluginInput",  "target": "xSa9GOjOsm67",  "sourceHandle": "pluginInput-source-right",  "targetHandle": "xSa9GOjOsm67-target-left"},{  "source": "xSa9GOjOsm67",  "target": "kw8u5ZeqskBe",  "sourceHandle": "xSa9GOjOsm67-source-right",  "targetHandle": "kw8u5ZeqskBe-target-left"},{  "source": "kw8u5ZeqskBe",  "target": "jrFy0GvpwLw2",  "sourceHandle": "kw8u5ZeqskBe-source-right",  "targetHandle": "jrFy0GvpwLw2-target-left"},{  "source": "jrFy0GvpwLw2",  "target": "x41a5RKNRcIC",  "sourceHandle": "jrFy0GvpwLw2-source-right",  "targetHandle": "x41a5RKNRcIC-target-left"}
  ],
  "chatConfig": {"welcomeText": "","variables": [],"questionGuide": false,"ttsConfig": {  "type": "web"},"whisperConfig": {  "open": false,  "autoSend": false,  "autoTTSResponse": false},"chatInputGuide": {  "open": false,  "textList": [],  "customUrl": ""},"instruction": "","_id": "671d010888bfddcb52168edb"
  }
}
IMG_287
IMG_287
  • 之后在这使用
IMG_288
IMG_288
IMG_289
IMG_289

结语

  • 这样一个简单的可以查询天气预报的机器人就做好了,也可以自己增加各种插件丰富能力。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 服务器购买地址
  • 购买
  • 安装docker
  • 安装fastgpt
    • 配置config.json文件内容
    • 添加免费向量模型(不用知识库可以跳过这里)
    • 添加免费重排模型(不用知识库可以跳过这里)
    • docker-compose.yml配置
      • 修改docker源
  • 运行
    • 编写插件
  • 结语
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档