Skip to content

feat: add AgentAsTool#1932

Open
notowen333 wants to merge 1 commit intostrands-agents:mainfrom
notowen333:agent-as-tool
Open

feat: add AgentAsTool#1932
notowen333 wants to merge 1 commit intostrands-agents:mainfrom
notowen333:agent-as-tool

Conversation

@notowen333
Copy link

Description

Will close #1002.

This PR adds the AgentAsTool class as well as a convenience method on the Agent class to return an instance of it.

The AgentAsTool class just calls stream_async on the underlying agent and formats the response as a ToolResultEvent.

The added integration test confirms that an AgentAsTool was invoked and that agent-as-tool used a tool of its own.

Related Issues

#1002

Documentation PR

Not yet provided. I was planning to follow up with this.

Type of Change

New feature

Testing

  • Added unit tests

  • Added a minimal integ test

  • [ x] I ran hatch run prepare

Checklist

  • [ x ] I have read the CONTRIBUTING document
  • [ x ] I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • [ x ] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • [ x ] My changes generate no new warnings
  • [ x ] Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Agent to_tool method

1 participant