当前位置: 首页 > 工具软件 > Botpress > 使用案例 >

botpress搭建智能问答机器人

步博艺
2023-12-01

botpress搭建智能问答机器人

一.下载botpress源码

访问:https://github.com/botpress/botpress,下载最新的botpress源码

二.本地安装依赖

执行:yarn install 命令进行依赖包下载。

如果是公司内部网络,需配置node的http代理

执行:yarn build 进行构建

如果出现python语法错误,如下:

D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3>if not defined npm_config_node_gyp (node \"D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" clean )  else (node \"\" clean )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.3 | win32 | x64
gyp info ok

D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3>if not defined npm_config_node_gyp (node \"D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" configure --fallback-to-build --module=D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64\\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64 )  else (node \"\" configure --fallback-to-build --module=D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64\\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3\\lib\\binding\\node-v64-win32-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64 )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.3 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: D:\\anaconda3\\python.EXE -c import sys; print \"%s.%s.%s\" % sys.version_info[:3];
gyp ERR! stack   File \"<string>\", line 1
gyp ERR! stack     import sys; print \"%s.%s.%s\" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command \"D:\\\\Program Files\\\\nodejs\\\\node.exe\" \"D:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=D:\\\\develop-environment\\\\botpress12.6\\\\node_modules\\\\sqlite3\\\\lib\\\\binding\\\\node-v64-win32-x64\\\\node_sqlite3.node\" \"--module_name=node_sqlite3\" \"--module_path=D:\\\\develop-environment\\\\botpress12.6\\\\node_modules\\\\sqlite3\\\\lib\\\\binding\\\\node-v64-win32-x64\" \"--napi_version=4\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v64\"
gyp ERR! cwd D:\\develop-environment\\botpress12.6\\node_modules\\sqlite3
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error

执行:npm install -g node-gyp 安装node-gyp,可解决。

如果出现错误,单独到模块内部执行  yarn  build命令,单独build

三.启动botpress

执行yarn start启动botpress,恭喜你!你的机器人已经成功了。接下来进行langrage server  和duckling配置,来搭建你的中文问答机器人吧。

官方文档:https://botpress.com/docs/introduction

 类似资料: