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

Feat: add OneBot protocol tool #7583

Merged
merged 4 commits into from
Aug 23, 2024
Merged

Conversation

RockChinQ
Copy link
Contributor

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

OneBot is a protocol in IM bot ecology, and be widely used in many protocol ends or applications. With this tool, workflow can send message to IM such as QQ, WeChat, Telegram.

Fixes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Deploy a protocol end (can be found in the ecology page) , enable http port, and fill the ob11_http_url in tool credentials, then use it in flow.

Sending Text to Person

94065dd41b8a78375cd864015933fd41

image

Sending Image to Group

8a879c0058beb2e690737c17425ca3bd
image

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 💪 enhancement New feature or request 🔨 feat:tools Tools for agent, function call related stuff. labels Aug 23, 2024
@RockChinQ RockChinQ assigned RockChinQ and unassigned RockChinQ Aug 23, 2024
@RockChinQ RockChinQ marked this pull request as draft August 23, 2024 10:24
@RockChinQ RockChinQ marked this pull request as ready for review August 23, 2024 10:34
Copy link
Collaborator

@Yeuoly Yeuoly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 23, 2024
@RockChinQ RockChinQ merged commit 8807d88 into langgenius:main Aug 23, 2024
6 checks passed
@RockChinQ RockChinQ deleted the feat/onebot-tool branch August 23, 2024 11:16
@RockChinQ RockChinQ mentioned this pull request Aug 23, 2024
12 tasks
@yst-one
Copy link

yst-one commented Aug 28, 2024

大佬有问题啊 我postman没问题这个插件报错 {
"text": "",
"files": [],
"json": [
{
"error": "Failed to send private message: No connection adapters were found for '10.10.115.211:3000/send_private_msg'"
}
]
}

@RockChinQ
Copy link
Contributor Author

大佬有问题啊 我postman没问题这个插件报错 {
"text": "",
"files": [],
"json": [
{
"error": "Failed to send private message: No connection adapters were found for '10.10.115.211:3000/send_private_msg'"
}
]
}

你是自部署吗

@yst-one
Copy link

yst-one commented Aug 28, 2024

大佬有问题啊 我postman没问题这个插件报错 { “text”: “”, “files”: [], “json”: [ { “error”: “发送私人消息失败:未找到'10.10.115.211:3000/send_private_msg'的连接适配器”
}
]
}

你是自部署吗
是的

@yst-one
Copy link

yst-one commented Aug 28, 2024

dify 10.10.115.215 onebot 是 10.10.115.211 ,postman 没问题。还有一个问题就是我第一次设置好了onebot的地址,后面怎么没看到改地址的地方了

@RockChinQ
Copy link
Contributor Author

@yst-one 自部署情况下,需要让dify容器和你的onebot实例处于同一网络下,再从onebot工具指定ob实例的容器作为访问地址。

@yst-one
Copy link

yst-one commented Aug 28, 2024

@RockChinQ 意思是要在同一个ip 同一个机器上对吗 ?要用127.0.0.1?

@RockChinQ
Copy link
Contributor Author

@yst-one 网络问题比较复杂,自行解决一下哈

@yst-one
Copy link

yst-one commented Aug 28, 2024

@RockChinQ 现在就是在简单的同一个局域网下的,

@yst-one
Copy link

yst-one commented Aug 28, 2024

@RockChinQ 我在同一台机器上测试都不可以,发现插件没有把消息发出来,因为我的
image
image

根本没输出日志

cuiks pushed a commit to cuiks/dify that referenced this pull request Sep 2, 2024
idonotknow pushed a commit to AceDataCloud/Dify that referenced this pull request Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request 🔨 feat:tools Tools for agent, function call related stuff. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants