Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

强烈推荐小学同学接入这个项目,提供了web http api,测试管用 #244

Open
joe12801 opened this issue Apr 23, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@joe12801
Copy link

强烈推荐接微信机器人接入这个项目,提供了web http api,测试管用
0e863e56eddb1415ebcd3045ded5838
接入一个,就可以同时有多个机器人
https://github.com/lss233/chatgpt-mirai-qq-bot
 HTTP API
config.cfg 中加入以下配置后,将额外提供 HTTP API 支持。[http]

填写提供服务的端口

host = "0.0.0.0"
port = 8080
debug = false
启动后将提供以下接口:
POST /v1/chat
请求参数
参数名必选类型说明
session_id 是 String 会话ID,默认:friend-default_session
username 是 String 用户名,默认:某人
message 是 String 消息,不能为空
请求示例
{
"session_id": "friend-123456",
"username": "testuser",
"message": "ping"
}
响应格式
参数名类型说明
result String SUCESS,DONE,FAILED
message String[] 文本返回,支持多段返回
voice String[] 音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,...
image String[] 图片返回,支持多个图片的base64编码;参考:data:image/png;base64,...
响应示例
{
"result": "DONE",
"message": ["pong!"],
"voice": [],
"image": []
}
POST /v2/chat
请求参数
参数名必选类型说明
session_id 是 String 会话ID,默认:friend-default_session
username 是 String 用户名,默认:某人
message 是 String 消息,不能为空
请求示例
{
"session_id": "friend-123456",
"username": "testuser",
"message": "ping"
}
响应格式 字符串:request_id
响应示例
1681525479905
GET /v2/chat/response
请求参数
参数名必选类型说明
request_id 是 String 请求id,/v2/chat返回的值
请求示例
/v2/chat/response?request_id=1681525479905
响应格式
参数名类型说明
result String SUCESS,DONE,FAILED
message String[] 文本返回,支持多段返回
voice String[] 音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,...
image String[] 图片返回,支持多个图片的base64编码;参考:data:image/png;base64,...
每次请求返回增量并清空。DONE、FAILED之后没有更多返回。
响应示例
{
"result": "DONE",
"message": ["pong!"],
"voice": ["data:audio/mpeg;base64,..."],
"image": ["data:image/png;base64,...", "data:image/png;base64,..."]
}
🦊 加载预设
如果你想让机器人自动带上某种聊天风格,可以使用预设功能。
我们自带了 猫娘 和 正常 两种预设,你可以在 presets 文件夹下了解预设的写法。
使用 加载预设 猫娘 来加载猫娘预设。
下面是一些预设的小视频,你可以看看效果:
MOSS: https://www.bilibili.com/video/av309604568
丁真:https://www.bilibili.com/video/av267013053
小黑子:https://www.bilibili.com/video/av309604568

@joe12801
Copy link
Author

poe 也已经提供claude 机器人

@joe12801
Copy link
Author

joe12801 commented May 2, 2023

上面的项目,已经接入 slack-claude

@afan1123
Copy link

afan1123 commented Jun 7, 2023

上面的项目,已经接入 slack-claude

可以跟博主这个结合起来吗,可以的话,求教程大佬

@yihong0618 yihong0618 added the good first issue Good for newcomers label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants