add dingtalk file support, fix video/voice file to bailian (#1683)

* add dingtalk file support, fix video/voice file to bailian

* fix bailian files conversation

* 更新 bailianchatcmpl.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update libs/dingtalk_api/api.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: bump langbot-plugin version to 0.1.3b1

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Junyan Qin <rockchinq@gmail.com>
This commit is contained in:
Bruce
2025-09-29 16:33:42 +08:00
committed by GitHub
parent 72d701df3e
commit ea42579374
7 changed files with 262 additions and 2 deletions

View File

@@ -80,7 +80,8 @@ class CommandHandler(handler.MessageHandler):
self.ap.logger.info(f'Command({query.query_id}) error: {self.cut_str(str(ret.error))}')
yield entities.StageProcessResult(result_type=entities.ResultType.CONTINUE, new_query=query)
elif ret.text is not None or ret.image_url is not None or ret.image_base64 is not None:
elif (ret.text is not None or ret.image_url is not None or ret.image_base64 is not None
or ret.file_url is not None):
content: list[provider_message.ContentElement] = []
if ret.text is not None:
@@ -92,6 +93,9 @@ class CommandHandler(handler.MessageHandler):
if ret.image_base64 is not None:
content.append(provider_message.ContentElement.from_image_base64(ret.image_base64))
if ret.file_url is not None:
# 此时为 file 类型
content.append(provider_message.ContentElement.from_file_url(ret.file_url, ret.file_name))
query.resp_messages.append(
provider_message.Message(
role='command',