Skip to content

[search online] 新增联网搜索插件代码以及移动 code 节点代码#474

Merged
CodeCasterX merged 3 commits intoModelEngine-Group:mainfrom
surpercodehang:feature-search-online-plugin
Oct 10, 2025
Merged

[search online] 新增联网搜索插件代码以及移动 code 节点代码#474
CodeCasterX merged 3 commits intoModelEngine-Group:mainfrom
surpercodehang:feature-search-online-plugin

Conversation

@surpercodehang
Copy link
Copy Markdown
Contributor

@surpercodehang surpercodehang commented Oct 10, 2025

🔗 相关问题 / Related Issue

Issue 链接 / Issue Link: #473 👈👈

  • 我已经创建了相关 Issue 并进行了讨论 / I have created and discussed the related issue
  • 这是一个微小的修改(如错别字),不需要 Issue / This is a trivial change (like typo fix) that doesn't need an issue

📋 变更类型 / Type of Change

  • 🐛 Bug 修复 / 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)
  • 📚 文档更新 / Documentation update
  • 🔧 重构 / Refactoring (no functional changes)
  • ⚡ 性能优化 / Performance improvement
  • 📦 依赖升级 / Dependency upgrade (update dependencies to newer versions)
  • 🚀 功能增强 / Feature enhancement (improve existing functionality without breaking changes)
  • 🧹 代码清理 / Code cleanup

📝 变更目的 / Purpose of the Change

1、缺少联网搜索的插件,需要新增并内置
2、代码节点需要更改代码存放的位置,需要迁移

📋 主要变更 / Brief Changelog

  • 新增联网搜索插件
  • 移动代码节点插件到当前目录

🧪 验证变更 / Verifying this Change

测试步骤 / Test Steps

  1. 代码内置之后,可以正常启动并执行

测试覆盖 / Test Coverage

  • 我已经添加了单元测试 / I have added unit tests
  • 所有现有测试都通过 / All existing tests pass
  • 我已经进行了手动测试 / I have performed manual testing

📸 截图 / Screenshots

✅ 贡献者检查清单 / Contributor Checklist

请确保你的 Pull Request 符合以下要求 / Please ensure your Pull Request meets the following requirements:

基本要求 / Basic Requirements:

  • 确保有 GitHub Issue 对应这个变更(微小变更如错别字除外)/ Make sure there is a Github issue filed for the change (trivial changes like typos excluded)
  • 你的 Pull Request 只解决一个 Issue,没有包含其他不相关的变更 / Your PR addresses just this issue, without pulling in other changes - one PR resolves one issue
  • PR 中的每个 commit 都有有意义的主题行和描述 / Each commit in the PR has a meaningful subject line and body

代码质量 / Code Quality:

  • 我的代码遵循项目的代码规范 / My code follows the project's coding standards
  • 我已经进行了自我代码审查 / I have performed a self-review of my code
  • 我已经为复杂的代码添加了必要的注释 / I have commented my code, particularly in hard-to-understand areas

测试要求 / Testing Requirements:

  • 我已经编写了必要的单元测试来验证逻辑正确性 / I have written necessary unit-tests to verify the logic correction
  • 当存在跨模块依赖时,我尽量使用了 mock / I have used mocks when cross-module dependencies exist
  • 基础检查通过:mvn -B clean package -Dmaven.test.skip=truenpm install --force && npm run build:pro / Basic checks pass
  • 单元测试通过:mvn clean install / Unit tests pass

文档和兼容性 / Documentation and Compatibility:

  • 我已经更新了相应的文档 / I have made corresponding changes to the documentation
  • 如果有破坏性变更,我已经在 PR 描述中详细说明 / If there are breaking changes, I have documented them in detail
  • 我已经考虑了向后兼容性 / I have considered backward compatibility

📋 附加信息 / Additional Notes


审查者注意事项 / Reviewer Notes:

@surpercodehang surpercodehang added this to the 1.3.0 milestone Oct 10, 2025
@surpercodehang surpercodehang self-assigned this Oct 10, 2025
@surpercodehang surpercodehang added the type: feature A general feature label Oct 10, 2025
@surpercodehang surpercodehang linked an issue Oct 10, 2025 that may be closed by this pull request
4 tasks

Example:

from nexent.core.tools.standalone_web_search import internet_search
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 删除无用示例

@@ -0,0 +1,300 @@
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 缺少版权头

)
)
except Exception:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 异常情况增加日志记录,方便排查问题

)
)
except Exception:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 异常情况增加日志记录,方便排查问题

)
)
except Exception:
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 异常情况增加日志记录,方便排查问题

return text

# 按句子分割(简单按句号分割)
sentences = text.split('. ')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 文本如果不是以.为分隔符,这段逻辑没有作用

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

有些工具搜索出来的可能只是类似于标题相关的内容,不是正文,这里就是以.分割的

@surpercodehang surpercodehang removed the request for review from XinLi-cyber October 10, 2025 07:19
@loveTsong
Copy link
Copy Markdown
Contributor

这个变更包含了两部分,一个是移动插件,一个是新增插件。建议后续碰到这种比较独立的事项时,分开做更好。

return text

# 按句子分割(简单按句号分割)
sentences = text.split('. ')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 这里注释和实际代码不太匹配。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这个不就是英文的句号吗

summary_parts.append(sentence)
current_length += sentence_length

summary = '. '.join(summary_parts)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

image 这里join后看起来会多一个点

@surpercodehang surpercodehang force-pushed the feature-search-online-plugin branch from 5e91346 to c70ab45 Compare October 10, 2025 08:02
@CodeCasterX CodeCasterX added the in: builder Issues in app-builder modules label Oct 10, 2025
@CodeCasterX CodeCasterX merged commit dcaa4cb into ModelEngine-Group:main Oct 10, 2025
1 check passed
@github-project-automation github-project-automation bot moved this to Done in Nova Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: builder Issues in app-builder modules type: feature A general feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

新增联网搜索插件

5 participants