一、安装etherpad

参考:
(https://blog.csdn.net/gitblog_01160/article/details/154600255)
github及官网上的连接404,手动克隆(国内镜像)

# 克隆仓库
git clone https://gitcode.com/gh_mirrors/et/etherpad-lite
 
# 进入目录
cd etherpad-lite
 
# 安装依赖
pnpm i
 
# 构建并启动
pnpm run build:etherpad
pnpm run prod

即可访问localhost:9001打开etherpad
如果关闭命令行或ctrlC会导致退出,需重新pnpm run prod
如果想在局域网内共享

# 进入目录
cd etherpad-lite
# 拷贝提供的默认配置,修改ip为0.0.0.0(一般已默认)
cp settings.json.template settings.json

关闭防火墙,查看本机ip,即可访问<本机IP>:9001
(如开启梯子需要关闭,会影响,踩了个坑)

二、连接LM studio

  1. LM studio准备
    lm studio配置好对应的模型,并start server,确定局域网内能访问对应ip:1234(默认端口)
    查看对应模型,可以直接在lm studio复制

  2. etherpad准备
    参考:https://libraries.io/npm/ep_ai_core
    登录etherpad后台,ip:9001/admin
    密码和用户名在setting.json文档里,原先是被注释掉的,记得删除注释,可以自己修改密码,大概长这样:

“users”: {
“admin”: {
// 1) “password” can be replaced with “hash” if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
“password”: “自己改”,
“is_admin”: true
},
“user”: {
// 1) “password” can be replaced with “hash” if you install ep_hash_auth
// 2) please note that if password is null, the user will not be created
“password”: “自己改”,
“is_admin”: false
}
},

进去后搜索ai相关插件
我下载了两个,ep_ai_coreep_ai_chat

 pnpm run plugins i ep_ai_core
 pnpm rum plugins i ep_ai_chat

安装完重新运行etherpad没发现AI,setting.json也没有自动生成对应的模块,只好自己在文末手动添加
一定要注意大括号数量!

  "ep_ai_core": {
    "apiBaseUrl": "http://localhost:1234/v1",//LM studio可访问的地址
    "apiKey": "lm-studio",
    "model": "(你模型的名字)",
    "provider": "openai",
    "access": {
      "defaultMode": "full"
    },
    "chat": {
      "trigger": "@ai",
      "authorName": "AI Assistant"
    }
  }
}

重新运行后,再访问etherpad,即可在聊天框召唤AI~

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐