Skip to content

Conversation

@zzhangpurdue
Copy link
Collaborator

Description

  1. add autogen/langgraph tool adapter
  2. update agentscope tool adapter
  3. add uts
  4. update docs

Related Issue: Fixes #[issue_number] or Relates to #[issue_number]

Security Considerations: [If applicable, especially for sandbox changes]

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Engine
  • Sandbox
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

Copy link
Member

@rayrayraykk rayrayraykk left a comment

Choose a reason for hiding this comment

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

Please move these test file to tests/tools

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds tool adapters for AutoGen and LangGraph frameworks, updates the AgentScope tool adapter with improved functionality, adds comprehensive unit tests for all three adapters, and updates the documentation with integration examples.

Key Changes:

  • Added LanggraphNodeAdapter for integrating tools with LangGraph workflows
  • Added AutogenToolAdapter and create_autogen_tools for AutoGen framework integration
  • Refactored AgentScope adapter from decorator pattern to function-based approach with agentscope_tool_adapter and agentscope_toolkit_adapter

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
tests/unit/test_langgraph_adapter.py Comprehensive test suite for LangGraph adapter covering creation, execution, error handling, and graph integration
tests/unit/test_autogen_adapter.py Unit tests for AutoGen adapter including creation, execution, and override functionality
tests/unit/test_agentscope_adapter.py Extensive tests for AgentScope adapter with toolkit creation, execution, and React agent integration
src/agentscope_runtime/adapters/langgraph/tool/tool.py Implementation of LanggraphNodeAdapter extending ToolNode with async execution support
src/agentscope_runtime/adapters/langgraph/tool/init.py Export definitions for LangGraph adapter
src/agentscope_runtime/adapters/autogen/tool/tool.py Implementation of AutogenToolAdapter and helper functions
src/agentscope_runtime/adapters/autogen/tool/init.py Export definitions for AutoGen adapter
src/agentscope_runtime/adapters/agentscope/tool/tool.py Refactored tool adapter with improved error handling and async support
src/agentscope_runtime/adapters/agentscope/tool/init.py Updated exports reflecting new function names
cookbook/zh/tools/tools.md Updated Chinese documentation with new adapter usage and AutoGen examples
cookbook/en/tools/tools.md Updated English documentation with new adapter usage and AutoGen examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@rayrayraykk rayrayraykk left a comment

Choose a reason for hiding this comment

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

Please add an FAQ section to explain the relationship between these out‑of‑the‑box Tools and sandbox environments. These Tools mainly wrap API calls (e.g., ModelStudio Search, RAG, Payments) and do not perform actions that could affect the local system environment — no file I/O, no process control, no privileged commands.
Because of this:

  • They do not require sandbox isolation.
  • Running them inside a sandbox would only add unnecessary complexity and overhead.
  • If sandbox execution is needed for tools that directly interact with local system resources, users should implement and deploy their own sandbox‑compatible Tools.

📖 FAQ

Q: Why can’t or shouldn’t these out‑of‑the‑box Tools run inside a sandbox?
A: Prebuilt Tools (like Search, RAG, AIGC, Payments) are purely API wrappers. Their logic executes on cloud services or third‑party platforms, and the local process only handles network requests. They do not alter system configurations, access local files, or spawn processes.
Sandboxing is meant to isolate potentially risky operations (e.g., running untrusted scripts, executing system commands). Since these Tools conform to production safety requirements, we don’t recommend or support running them within a sandbox.
If your use‑case needs to execute code that could impact the host environment, please follow sandbox integration patterns and create custom Tools designed for sandbox‑enabled engines.


Q: 为什么这些开箱即用的 Tool 不能(或不需要)在沙箱中运行?
A: 预置 Tool(如 Search、RAG、AIGC、Payments 等)本质上是 API 请求的封装,逻辑在云端或第三方服务完成,本地仅发出网络请求,不会修改系统配置、访问本地文件或启动进程。
沙箱的意义在于隔离可能有风险的操作(例如运行未知脚本、执行系统命令),而这些 Tool 已符合生产级安全要求,因此我们不建议也不会在沙箱中支持它们。
如果你的场景需要运行可能影响宿主环境的代码,请参考沙箱适配方式,编写自定义 Tool 并部署到支持沙箱的执行引擎中。

@zzhangpurdue
Copy link
Collaborator Author

Please add an FAQ section to explain the relationship between these out‑of‑the‑box Tools and sandbox environments. These Tools mainly wrap API calls (e.g., ModelStudio Search, RAG, Payments) and do not perform actions that could affect the local system environment — no file I/O, no process control, no privileged commands. Because of this:

  • They do not require sandbox isolation.
  • Running them inside a sandbox would only add unnecessary complexity and overhead.
  • If sandbox execution is needed for tools that directly interact with local system resources, users should implement and deploy their own sandbox‑compatible Tools.

📖 FAQ

Q: Why can’t or shouldn’t these out‑of‑the‑box Tools run inside a sandbox? A: Prebuilt Tools (like Search, RAG, AIGC, Payments) are purely API wrappers. Their logic executes on cloud services or third‑party platforms, and the local process only handles network requests. They do not alter system configurations, access local files, or spawn processes. Sandboxing is meant to isolate potentially risky operations (e.g., running untrusted scripts, executing system commands). Since these Tools conform to production safety requirements, we don’t recommend or support running them within a sandbox. If your use‑case needs to execute code that could impact the host environment, please follow sandbox integration patterns and create custom Tools designed for sandbox‑enabled engines.

Q: 为什么这些开箱即用的 Tool 不能(或不需要)在沙箱中运行? A: 预置 Tool(如 Search、RAG、AIGC、Payments 等)本质上是 API 请求的封装,逻辑在云端或第三方服务完成,本地仅发出网络请求,不会修改系统配置、访问本地文件或启动进程。 沙箱的意义在于隔离可能有风险的操作(例如运行未知脚本、执行系统命令),而这些 Tool 已符合生产级安全要求,因此我们不建议也不会在沙箱中支持它们。 如果你的场景需要运行可能影响宿主环境的代码,请参考沙箱适配方式,编写自定义 Tool 并部署到支持沙箱的执行引擎中。

done

@rayrayraykk rayrayraykk merged commit 0ea287e into agentscope-ai:dev Nov 28, 2025
6 checks passed
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