Categorygithub.com/bincooo/llm-plugin
modulepackage
1.0.0
Repository: https://github.com/bincooo/llm-plugin.git
Documentation: pkg.go.dev

# README

描述

这是ZeroBot-Plugin的一个AI接入插件,集成了openai-apiopenai-webBingAIclaudedify

内部实现了等待对话,web可视化配置。拦截链实现:内置了cahce(对话缓存)、tmpl(模板引擎)


模板引擎:

web预设配置,在处理器一栏中填写tmpl即可使用。

消息模版预设模版 这两栏可以使用模板引擎

》》》使用示例 《《《

变量使用:

{
    "args": {
        "Current": "[QQ]",
        "Nickname": "[qq昵称]"
    },
    "online": [
        {
						"id": "[在线的QQ]",
          	"name": "[在线的qq昵称]"
        },
      	...
    ],
    "date": "[当前日期]",
    "content": "[当前用户对话]"
}

模版:

(你的主人是折戟沉沙,当前与你对话的是{{.args.Nickname}},回复下面对话)
{{.args.Nickname}}: “{{.content}}”

结果:

(你的主人是折戟沉沙,当前与你对话的是鲁迪斯,回复下面对话)
鲁迪斯: “你好啊,喵小爱”

逻辑运算:

模版:

(你的主人是折戟沉沙,当前与你对话的是{{.args.Nickname}}{{if ne .args.Current "1263212xxx"}}但不是你的主人{{end}},回复下面对话)
{{.args.Nickname}}: “{{.content}}”

结果:

(你的主人是折戟沉沙,当前与你对话的是鲁迪斯但不是你的主人,回复下面对话)
鲁迪斯: “你好啊,喵小爱”

模版语法:【无】

自行查阅资料...

模板if判断、传(map_arr切片)数据渲染


step 1: 在ZeroBot-Pluginmain.go中导入包

import (
    llm "github.com/bincooo/llm-plugin"
)

setp 2: 在ZeroBot-Pluginmain.go大概在263行处添加llm.Run(":8081")

// 启用 webui
// go webctrl.RunGui(*g)
llm.Run(":8081")
if *runcfg != "" {

setp 3: 下载data-1.zip数据资源文件:

点我下载 解压并将目录名改名miaox移动至ZeroBot-Plugindata目录下

|- ZeroBot-Plugin
    |- data
        |- miaox

-

启动ZeroBot-Plugin后在浏览器内访问 http://127.0.0.1:8081 配置接入信息即可

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Variables

No description provided by the author