docs: add guide for handling large tool outputs#774
Open
vinod151019 wants to merge 1 commit intostrands-agents:mainfrom
Open
docs: add guide for handling large tool outputs#774vinod151019 wants to merge 1 commit intostrands-agents:mainfrom
vinod151019 wants to merge 1 commit intostrands-agents:mainfrom
Conversation
Addresses strands-agents#726. Documents three composable patterns — file reference, AfterToolCallEvent hook, and wrapper tool — for keeping multi-megabyte tool results out of the agent context window.
Author
|
Hi @lizradway, thanks for the update on #726. Sharing what this PR adds for the team's review:
Related roadmap items for context:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new page at
user-guide/concepts/tools/handling-large-outputsdocumenting three composable patterns for keeping multi-megabyte tool results out of the agent context window:invocation_statefor the caller.Closes #726.
Changes
src/content/docs/user-guide/concepts/tools/handling-large-outputs.mdx(137 lines, matches length and style of sibling pages likeexecutors.mdxandvended-tools.mdx).src/config/navigation.ymlto list the page under Tools.Verification
npx astro buildcompletes successfully; the new page builds at/docs/user-guide/concepts/tools/handling-large-outputs/.../agents/hooks.md,./custom-tools.md,../plugins/index.md, etc.) resolve. Zero new broken links inbroken-links.log.strands-agents/sdk-pythonmain:AfterToolCallEvent.resultis writable (src/strands/hooks/events.py)event.tool_use["toolUseId"]/["name"]bracket syntax matchesToolUseTypedDict (src/strands/types/tools.py)Agent(..., invocation_state=...)used instead of**kwargs(the latter is deprecating persrc/strands/agent/agent.py)Notes for reviewers
run_queryandread_file_sliceas placeholders the reader supplies. I deliberately avoided shipping ashell-style executor snippet so readers don't copy-paste an unsafesubprocess.run(shell=True)into production.