Agents calling agents
This pull request introduces several new features and improvements, including the addition of example scripts for agent delegation and selective tools, as well as integration tests for the agent delegation system. Additionally, some outdated tests have been removed. Below are the most important changes:
### New Features:
* Added an example script demonstrating agent-to-agent delegation using a parent-child approach in `examples/agent_delegation.py`. This script creates multiple specialized agents and attaches them to a main coordinator agent for task delegation.
* Added an example script demonstrating the use of selective tools loading from built-in modules in `examples/selective_tools.py`. This script shows how to initialize an agent with selective tools from the Notion module.
### Integration Tests:
* Introduced integration tests for the agent delegation system in `tests/integration/test_agent_delegation_integration.py`. These tests verify that the agent delegation system works correctly under various scenarios, focusing on parallel execution and error handling.
### Documentation:
* Updated the `docs/docs/core-concepts.md` file to change the method `thread.to_dict()` to `thread.model_dump()` for converting a thread to a dictionary for storage.
### Test Cleanup:
* Removed outdated tests related to the `_process_streaming_chunks` method in `tests/models/test_agent.py` and `tests/models/test_agent_streaming.py`. These tests included scenarios with no chunks, tool call continuation chunks, and streaming chunks with content only or with tool calls. [[1]](diffhunk://#diff-a297043f1cdc938f1d6826bee57e255433382cf3cdc216e839e542a679de011eL1170-L1257) [[2]](diffhunk://#diff-d27ae1c708b37ba4d72f4df5f6d8a8c0d8fb8c071c24f4bafd6856e8faad1215L72-L152)
合并状态:已合并 合并于 2025-04-02 关闭于 2025-04-02 0 条评论