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

fix(plugins.deepseek_adapter): 修复导包错误 #1384

Closed
wants to merge 1 commit into from

Conversation

Cloxl
Copy link
Contributor

@Cloxl Cloxl commented Jan 7, 2025

采用仓库根路径的方式修复导包错误

Fixes #1383

Summary by Sourcery

修复 DeepSeek 适配器的导入路径。

Bug 修复:

  • 修复 DeepSeek 适配器的导入错误。

日常维护:

  • 将导入路径更新为相对于仓库根目录。
Original summary in English

Summary by Sourcery

Fix import path for the DeepSeek adapter.

Bug Fixes:

  • Fix import error for the DeepSeek adapter.

Chores:

  • Update the import path to be relative to the repository root.

Copy link
Contributor

sourcery-ai bot commented Jan 7, 2025

Here's the translation to Chinese:

审阅者指南 by Sourcery

此拉取请求通过使用仓库根路径修复了导入错误。这解决了问题 #1383

由于更改看起来简单且不需要可视化表示,因此未生成任何图表。

文件级更改

更改 详情 文件
更新了 DeepSeekAdapterDeepSeekConfig 的导入路径以使用仓库根路径。
  • 将导入路径从 deepseek_adapter.adapter 更改为 plugins.deepseek_adapter.adapter
plugins/deepseek_adapter/__init__.py

针对关联问题的评估

问题 目标 已解决 说明
#1383 修复 DeepSeek 适配器插件的导入路径以使用正确的导入方法

提示和命令

与 Sourcery 交互

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub 问题: 通过回复评论要求 Sourcery 创建一个问题。
  • 生成拉取请求标题: 在拉取请求标题的任何位置写 @sourcery-ai 以随时生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任何位置写 @sourcery-ai summary 以随时生成 PR 摘要。您还可以使用此命令指定摘要应插入的位置。

自定义您的体验

访问您的仪表板以:

  • 启用或禁用审阅功能,如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide by Sourcery

This pull request fixes an import error by using the repository root path. This addresses issue #1383.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Updated the import path for the DeepSeekAdapter and DeepSeekConfig to use the repository root path.
  • Changed the import path from deepseek_adapter.adapter to plugins.deepseek_adapter.adapter.
plugins/deepseek_adapter/__init__.py

Assessment against linked issues

Issue Objective Addressed Explanation
#1383 Fix the import path for the DeepSeek adapter plugin to use the correct import method

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

@Cloxl - 我已经审查了你的更改,看起来非常棒!

以下是我在审查期间关注的内容
  • 🟢 一般性问题:一切看起来都很好
  • 🟢 安全性:一切看起来都很好
  • 🟢 测试:一切看起来都很好
  • 🟢 复杂性:一切看起来都很好
  • 🟢 文档:一切看起来都很好

Sourcery 对开源项目是免费的 - 如果你喜欢我们的评论,请考虑分享 ✨
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我将使用这些反馈来改进你的评论。
Original comment in English

Hey @Cloxl - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@lss233
Copy link
Owner

lss233 commented Jan 8, 2025

插件本身是独立的模块,没有限制放哪里的。 为什么会有这个错误?

@Cloxl
Copy link
Contributor Author

Cloxl commented Jan 8, 2025

插件本身是独立的模块,没有限制放哪里的。为什么会有这个错误?

插件是在 main.py 加载的, 根据以下导入逻辑:

from deepseek_adapter.adapter import DeepSeekAdapter, DeepSeekConfig

项目结构应该是:

chatgpt-mirai-qq-bot/
├── deepseek_adapter/
│   ├── __init__.py
│   ├── adapter.py
│   ├── deep_seek_adapter.py
│   └── config.py
└── requirements.txt

而实际目录为:

chatgpt-mirai-qq-bot/
├── plugins/
│   └── deepseek_adapter/
│       ├── __init__.py
│       ├── adapter.py
│       ├── deep_seek_adapter.py
│       └── config.py
└── requirements.txt

是我的项目配置导致的路径错误码?

@lss233
Copy link
Owner

lss233 commented Jan 8, 2025

插件是在 https://github.com/lss233/chatgpt-mirai-qq-bot/blob/32a8ec849b8ac34edb52ce23b2c5ae07a946e94c/framework/plugin_manager/plugin_loader.py#L47C22-L47C58
加载的,作为独立模块导入的,你可以理解为它和项目同级

@Cloxl
Copy link
Contributor Author

Cloxl commented Jan 8, 2025

插件是在 https://github.com/lss233/chatgpt-mirai-qq-bot/blob/32a8ec849b8ac34edb52ce23b2c5ae07a946e94c/framework/plugin_manager/plugin_loader.py#L47C22-L47C58
加载的,作为独立模块导入的,你可以理解为它和项目同级

好的 应该是我本地问题

@Cloxl Cloxl closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants