Skip to content

Conversation

@InJunee
Copy link

@InJunee InJunee commented Dec 8, 2025

📝 PR Type

  • Add new sample
  • Update existing sample
  • Add new test cases
  • Fix test failures
  • Documentation/Configuration update

📚 Description

本次 PR 添加了三个新的示例到 functionality/ 目录,展示了如何使用 AgentScope 创建不同类型的工具类智能助手:

  1. functionality/calculator_assistant/ - 计算器助手示例

    • 演示如何使用 AgentScope 创建能够进行数学计算的智能助手
    • 支持基本运算、复杂表达式求值和科学计算
    • 展示了结构化输出(Pydantic 模型)的使用
  2. functionality/code_review_assistant/ - 代码审查助手示例

    • 演示如何使用 AgentScope 创建代码审查助手
    • 支持代码分析、Bug 检测、安全审查、性能优化建议等功能
    • 展示了如何使用 view_text_fileexecute_python_code 工具
  3. functionality/file_operations_assistant/ - 文件操作助手示例

    • 演示如何使用 AgentScope 创建文件操作助手
    • 支持文件读取、搜索、创建等操作
    • 展示了如何使用 execute_shell_commandexecute_python_codeview_text_file 工具

所有示例都遵循了项目规范:

  • 包含完整的 README.md 文档(中文)
  • 包含独立的 requirements.txt 文件
  • 代码结构清晰,符合 AgentScope 最佳实践
  • 放置在 functionality/ 目录下,符合项目目录结构规范

🧪 Testing Validation

1. 如何运行新增的示例?

每个示例都可以独立运行:

# 计算器助手
cd functionality/calculator_assistant
pip install -r requirements.txt
python main.py

# 代码审查助手
cd functionality/code_review_assistant
pip install -r requirements.txt
python main.py

# 文件操作助手
cd functionality/file_operations_assistant
pip install -r requirements.txt
python main.py

前置要求

  • Python 3.10 或更高版本
  • 设置环境变量 DASHSCOPE_API_KEY

2. 是否需要与 agentscope 进行集成测试?

这些示例是独立的示例代码,展示了 AgentScope 的基本功能。运行示例时需要:

  • 安装 agentscope[full]>=1.0.5
  • 配置有效的 DashScope API Key
  • 示例会启动交互式对话界面,可以手动测试各项功能

3. 代码是否已格式化?

已完成:已运行 pre-commit run --all-files,所有检查均通过:

  • ✅ Python AST 检查
  • ✅ YAML/JSON/TOML 格式检查
  • ✅ 代码风格检查(black, flake8, pylint)
  • ✅ 类型检查(mypy)
  • ✅ 其他格式检查

✅ Checklist

  • All sample code has been formatted with pre-commit run --all-files
  • All new/modified test cases have passed (run pytest tests/)
    • 注:本次 PR 未添加新的测试用例,这些示例为演示性示例,可通过手动运行验证功能
  • Test coverage has not decreased (if applicable)
    • 注:本次 PR 未修改现有测试,不适用
  • Sample code follows agentscope best practices (e.g., config management, logging)
    • ✅ 使用环境变量管理 API Key
    • ✅ 使用 ReActAgent 和 Toolkit
    • ✅ 代码结构清晰,包含文档字符串
  • Related documentation in agentscope-samples has been updated (e.g., README.md)

@InJunee InJunee requested a review from a team December 8, 2025 08:18
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.

1 participant